Examples#
Every notebook of the repository’s notebooks/ directory, rendered
with its executed outputs. Its examples/, fidelity_checks/ and
parity_checks/ folders each follow the package layout
(<family>/<model>/). To run one yourself, see Run the Example Notebooks
for the environments. Entries marked coming soon are being reviewed and
become links as they are published.
Data#
The data hub: load_dataset(), splits, units, caching.
GMTKN55 in one line: reaction energies, WTMAD-2 and pretrained models on the benchmarkcoming soon
Models#
The model hub: foundation models, xnn-trained models and Zenodo uploads
under one from_pretrained() call, the cache layout and sharing your own.
ANI (dnn)#
ANI from scratch on rMD17, then the four published ANI datasets, each paired with its model preset.
Training ANI from scratch on rMD17 (paracetamol)coming soon
The ANI-1 dataset in one line, and a paper-style correlation testcoming soon
The ANI-1x dataset in one line: forces, active learning, and the
ani-1xpresetcoming soonThe ANI-1ccx dataset: coupled-cluster labels and transfer learning with the
ani-1ccxpresetcoming soonThe ANI-2x dataset: seven elements (S, F, Cl) and the
ani-2xpresetcoming soon
HDNNP (dnn)#
The four generations of high-dimensional neural network potentials: their defining properties on untrained models, first and second generation on rMD17, and the 2G / 3G / 4G comparison of the fourth-generation paper (Ko et al., Nat. Commun. 12, 398 (2021)).
The four generations of HDNNPs: symmetry functions, locality, non-local charge transfercoming soon
First- and second-generation potentials on rMD17 ethanolcoming soon
2G, 3G and 4G HDNNPs on the benchmarks of the fourth-generation papercoming soon
PhysNet (dnn)#
Training and MD against the original TensorFlow PhysNet.
Training & testing PhysNet on Argon MD data:
xnnvs the original PhysNet, step by stepcoming soonArgon MD with PhysNet:
xnnNPT density + lock-step NVE against the originalcoming soon
QRNN (dnn)#
Charges that follow the net charge of a molecule, trained with learned loss weights.
QRNN on charged and neutral carbon chains: charge transfer beyond the cutoffcoming soon
SchNet (gnn)#
The architecture of Schütt et al., Adv. Neural Inf. Process. Syst. 30 (2017) trained on rMD17 ethanol, then thermostat-free NVE dynamics to show energy conservation by construction.
DimeNet and DimeNet++ (gnn)#
The directional message passing papers (Gasteiger et al., Int. Conf. Learn. Represent. (2020) and Gasteiger et al., NeurIPS Workshop on Machine Learning for Molecules (2020)) checked with untrained models: the Bessel and spherical Fourier-Bessel bases, the envelope, twice continuous differentiability across the cutoff, the distinguishability argument and the DimeNet++ speed-up. Then the MD17 experiment of the paper on rMD17 ethanol: DimeNet, DimeNet++ and SchNet trained on 1000 structures, with the learned 2D filters.
DimeNet from the paper: bases, smoothness, directionality, and the DimeNet++ speed-upcoming soon
DimeNet and DimeNet++ on rMD17 ethanol: energies and forces from 1000 structurescoming soon
GemNet (gnn)#
The geometric message passing paper (Gasteiger et al., Adv. Neural Inf. Process. Syst. 34, 6790 (2021)) checked with untrained models: the three bases, triplets and quadruplets, what the dihedral angle adds, the variance scaling of Fig. 3, smoothness at both cutoffs, direct versus conservative forces and the cost of the variants. Then GemNet-T, -Q and -dT trained on rMD17 ethanol, with NVE energy conservation.
GemNet from the paper: bases, two-hop message passing, variance scaling, direct forcescoming soon
GemNet on rMD17 ethanol: GemNet-T, GemNet-Q and direct forcescoming soon
PaiNN (gnn)#
The equivariant message passing paper (Schütt et al., Proc. Mach. Learn. Res. 139, 9377 (2021)): the architecture and its claims checked with untrained models, the MD17 experiments and ablations of Tables III and IV, the rotational profile of substituted ferrocene at short cutoffs (Fig. 4), and the infrared and Raman spectra of ethanol from classical and ring-polymer dynamics (Fig. 5).
PaiNN from the paper: equivariant messages, directional information and tensorial outputscoming soon
PaiNN on MD17: energies and forces from 1000 structures, and the ablationscoming soon
Propagation of directional information: the substituted ferrocene rotationcoming soon
Infrared and Raman spectra of ethanol from classical and ring-polymer dynamicscoming soon
TensorNet (gnn)#
The Cartesian tensor network of TorchMD-Net 2.0 (Simeon and De Fabritiis, Adv. Neural Inf. Process. Syst. 36, 37334 (2023); Pelaez et al., J. Chem. Theory Comput. 20, 4076 (2024)): the irreducible decomposition, O(3) against SO(3) on enantiomers, the total-charge coupling, smoothness and the cost of 0 to 3 layers. Then TensorNet on rMD17 aspirin, and TensorNet against ET on a QM9 subset at a short budget.
TensorNet from the paper: Cartesian tensors, O(3) and SO(3), charge coupling and layer depthcoming soon
TensorNet on rMD17 aspirin: energies and forces from 950 structurescoming soon
TensorNet and ET on QM9 U0: the layer-depth trend of TorchMD-Net 2.0 at a short budgetcoming soon
MEGNet on Materials Project formation energiescoming soon
Multi-fidelity MEGNet: band gaps from cheap and accurate datacoming soon
CGCNN (gnn)#
CGCNN on the Materials Project crystals of the MEGNet paper: training on formation energies at a short budget, next to the authors’ pretrained model, then their pretrained bulk-modulus model and metal/semiconductor classifier.
CGCNN on Materials Project formation energies, with the authors’ pretrained modelscoming soon
QET (gnn)#
The charge-equilibrated TensorNet of Ko et al., arXiv:2511.07249 (2025), with MatGL’s MatPES potential: the charges of a crystal, a charged vacancy and an applied potential.
QET: charges, charge states and an applied potentialcoming soon
3D steerable CNN (cnn)#
The Tetris experiment of the 3D steerable CNN paper (Weiler et al., Adv. Neural Inf. Process. Syst. 31 (2018)): steerable and conventional kernels trained on the eight pieces in one orientation and tested under random rotations, with the paper’s low-pass ablation, the kernel-basis figure and the equivariance of the internal fields. Then the same comparison for interatomic potentials: the steerable and the conventional 3D CNN trained on rMD17 ethanol and evaluated on rotated structures.
The Tetris experiment: rotation equivariance of 3D steerable CNNscoming soon
Steerable against conventional 3D CNN potentials on rMD17 under rotationscoming soon
Spherical CNN (cnn)#
The QM7 experiment of the spherical CNN paper (Cohen et al., Int. Conf. Learn. Represent. (2018)): atomization energies from the potentials of the atoms sampled on spheres, with the Table 3 network and the DeepSet readout, and the rotation invariance of the energy.
Spherical CNN on QM7: atomization energies from spherical signalscoming soon
NequIP, MACE, Allegro, CACE, AIMNet2 (gnn)#
The argon train, evaluate and MD series, one pair of notebooks per model against its reference code; a block-by-block walkthrough of the MACE architecture; the MACE-OFF23 and MACE-MP foundation models on organic chemistry and materials; the fine-tuning strategies (naive, readout-only, LoRA, multi-head replay) side by side; and the published AIMNet2 models on neutral, charged and open-shell molecules.
Training & testing NequIP on Argon MD data:
xnnvs the original NequIP, step by stepcoming soonArgon density from MD:
xnnvs the original NequIPcoming soonTraining & testing MACE on Argon MD data:
xnnvs the original MACE, step by stepcoming soonArgon density from MD:
xnnvs the original MACEcoming soonRecreating the MACE architecture, block by block: original MACE and
xnncoming soonMACE-OFF23 in xnn: organic chemistry with a pretrained foundation modelcoming soon
Fine-tuning strategies for a foundation model: naive, LoRA and multi-head replaycoming soon
MACE-MP foundation models in xnn: materials properties across generationscoming soon
Training & testing Allegro on Argon MD data:
xnnvs the original Allegro, step by stepcoming soonArgon density from MD:
xnnvs the original Allegrocoming soonTraining & testing CACE on Argon MD data:
xnnvs the original CACE, step by stepcoming soonArgon density from MD:
xnnvs the original CACEcoming soonAIMNet2 in xnn: neutral, charged and open-shell molecules with a pretrained foundation modelcoming soon
Long-range: Latent Ewald Summation (common)#
Why long-range matters: molecular-dimer binding curves (
xnnLES vs a short-range model)coming soon
Dispersion: D4 (common)#
Reproductions of the examples of the D4 paper
(Caldeweyher et al., J. Chem. Phys. 150, 154122 (2019)), a benchmark against the reference
dftd4 with deployment through every channel, and the large-system regime
pushed to the memory limit of one GPU.
D4 in xnn: reproducing examples of the D4 papercoming soon
D4 in xnn vs the reference
dftd4: accuracy, speed, and deployment with an MLIPcoming soonLarge-scale D4: liquid ethanol from rMD17 conformers, up to the memory limitcoming soon
Dispersion: D3 (common)#
Reproductions of the two Grimme papers (Grimme et al., J. Chem. Phys. 132,
154104 (2010);
Grimme et al., J. Comput. Chem. 32, 1456 (2011)) and a benchmark against simple-dftd3
for every damping function.
D3 in xnn: reproducing examples of the two Grimme paperscoming soon
D3 in xnn vs the reference
simple-dftd3: accuracy, speed, and deployment with an MLIPcoming soon
ET (trfnn)#
The equivariant transformer paper (Thölke and De Fabritiis, Int. Conf. Learn. Represent. (2022)): the sizes of Tables 4 and 6, the attention weights of section 3.1, equivariance, and the cutoff discontinuity that TorchMD-Net 2.0 (Pelaez et al., J. Chem. Theory Comput. 20, 4076 (2024)) removed. Then the MD17 protocol of Table 2 on rMD17 aspirin, with and without the fix.
ET from the paper: sizes, attention, equivariance and the cutoff fix of TorchMD-Net 2.0coming soon
ET on rMD17 aspirin: the MD17 protocol of the paper at a short budgetcoming soon
Equiformer (trfnn)#
The equivariant graph attention paper (Liao and Smidt, Int. Conf. Learn. Represent. (2023)): the sizes of Table 6 and section E.1, the irreps and tensor-product paths, SE(3) against E(3) under reflections, the cost of the attention variants and the cutoff. Then the MD17 protocol on rMD17 aspirin, with and without the smooth cutoff.
Equiformer from the paper: sizes, equivariance, attention variants and the cutoffcoming soon
Equiformer on rMD17 aspirin: the MD17 protocol of the paper at a short budgetcoming soon
EquiformerV2 (trfnn)#
The EquiformerV2 paper (Liao et al., Int. Conf. Learn. Represent. (2024)): the sizes of Tables 8 and 13, the eSCN edge frames, the sphere sampling, forces through the frames and liquid argon. Then Equiformer and EquiformerV2 on a QM9 subset, and EquiformerV2 on OC20 S2EF with conservative and direct forces.
EquiformerV2 from the paper: sizes, eSCN frames, sphere sampling, exact forces and a liquidcoming soon
Equiformer and EquiformerV2 on QM9 U0 at a short budgetcoming soon
EquiformerV2 on OC20 S2EF: adsorbates on catalyst slabscoming soon
BAMBOO (hybnn)#
BAMBOO charges, energy decomposition, and deploymentcoming soon
BAMBOO on charged / polar molecular dimers: why the charge-equilibrium term matterscoming soon
SpookyNet (hybnn)#
The SpookyNet paper (Unke et al., Nat. Commun. 12, 7273 (2021)): the building blocks checked with untrained models and the published example model, the electronic-state surfaces of Ag3+ / Ag3- and singlet / triplet CH2 (Fig. 4), the dissociation of diatomics with and without nonlocal interactions (Fig. 5), the 4G-HDNNP charge-transfer benchmarks (Table 1) and MD17 (Table 3).
SpookyNet from the paper: electronic states, orbital-like interactions and nonlocalitycoming soon
Electronic states: Ag3+ / Ag3- and singlet / triplet CH2coming soon
Nonlocal effects: dissociation of diatomic moleculescoming soon
Nonlocal charge transfer: the 4G-HDNNP benchmarkscoming soon
SpookyNet on MD17coming soon
ByteFF and ByteFF-Pol (hybnn)#
The released ByteFF-26 and ByteFF-Pol-25 networks: predicted parameters and their ensemble spread, geometry, a torsion scan and dynamics of a drug-like molecule, electrolyte dimers and a lithium cluster resolved into repulsion, dispersion, electrostatics, polarization and charge transfer, and a periodic electrolyte box with particle-mesh Ewald electrostatics and induction.
ByteFF on a drug-like molecule: parameters, geometry, torsions and dynamicscoming soon
ByteFF-Pol on electrolyte clusters: energy decomposition and many-body polarizationcoming soon
ReaxFF / ReaxFF-nn (ffnn)#
A reactive force field fit by gradient descent to rMD17 malonaldehyde, then MD with the trained library: bond orders, EEM charges and a dissociation scan.
Training ReaxFF-nn on rMD17 (malonaldehyde)coming soon
ReaxFF in action: bond orders, charges, MD and dissociationcoming soon
OPLS / L-OPLS (ffnn)#
Table 1 of the OPLS-AA paper (Jorgensen et al., J. Am. Chem. Soc. 118, 11225 (1996)) from relaxed dihedral scans, then the L-OPLS hexane torsion (Siu et al., J. Chem. Theory Comput. 8, 1459 (2012)) re-derived by gradient descent to the published coefficients.
OPLS-AA conformational energetics: reproducing Table 1 of Jorgensen et al. (1996)coming soon
L-OPLS, and refitting OPLS torsions by gradient descentcoming soon
DREIDING (ffnn)#
Tables XI and XII of the DREIDING paper (Mayo et al., J. Phys. Chem. 94, 8897 (1990)) from relaxed scans, then the generators refit on benzene and tested for transfer to naphthalene and toluene.
DREIDING conformational energetics: reproducing Tables XI and XII of the 1990 papercoming soon
Retraining DREIDING: refitting the generators, and testing whether they transfercoming soon
AMBER (ffnn)#
Tables 3, 4 and 11 and the dipeptide maps of Figure 2 of the ff94 paper (Cornell et al., J. Am. Chem. Soc. 117, 5179 (1995)) from relaxed scans, the normal modes of Tables 6 and 7 from the autograd Hessian, then the backbone torsions refit by gradient descent.
AMBER ff94 conformational energetics: reproducing Tables 3, 4 and 11 and Figure 2 of Cornell et al. (1995)coming soon
AMBER ff94 normal modes: reproducing Tables 6 and 7 of Cornell et al. (1995)coming soon
Refitting the AMBER backbone torsions by gradient descentcoming soon
CHARMM22 (ffnn)#
The backbone geometries, conformational energies, dipeptide map and NMA interaction energies of the CHARMM22 paper (MacKerell et al., J. Phys. Chem. B 102, 3586 (1998)), the normal modes of NMA and the alanine dipeptide from the autograd Hessian, then the backbone torsions refit by gradient descent.
CHARMM22 backbone energetics: reproducing Tables 1, 2, 7, 9, 10 and 11 and Figure 2 of MacKerell et al. (1998)coming soon
CHARMM22 normal modes: reproducing Tables 3 and 8 of MacKerell et al. (1998)coming soon
Refitting the CHARMM22 backbone torsions by gradient descentcoming soon
AMOEBA and HIPPO (ffnn)#
The water dimer and cluster energetics of the AMOEBA and HIPPO water papers (Ren and Ponder, J. Phys. Chem. B 107, 5933 (2003); Rackers et al., J. Chem. Theory Comput. 17, 7056 (2021); the ten Smith dimers with their energy decomposition, the cyclic clusters), the monomer moments, an AMOEBA water model refit to HIPPO reference data by gradient descent, the AMOEBA protein force field (Shi et al., J. Chem. Theory Comput. 9, 4046 (2013)) on capped peptides with the alanine dipeptide map, and a periodic water box with particle-mesh Ewald sums and a short microcanonical run.
AMOEBA water: reproducing the dimer and cluster results of Ren and Ponder (2003)coming soon
HIPPO water: the Smith dimers and their SAPT decomposition from Rackers et al. (2021)coming soon
Refitting the AMOEBA water model to HIPPO reference datacoming soon
AMOEBA protein force field: typing peptides and the alanine dipeptide map of Shi et al. (2013)coming soon
AMOEBA and HIPPO water in a periodic box: Ewald sums, pressure and a short MDcoming soon
Semiempirical methods (sqmnn)#
The tables of the PM3, PM6, PM7 and PM6-ORG papers (Stewart, J. Comput. Chem. 10, 209 (1989); Stewart, J. Mol. Model. 13, 1173 (2007); Stewart, J. Mol. Model. 19, 1 (2013); Stewart and Stewart, J. Mol. Model. 29, 284 (2023)) reproduced with the published parameters: heats of formation, dipoles and ionization potentials, the modified core-core terms, and the S22 / S66 interaction energies; then the parameters refit by gradient descent and written back for MOPAC. The tight-binding methods GFN1-xTB and GFN2-xTB follow with their charges, a geometry optimization, the S22 interaction energies and a parameter refit.
PM3 heats of formation, dipole moments and ionization potentials (Stewart 1989)coming soon
PM6: the modified NDDO approximations of the 2007 papercoming soon
Noncovalent interactions: PM7 (S22, S66) and PM6-ORGcoming soon
Refitting NDDO parameters: hydrogen bonds, MOPAC export and force trainingcoming soon
GFN1-xTB and GFN2-xTB: charges, a geometry optimization, the S22 interaction energies and a parameter refitcoming soon
DFTB1, DFTB2 and DFTB3: energies, a geometry optimization, the S22 interaction energies, open shells, LC-DFTB and a parameter refitcoming soon
GDML and sGDML (krnn)#
The kernel force fields of Chmiela et al., Sci. Adv. 3, e1603015 (2017) and Chmiela et al., Nat. Commun. 9, 3887 (2018): a closed-form fit on rMD17 ethanol, the test errors, and NVE dynamics.
Fitting sGDML on rMD17 ethanol: a closed-form force field and its dynamicscoming soon
Deployment: MDI (common)#
A checkpoint served as an MDI engine, driven first from a minimal Python
driver and then from LAMMPS fix mdi/qm.
Deploying a trained model as an MDI engine: liquid argon over the MolSSI Driver Interfacecoming soon
Driving the xnn MDI engine from LAMMPS: liquid-argon NVE and \(g(r)\)coming soon
Fidelity checks#
Block-by-block verification of each implementation against its upstream reference (Model Fidelity to Upstream Codes), ending with a weight transplant.
SchNet, block by block: the paper’s equations, the reference implementation, speed and memorycoming soon
3D steerable CNN, block by block: the kernel basis, equivariance and the reference implementationcoming soon
Spherical CNN, block by block: harmonic analysis, correlations, equivariance and the reference implementationcoming soon
DimeNet and DimeNet++ against the authors’ TensorFlow implementation, including the published QM9 modelcoming soon
GemNet against the reference implementation, including the published weightscoming soon
PaiNN, block by block: the paper’s equations, the reference implementation, speed and memorycoming soon
QET against MatGL: the published MatPES potential, charged cells and an applied potentialcoming soon
CGCNN against the authors’ code: the crystal graph, one convolution, training mode and the eight published modelscoming soon
SpookyNet, block by block: the paper’s equations and the reference implementationcoming soon
ET and TensorNet, block by block: the papers’ equations and the TorchMD-Net reference implementationcoming soon
Equiformer, block by block: the authors’ implementation in float64 and float32, and the speed of a training stepcoming soon
EquiformerV2 against fairchem: every variant, Wigner matrices, sphere grids, SO(2) convolutions, speed and memorycoming soon
GMTKN55 against the paper and the maintainers’ repository: counts, averages, PBEh-3c and WTMAD-2coming soon
HDNNP (2G, 3G, 4G) against the RuNNer code, including a published 4G modelcoming soon
ANI-1, block by block: reproducing the original implementation with
xnncoming soonPhysNet, block by block: reproducing the original implementation with
xnncoming soonQRNN against the paper’s equations and Psi4’s wB97X-D dispersioncoming soon
NequIP, block by block: reproducing the original implementation with
xnncoming soonMACE, block by block: reproducing the original implementation with
xnncoming soonMACE foundation models: verifying
MACE.from_foundation()againstmace-torchcoming soonAIMNet2 foundation models: verifying
AIMNet2.from_foundation()against theaimnetpackagecoming soonAllegro, block by block: reproducing the original implementation with
xnncoming soonCACE, block by block: reproducing the original implementation with
xnncoming soonLatent Ewald Summation (LES), block by block: reproducing the original implementation with
xnncoming soonD4 dispersion, block by block: reproducing the reference
dftd4withxnncoming soonD3 dispersion, block by block: reproducing the reference
simple-dftd3withxnncoming soonByteFF and ByteFF-Pol fidelity check:
xnnvs byteff2 and its patched OpenMMcoming soonOPLS: verifying the
xnnimplementation against OpenMM and the 1996 papercoming soonDREIDING: verifying the
xnnimplementation against LAMMPS and the 1990 papercoming soonAMBER (ff94): verifying the
xnnimplementation against LAMMPS, AmberTools and the 1995 papercoming soonCHARMM22: verifying the
xnnimplementation against LAMMPS, NAMD/psfgen and the 1998 papercoming soonAMOEBA: verifying the
xnnimplementation against Tinker, LAMMPS and the paperscoming soonHIPPO: verifying the
xnnimplementation against Tinker, LAMMPS and the 2021 papercoming soonPM3, PM6, PM6-ORG and PM7 against the MOPAC programcoming soon
GFN0-xTB, GFN1-xTB and GFN2-xTB against the xtb programcoming soon
DFTB1, DFTB2 and DFTB3 against the DFTB+ programcoming soon
GDML and sGDML against the sGDML package: equations, transplanted models, refits and speedcoming soon
Parity checks#
The fast paths (Run Models on Fused GPU Kernels) against the reference implementations they replace: energies, forces, stress, charges, training gradients and timings.
MACE and NequIP on cuEquivariance: parity with the referencecoming soon
NequIP fast path: parity with the referencecoming soon
Allegro fast path: parity with the referencecoming soon
CACE fast path: parity with the referencecoming soon
AIMNet2 fast path: parity with the referencecoming soon
Dispersion fast paths: parity with the reference (D3, D4)coming soon
LES fast path: parity with the referencecoming soon
PM3, PM6, PM6-ORG and PM7 fast path: parity with the referencecoming soon
GFN0-xTB, GFN1-xTB and GFN2-xTB fast path: parity with the referencecoming soon
SchNet fast path: parity with the referencecoming soon
PaiNN fast path: parity with the referencecoming soon
DimeNet and DimeNet++ fast path: parity with the referencecoming soon
GemNet fast path: parity with the referencecoming soon
TensorNet fast path: parity with the referencecoming soon
QET fast path: parity with the referencecoming soon
MEGNet fast path: parity with the referencecoming soon
CGCNN fast path: parity with the referencecoming soon
ANI fast path: parity with the referencecoming soon
PhysNet fast path: parity with the referencecoming soon
HDNNP fast paths: parity with the reference (GPU and CPU)coming soon
QRNN fast path: parity with the referencecoming soon
SE(3) steerable CNN and 3D CNN fast path: parity with the referencecoming soon
Spherical CNN fast path: parity with the referencecoming soon
OPLS, AMBER, CHARMM and DREIDING fast paths: parity with the referencecoming soon
ReaxFF and ReaxFF-nn fast paths: parity with the referencecoming soon
AMOEBA fast paths: parity with the referencecoming soon
HIPPO fast paths: parity with the referencecoming soon
ET fast path: parity with the referencecoming soon
Equiformer fast path: parity with the referencecoming soon
EquiformerV2 fast path: parity with the referencecoming soon
BAMBOO fast path: parity with the referencecoming soon
SpookyNet fast paths: parity with the referencecoming soon
ByteFF and ByteFF-Pol fast paths and export: parity with the referencecoming soon
GDML and sGDML fast path: parity with the referencecoming soon