xnn.ffnn.models.oplslib.OPLSLibrary#
- class xnn.ffnn.models.oplslib.OPLSLibrary(atom_types=<factory>, bond_types=<factory>, angle_types=<factory>, dihedral_types=<factory>, improper_types=<factory>, fudge_lj=0.5, fudge_qq=0.5, name='opls', references=<factory>, templates=<factory>, fragments=<factory>, metadata=<factory>, notes=<factory>)[source]#
Bases:
objectA parsed OPLS parameter library, in OPLS units.
All energies are kcal/mol, lengths Angstrom, angles degrees. Bonded parameters are keyed by the equivalent atom types of the term joined with
-("opls_18-opls_18","opls_85-opls_18-opls_18-opls_85"), exactly as a.frcfile keys them; dihedral and improper keys may use the wildcardX("X-opls_86-opls_86-X"). Every atom type records, per term, which equivalent type its parameters are looked up under (cls_bondetc.;clsis a synonym ofcls_bond).Parameters and attributes#
- atom_typesdict[str, dict]
name -> {"cls", "cls_nonbond", "cls_bond", "cls_angle", "cls_torsion", "cls_oop", "element", "mass", "charge", "sigma", "epsilon", "connections", "comment"}whereelementis the atomic number andsigma/epsilonthe Lennard-Jones parameters (Angstrom, kcal/mol).- bond_typesdict[str, dict]
"A-B" -> {"k", "r0"}forE = k (r - r0)^2(OPLS/AMBER convention, without the 1/2).- angle_typesdict[str, dict]
"A-B-C" -> {"k", "theta0"}forE = k (theta - theta0)^2withtheta0in degrees.- dihedral_typesdict[str, dict]
"A-B-C-D" -> {"v": [V0, V1, V2, V3, V4]}Fourier coefficients (seefourier_to_rb()for the energy expression).- improper_typesdict[str, dict]
"I-J-K-L" -> {"v2"}for the improper energyV2/2 (1 - cos 2 phi), withKthe central atom andXwildcards, resolved byresolve_improper_type(). Libraries written before this format may carry opaque keys referenced fromimproper_keys.- fudge_lj, fudge_qqfloat
Scaling factors for 1,4 Lennard-Jones and Coulomb interactions (0.5 and 0.5 for OPLS).
- namestr
A short label for the parameter set.
- referenceslist[str]
Literature provenance of the parameters.
- templatesdict
SMARTS atom-typing templates (
type -> {"smarts", "description", ...}) when the library came from a.frcfile; consumed byassign_atom_types().- fragmentsdict
Whole-molecule typing fragments, likewise.
- metadatadict
The
#metadataentries (ff_form,charges).- noteslist[str]
Anything the reader had to fill in (e.g. atom types with no Lennard-Jones entry, set to zero).
- save(path)[source]#
Write the library as native JSON (read back by
read_opls()).- Parameters:
path (str or Path) – Output file path (conventionally
*.json).- Return type:
None