Skip to main content

FeNNol: Force-field-enhanced Neural Network optimized library

Project description

PyPI - Version DOI:10.1063/5.0217688

FeNNol: Force-field-enhanced Neural Networks optimized library

FeNNol is a library for building, training and running neural network potentials for molecular simulations. It is based on the JAX library and is designed to be fast and flexible.

FeNNol's documentation is available here and the article describing the library at https://doi.org/10.1063/5.0217688

Active Learning tutorial in this Colab notebook

Table of Contents

Pre-trained models

Pre-trained models can be downloaded from the Pre-trained Models Collection. Available models include:

After downloading the model (for example fennix-bio1S.fnx), you can load it and start predicting energies and forces with:

import fennol
import numpy as np

model = fennol.load("fennix-bio1S.fnx")
species = np.array([8, 1, 1])
coordinates = np.array([[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0]])

energy, forces, output_dict = model.energy_and_forces(species=species, coordinates=coordinates, unit="ev")
print("Energy:", energy,"ev")
print("Forces:", forces,"ev/Å")

Alternatively, you can use the provided ASE calculator and run a short molecular dynamics simulation:

from fennol.ase import FENNIXCalculator
from ase import Atoms
from ase.md.verlet import VelocityVerlet    
import ase.units as units

atoms = Atoms(symbols=["O", "H", "H"], positions=[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0]])
calculator = FENNIXCalculator(model="fennix-bio1S.fnx", gpu_preprocessing=True)
atoms.calc = calculator
energy = atoms.get_potential_energy()
forces = atoms.get_forces()
print("Energy:", energy,"ev")
print("Forces:", forces,"ev/Å")

dyn = VelocityVerlet(atoms, timestep=1.0*units.fs) 
print("Starting MD simulation. ")
for step in range(10):
    dyn.run(10)
    print(f"Step {10*(step+1)}, Potential energy: {atoms.get_potential_energy()} ev")

For better performance, we recommend using fennol_md, FeNNol's native MD engine. (see the examples/md directory for instructions and example input files)

Installation

From PyPI

# CPU version
pip install fennol

# GPU version
pip install "fennol[cuda]"

Latest version from Github repo

You can start with a fresh environment, for example using venv:

python -m venv fennol
source fennol/bin/activate

The first step is to install jax (see details at: https://jax.readthedocs.io/en/latest/installation.html). For example, to install the latest version using pip:

# CPU version
pip install -U jax

# GPU version
pip install -U "jax[cuda12]"

Then, you can clone the repo and install FeNNol using pip:

git clone https://github.com/FeNNol-tools/FeNNol.git
cd FeNNol
pip install .

Optional dependencies

pip install --upgrade e3nn-jax
  • The provided training script requires pytorch (at least the cpu version) for dataloaders:
pip install torch --index-url https://download.pytorch.org/whl/cpu
  • For the Deep-HP interface, cffi and pycuda are required:
pip install cffi pycuda

Examples

To learn how to train a FeNNol model, you can check the examples in the examples/training directory. The README.md file in that directory contains instructions on how to train a model on the aspirin revMD17 dataset.

To learn how to run molecular dynamics simulations with FeNNol models, you can check the examples in the examples/md directory. The README.md file in that directory contains instructions on how to run simulations with the provided ANI-2x model.

Citation

Please cite this paper if you use the library.

T. Plé, O. Adjoua, L. Lagardère and J-P. Piquemal. FeNNol: an Efficient and Flexible Library for Building Force-field-enhanced Neural Network Potentials. J. Chem. Phys. 161, 042502 (2024)
@article{ple2024fennol,
    author = {Plé, Thomas and Adjoua, Olivier and Lagardère, Louis and Piquemal, Jean-Philip},
    title = {FeNNol: An efficient and flexible library for building force-field-enhanced neural network potentials},
    journal = {The Journal of Chemical Physics},
    volume = {161},
    number = {4},
    pages = {042502},
    year = {2024},
    month = {07},
    doi = {10.1063/5.0217688},
    url = {https://doi.org/10.1063/5.0217688},
}

License

This project is licensed under the terms of the GNU LGPLv3 license. See LICENSE for additional details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fennol-2026.5.7.tar.gz (10.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fennol-2026.5.7-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file fennol-2026.5.7.tar.gz.

File metadata

  • Download URL: fennol-2026.5.7.tar.gz
  • Upload date:
  • Size: 10.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fennol-2026.5.7.tar.gz
Algorithm Hash digest
SHA256 79d8b4101cec704417964bb05890aa529ab443935187654a739b8693df6100ea
MD5 33807f715612f43d3664ca4f0da73809
BLAKE2b-256 65c8c04ebc266cd7842b600febc7832af522e8d02fea434feecd7b1e81b19b70

See more details on using hashes here.

Provenance

The following attestation bundles were made for fennol-2026.5.7.tar.gz:

Publisher: publish-to-pypi.yml on FeNNol-tools/FeNNol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fennol-2026.5.7-py3-none-any.whl.

File metadata

  • Download URL: fennol-2026.5.7-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fennol-2026.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 84043f31aa49f748ab824d2995d6b2a4f99e9458950b48a905f3d0551a78907d
MD5 14bdcb1b0edbd470772048cddd410923
BLAKE2b-256 66a597e57cdeb6c60100ff7703df33fa2cf044582dfc4cbfaae07fcff09e6871

See more details on using hashes here.

Provenance

The following attestation bundles were made for fennol-2026.5.7-py3-none-any.whl:

Publisher: publish-to-pypi.yml on FeNNol-tools/FeNNol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page