xnn.ffnn.models.amoebalib.AmoebaLibrary#

class xnn.ffnn.models.amoebalib.AmoebaLibrary(atom_types=<factory>, bond_types=<factory>, angle_types=<factory>, angle_inplane_types=<factory>, strbnd_types=<factory>, urey_types=<factory>, opbend_types=<factory>, torsion_types=<factory>, pitors_types=<factory>, tortor_types=<factory>, vdw_types=<factory>, vdw_pair_types=<factory>, multipoles=<factory>, polarize=<factory>, chgpen=<factory>, chgtrn=<factory>, repulsion=<factory>, dispersion=<factory>, exchpol=<factory>, ionct=<factory>, mbct=<factory>, ionpair=<factory>, bndcflux=<factory>, angcflux=<factory>, settings=<factory>, name='amoeba', references=<factory>, templates=<factory>, fragments=<factory>, metadata=<factory>, notes=<factory>)[source]#

Bases: object

A parsed AMOEBA / HIPPO parameter library, in Tinker units.

Energies are kcal/mol, lengths Angstrom, angles degrees, charges e, dipoles e bohr, quadrupoles e bohr^2, polarizabilities Angstrom^3, damping exponents 1/Angstrom. Bonded tables are keyed by the atom classes of the term joined with - in the canonical order of the .frc reader (bond and angle keys sorted end to end, torsions by their central pair); the out-of-plane key keeps its written order (out-of-plane atom, center, the two others); X is the wildcard.

Parameters and attributes#

atom_typesdict[str, dict]

type -> {"class", "element", "mass", "connections", "comment"}.

bond_typesdict[str, dict]

"A-B" -> {"k", "r0"} for k dr^2 (1 + c3 dr + c4 dr^2) with the cubic and quartic coefficients from settings.

angle_types, angle_inplane_typesdict[str, dict]

"A-B-C" -> {"k", "theta0": [theta_1, (theta_2, theta_3)]}: the ideal angles for a center carrying 0, 1 or 2 further hydrogens; the in-plane table applies to trigonal centers (Tinker anglep).

strbnd_typesdict[str, dict]

"A-B-C" -> {"k1", "k2"}, k1 for the A-B bond of the key.

urey_typesdict[str, dict]

"A-B-C" -> {"k", "r0"} on the A..C distance.

opbend_typesdict[str, dict]

"D-B-A-C" -> {"k"} with D the out-of-plane atom, B the trigonal center, A and C the other substituents (sorted, X wildcards).

torsion_typesdict[str, dict]

"A-B-C-D" -> {"terms": [[K, n, phase], ...]} for E = sum K [1 + cos(n phi - phase)] per dihedral (K already includes the file’s torsionunit).

pitors_typesdict[str, dict]

"B-C" -> {"k"} for k [1 - cos(2 phi)] on the p-orbital angle.

tortor_typesdict[str, dict]

"A-B-C-D-E" -> {"angles1", "angles2", "values"}: the two angle grids (degrees, -180 .. 180 inclusive) and the (nx, ny) energy table (kcal/mol, with tortorunit applied).

vdw_typesdict[str, dict]

class -> {"rmin", "eps", "reduction"}: the like-pair minimum distance (Tinker’s diameter), well depth and hydrogen reduction factor (1 for heavy atoms).

vdw_pair_typesdict[str, dict]

"A-B" -> {"rmin", "eps"} pair overrides (Tinker vdwpr).

multipolesdict[str, list]

type -> [{"frame": (kz, kx, ky), "q", "dipole": [3], "quadrupole": [[3 x 3]]}, ...], one entry per local-frame definition of the type, in file order. Frame entries are atom type names with Tinker’s sign convention ("-HW") or "0"; the dipole is in e bohr and the quadrupole traceless in e bohr^2, the atomic units of the parameter files and the papers.

polarizedict[str, dict]

type -> {"alpha", "thole", "groups": [types]}; thole = 0 means charge-penetration damping (HIPPO).

chgpen, chgtrn, repulsion, dispersiondict[str, dict]

