xnn.hybnn.models.byteff#

ByteFF and ByteFF-Pol: classical force fields parameterized by a graph transformer.

ByteFF (Zheng et al., Chem. Sci. 16, 2730 (2025), https://doi.org/10.1039/D4SC06640E) predicts every parameter of an AMBER-form force field for a molecule from its two-dimensional graph: a local edge-augmented graph transformer (MolecularGraphTransformer) reads the atoms and bonds, and output heads map its states to

  • harmonic bond and angle parameters, a four-term Fourier series per proper torsion (phases 0 for odd and pi for even multiplicities, zero barriers about linear centers) and a twofold improper per trigonal carbon or nitrogen;

  • per-atom Lennard-Jones sigma and epsilon (Lorentz-Berthelot combination) and partial charges built as bond charge increments on the formal charges, so the total charge is exact.

ByteFF-Pol (Zheng et al., Nat. Commun. 17, 8276 (2026), https://doi.org/10.1038/s41467-026-73566-3) keeps the bonded terms and replaces the nonbonded part by five physically separated terms fitted to an energy decomposition: Born-Mayer repulsion with a short-range wall, damped C6 dispersion, point-charge electrostatics, Thole-damped induced dipoles and a charge-transfer term. Atomic C6, polarizability and van der Waals radius follow from a predicted effective atomic volume by Tkatchenko-Scheffler scaling of free-atom values.

The network sees no coordinates. The parameters of a bound system are predicted once per distinct molecule (and cached between evaluations while the weights do not change); the energy of a conformation is then a classical force field evaluation. Several independently trained networks (an ensemble) average their parameters.

Conventions and scope#

  • A model is bound to one system (ByteFF.bind()): an RDKit molecule of one or more fragments, a list of molecules, a SMILES string or an ase.Atoms (bonds perceived). Every structure evaluated must be a conformation of that system.

  • Parameters are in kcal/mol, Angstrom, radians and e; energies are returned in eV.

  • Without cutoff every pair of a structure interacts (molecules and clusters, no cell). ByteFF also runs with a neighbor-list cutoff and periodic cells (truncated or switched, without Ewald sums). ByteFF-Pol solves its dipoles directly per structure without a cutoff; with one it evaluates periodic cells: the short-range terms truncated at the cutoff with a long-range correction of their tails, the charges and induced dipoles as Ewald sums with the reciprocal part on a particle mesh, and the dipoles solved iteratively.

Module Attributes

COULOMB

Coulomb constant of the released models, kcal Angstrom / (mol e^2).

TWO_WELL_BONDS

bond lengths (Angstrom) and angles (radians).

Functions

free_atom_table(column)

One free-atom quantity per element (row Z - 1) in Angstrom and kcal/mol: 0 volume, 1 polarizability, 2 C6, 3 radius.

Classes

BondedHead(node_dim, edge_dim[, pre, out, ...])

Bond, angle, torsion and improper parameters from atom and edge states.

ByteFF([structure, graph, bonded, ...])

ByteFF: an AMBER-form force field whose parameters a graph transformer predicts.

ByteFFPol([structure, graph, bonded, ...])

ByteFF-Pol: a polarizable force field whose parameters a graph transformer predicts.

LennardJonesChargeHead(node_dim, edge_dim[, ...])

Per-atom Lennard-Jones sigma, epsilon and partial charges (ByteFF).

PolarizableHead(node_dim, edge_dim[, pre, ...])

Charges and the exp-6, polarization and charge-transfer parameters (ByteFF-Pol).