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:
objectA 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 (Xwildcards 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, orNone/ 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
Xwildcards).- 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), orNoneto 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.frcfile. Kept for round-tripping only: ReaxFF MD codes (LAMMPS) do not add them to the energy, and neither doesReaxFF.- namestr
The force-field name (the
#defineof a.frcfile).- referenceslist[str]
Provenance text of the parameters, when the file carries it.
- 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:
p (dict)
m (dict | None)
spec (list)
bonds (list)
offd (list)
angs (list)
torp (list)
hbs (list)
messages (int)
bo_function (int)
energy_function (int)
message_function (int)
vdw_function (int)
bo_layer (tuple | None)
mf_layer (tuple | None)
be_layer (tuple | None)
vdw_layer (tuple | None)
rcut (dict | None)
rcuta (dict | None)
mol_energy (dict)
heat_increment (dict)
name (str)
references (list)