Per class: {"core", "alpha"}, {"eps", "alpha"}, {"k", "alpha", "valence"}, {"c6", "alpha"}.

exchpoldict[str, dict]

Per class: {"spring", "size", "damp", "use"}, the exchange polarization of Chung et al. (2022): the spring constant k, the orbital size q and exponent zeta of the overlap, and the use flag (a pair takes part when either of its classes is used).

ionctdict[str, dict]

"ion-partner" -> {"a", "b"} (kcal/mol, 1/Angstrom): the charge transfer from the partner class into the ion class, -a exp(-b R), which replaces HIPPO’s charge transfer of every pair with the ion (a pair without a row has none). A pair of two classes has a row of one order only. An optional "x" is the hardness ratio of the partner’s molecule as a ligand of the ion in the many-body charge transfer (else the ion’s x).

mbctdict[str, dict]

class -> {"x"}: the many-body charge transfer of every molecule holding an atom of the class (a single-atom ion or a polyatomic one), with x the ratio of its hardness to its ligands’. The mbct-form setting picks the form: ceq (default), the charge equilibration of the ligands with no charge flowing back, or weighted, with the scale of its ligand weights in mbct-c0 (kcal/mol).

ionpairdict[str, dict]

"ion-partner" -> {"a", "c", "beta"} (kcal/mol, kcal/mol Angstrom^6, 1/Angstrom): a pair correction a exp(-beta R) - c f6(beta R) / R^6 with Tang-Toennies damping.

bndcfluxdict[str, dict]

"A-B" -> {"j"}: the bond charge flux, in e/Angstrom, moved from A to B per unit stretch of the key as stored.

angcfluxdict[str, dict]

"A-B-C" -> {"jt1", "jt2", "jb1", "jb2"} (e/radian, e/Angstrom).

settingsdict

The force-field definition keywords (see DEFAULT_SETTINGS).

namestr

Short label of the parameter set.

references, templates, fragments, metadata, notes

As for the other ffnn libraries.

property model: str#

"hippo" when the library carries charge-penetration (HIPPO) nonbonded terms, else "amoeba".

cls(type_name)[source]#

The atom class of an atom type (KeyError if unknown).

Parameters:

type_name (str)

Return type:

str

classes()[source]#

The atom classes, in first-appearance order of the types.

Return type:

list[str]

setting(key)[source]#

A force-field setting, with the Tinker default when unset.

Parameters:

key (str)

scale(term, sep)[source]#

The scale factor of term ("vdw", "mpole", "polar", "polar-intra", "direct", "mutual", "induce", "rep", "disp") for atoms separated by sep bonds (1,1 .. 1,5).

Parameters:
Return type:

float

strbnd(a, b, c)[source]#

(k1, k2) oriented to the bonds a-b and b-c as asked.

Parameters:
Return type:

tuple[float, float] | None

angle_flux(a, b, c)[source]#

(jt1, jt2, jb1, jb2) oriented to the atoms a, b, c as asked.

Parameters:
Return type:

tuple[float, float, float, float] | None

bond_flux(a, b)[source]#

The charge moved from a to b per unit stretch (sign follows the orientation asked).

Parameters:
Return type:

float | None

torsion(a, b, c, d)[source]#

The torsion row for the class quadruple (the exact key, in either direction, beats wildcard rows).

Parameters:
Return type:

dict | None

opbend(d, b, a, c)[source]#

The out-of-plane row for the out-of-plane atom d at center b whose other substituents are a and c: the exact row, then the wildcard rows for the other substituents.

Parameters:
Return type:

dict | None

tortor(a, b, c, d, e)[source]#

The torsion-torsion row for five classes in chain order and whether it matched in reverse (the two angles then swap).

Parameters:
Return type:

tuple[dict, bool] | None

save(path)[source]#

Write the library as native JSON.

Parameters:

path (str | Path)

Return type:

None

save_frc(path, name=None, version='1.0')[source]#

Write the library as a .frc force-field file.

Parameters:
Return type:

Path

Parameters: