xnn.ffnn.models.oplslib#

OPLS parameter libraries: the SEAMM .frc format and native JSON.

An OPLS model (Jorgensen, Maxwell & Tirado-Rives, J. Am. Chem. Soc. 118, 11225, 1996) is fully specified by a parameter library: per-atom-type nonbonded parameters (partial charge, Lennard-Jones sigma / epsilon) plus bonded parameters keyed by the equivalent atom types of each term – harmonic bonds and angles, Fourier proper dihedrals and V2-only improper dihedrals. Two sources are supported:

  • the MolSSI/SEAMM .frc force-field format (xnn.ffnn.common.frc). The OPLS-AA distribution ships with xnn as oplsaa.frc (variants "oplsaa", "CL&P", "oplsaa+"), together with "lopls" (Siu, Pluhackova & Boeckmann, JCTC 8, 1459, 2012) and "oplsaa-1996" (the paper’s original alkane torsions) layered over it. A .frc library carries the SMARTS templates that assign its atom types to a structure (xnn.ffnn.common.typing, from_atoms());

  • the native JSON format of this module (read_opls() / OPLSLibrary.save()), a direct dump of OPLSLibrary used to round-trip trained parameters.

Energies are converted from kcal/mol to eV only when the model assembles its parameter tensors, mirroring xnn.ffnn.models.ffield.

Functions

builtin_library([name, strict])

Return one of the parameter sets shipped with xnn.

fourier_to_rb(v)

Convert OPLS Fourier coefficients to Ryckaert-Bellemans form.

from_forcefield(ff[, strict])

Build an OPLSLibrary from a resolved .frc force field.

improper_key(i, j, k, l)

Canonical improper key: outer classes sorted, central k third.

rb_to_fourier(c)

Convert Ryckaert-Bellemans coefficients to OPLS Fourier form.

read_opls(source[, strict])

Read an OPLS parameter library.

resolve_angle_type(angle_types, a, b, c)

Find the angle-type key for the class triple (a, b, c).

resolve_bond_type(bond_types, a, b)

Find the bond-type key for the class pair (a, b).

resolve_dihedral_type(dihedral_types, a, b, c, d)

Find the best dihedral-type key for the class quadruple.

resolve_improper_type(improper_types, i, j, k, l)

Find the improper-type key for the class quadruple, k central.

to_forcefield(lib[, name, version])

Write an OPLSLibrary as an in-memory .frc file.

Classes

OPLSLibrary([atom_types, bond_types, ...])

A parsed OPLS parameter library, in OPLS units.