xnn.ffnn.models.gfnff_export.GFNFFCellExport#

class xnn.ffnn.models.gfnff_export.GFNFFCellExport(model)[source]#

Bases: _Terms

node_features_energy_charges of a bound periodic GFN-FF model: the energy of one structure of the bound cell as equal per-atom shares (eV), its EEQ charges, and no features.

The terms are those of the model’s periodic path: the bonded terms over the images of the topology, the coordination numbers, the dispersion over the translation list of each cell, the hydrogen and halogen bonds of the rows the model holds and the electrostatics by its Ewald sum. The positions are unwrapped against the positions the rows were chosen at, so an atom wrapped back into the cell keeps its bonds.

Parameters:

model (GFNFF) – A model built with a cell.

Raises:

ValueError – If the model has no cell.

terms(pos, cell)[source]#

The energies (Hartree) in the order of TERMS and the EEQ charges of the structure at pos (Angstrom, (N, 3), unwrapped) in the cell cell (Angstrom, rows).

Parameters:
Return type:

Tuple[List[Tensor], Tensor]

unwrap(pos, cell)[source]#

pos (Angstrom) moved by lattice vectors of cell to the images nearest the positions the rows were chosen at.

Raises:

RuntimeError – If an atom is then farther than half the model’s skin from that position.

Parameters:
Return type:

Tensor

node_features_energy_charges(atomic_numbers, edge_index, edge_vec, pos, cell, pbc, total_charge, spin_multiplicity)[source]#

The features (N, 0), the energy as equal per-atom shares (N,) in eV and the EEQ charges (N,) of the bound cell at pos in cell; the neighbor list is not used, and the charge is the bound one.

Raises:

RuntimeError – If the atoms are not those of the bound system in its order, the structure is not periodic in three directions, or an atom moved beyond the rows (see unwrap()).

Parameters:
Return type:

Tuple[Tensor, Tensor, Tensor]