xnn.ffnn.models.ffield#

ReaxFF parameter libraries: the SEAMM .frc format and ReaxFF-nn JSON.

A ReaxFF model is fully specified by its parameter library. Two on-disk formats are supported:

  • the MolSSI/SEAMM .frc force-field format (xnn.ffnn.common.frc), in which the standard ReaxFF parameter blocks appear as named sections (#reaxff_general_parameters, #reaxff_atomic_parameters_1-8 … #reaxff_hydrogen-bond_parameters) with every parameter identified by name rather than by column position. Published fields translated to this format ship with xnn (ReaxFF("CHO_cho_2008"); see list_forcefields());

  • the JSON parameter-library format used by ReaxFF-nn parameter sets (Guo et al., Comput. Mater. Sci. 172, 109393, 2020; Xue et al., PCCP 23, 19457, 2021), which stores the same parameters as a flat "<name>_<type>" dictionary plus the neural-network weight matrices and the function/layer selectors. This is also the format FFieldLibrary.save() writes, since network weights have no place in a .frc file.

Parameters are kept in the flat naming convention of ReaxFF libraries ("Desi_C-C", "val_C", "theta0_H-C-H", …) and in the file’s units (kcal/mol where applicable – the model converts to eV when it assembles its tensors). read_ffield() returns a FFieldLibrary; the completion helpers below apply the same conventions ReaxFF codes apply after reading a library (off-diagonal combination rules, hydrogen-bond defaults, torsion wildcard resolution).

Functions

complete_hbonds(p, spec, hbs)

Add placeholder parameters for unlisted X-H-Z hydrogen-bond triples.

complete_off_diagonal(p, spec, bonds)

Fill missing off-diagonal pair parameters in place.

cutoff_table(table, kind, spec)

Build a complete per-bond-type cutoff table for the given species.

dedup_torsion_types(torp)

Drop torsion types that are reversed spellings of an earlier entry.

default_pair_cutoff(a, b, kind)

Heuristic fallback cutoff for a species pair, in Angstrom.

from_forcefield(ff)

Build a classical FFieldLibrary from a resolved .frc force field.

read_ffield(path)

Read a ReaxFF parameter library.

resolve_torsion(p, torp, tor, key)

Look up a torsion parameter, resolving reversal and wildcards.

template_library(species, *[, nn, messages, ...])

Build a generic starting-point (seed) parameter library.

to_forcefield(lib[, name, version, ...])

Write a classical FFieldLibrary as an in-memory .frc file.

Classes

FFieldLibrary(p[, m, spec, bonds, offd, ...])

A parsed ReaxFF parameter library.