xnn.ffnn.models.ffield.FFieldLibrary#

class xnn.ffnn.models.ffield.FFieldLibrary(p, m=None, spec=<factory>, bonds=<factory>, offd=<factory>, angs=<factory>, torp=<factory>, hbs=<factory>, messages=1, bo_function=0, energy_function=0, message_function=0, vdw_function=0, bo_layer=None, mf_layer=None, be_layer=None, vdw_layer=None, rcut=None, rcuta=None, mol_energy=<factory>, heat_increment=<factory>, name='', references=<factory>)[source]#

Bases: object

A parsed ReaxFF parameter library.

Parameters and attributes#

pdict[str, float]

Flat parameter dictionary in the ReaxFF naming convention: general parameters by bare name ("boc1"), per-species as "<name>_<El>", per-bond as "<name>_<El>-<El>", valence angles as "<name>_<El>-<El>-<El>", torsions (X wildcards allowed) and hydrogen bonds likewise. Values are in the file’s units (energies in kcal/mol).

mdict or None

ReaxFF-nn weight matrices ("fmwi_C", "few_C-H", …) as nested lists, or None / empty when the library is a classical ReaxFF.

speclist[str]

Chemical symbols, in library order.

bondslist[str]

Bond types ("C-H") with bond parameters, in library order.

offdlist[str]

Off-diagonal (unlike-pair) types with explicit vdW/bond radii.

angslist[str]

Valence-angle types with parameters.

torplist[str]

Torsion types with parameters (may contain X wildcards).

hbslist[str]

Hydrogen-bond triples "X-H-Z" with parameters.

messagesint

Number of ReaxFF-nn message-passing steps T.

bo_function, energy_function, message_function, vdw_functionint

ReaxFF-nn function-form selectors (see ReaxFF).

bo_layer, mf_layer, be_layer, vdw_layertuple or None

(width, n_hidden) of the bond-order / message / bond-energy / vdW neural networks.

rcut, rcutadict[str, float] or None

Per-bond-type bond-order and valence cutoff tables (with an "others" fallback), or None to use the defaults.

mol_energydict[str, float]

Per-molecule reference-energy offsets some ReaxFF-nn training workflows record (not used by the model; kept for round-tripping).

heat_incrementdict[str, float]

The per-species atomic heat increments (Hat, species line 3, column 3 of the classical layout) as read from a .frc file. Kept for round-tripping only: ReaxFF MD codes (LAMMPS) do not add them to the energy, and neither does ReaxFF.

namestr

The force-field name (the #define of a .frc file).

referenceslist[str]

Provenance text of the parameters, when the file carries it.

property is_nn: bool#

Whether the library carries ReaxFF-nn network weights.

Type:

bool

save(path)[source]#

Write the library to disk in the ReaxFF-nn JSON format.

The file can be read back with read_ffield() (and by other tools that consume the same format).

Parameters:

path (str or Path) – Destination path (conventionally ffield.json).

Return type:

None

Parameters: