Skip to main content

Nequix source code

Project description

Nequix

See more information in our preprint.

Usage

Installation

pip install nequix

or for torch

pip install nequix[torch]

ASE calculator

Using nequix.calculator.NequixCalculator, you can perform calculations in ASE with a pre-trained Nequix model.

from nequix.calculator import NequixCalculator

atoms = ...
atoms.calc = NequixCalculator("nequix-mp-1", backend="jax")

or if you want to use the faster PyTorch + kernels backend

...
atoms.calc = NequixCalculator("nequix-mp-1", backend="torch")
...

NequixCalculator

Arguments

  • model_name (str, default "nequix-mp-1"): Pretrained model alias to load or download.
  • model_path (str | Path, optional): Path to local checkpoint; overrides model_name.
  • backend ({"jax", "torch"}, default "jax"): Compute backend.
  • capacity_multiplier (float, default 1.1): JAX-only; padding factor to limit recompiles.
  • use_compile (bool, default True): Torch-only; on GPU, uses torch.compile().
  • use_kernel (bool, default True): Torch-only; on GPU, use OpenEquivariance kernels.

Training

Models are trained with the nequix_train command using a single .yml configuration file:

nequix_train <config>.yml

or for Torch

# Single GPU
uv run nequix/torch/train.py <config>.yml
# Multi-GPU
uv run torchrun --nproc_per_node=<gpus> nequix/torch/train.py <config>.yml

To reproduce the training of Nequix-MP-1, first clone the repo and sync the environment:

git clone https://github.com/atomicarchitects/nequix.git
cd nequix
uv sync

Then download the MPtrj data from https://figshare.com/files/43302033 into data/ then run the following to extract the data:

bash data/download_mptrj.sh

Then start the training run. The first time this is run it will preprocess the data into HDF5 files:

nequix_train configs/nequix-mp-1.yml

This will take less than 125 hours on a single 4 x A100 node (<25 hours using the torch + kernels backend). The batch_size in the config is per-device, so you should be able to run this on any number of GPUs (although hyperparameters like learning rate are often sensitive to global batch size, so keep in mind).

Citation

@article{koker2025training,
  title={Training a foundation model for materials on a budget},
  author={Koker, Teddy and Kotak, Mit and Smidt, Tess},
  journal={arXiv preprint arXiv:2508.16067},
  year={2025}
}

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

nequix-0.3.1.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

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

nequix-0.3.1-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file nequix-0.3.1.tar.gz.

File metadata

  • Download URL: nequix-0.3.1.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for nequix-0.3.1.tar.gz
Algorithm Hash digest
SHA256 74f1d02d9cfbd81004e92547488827b66496f556701bc7e46e3330100f7b10a7
MD5 26e0574b77f9f38883a4ce51837b7233
BLAKE2b-256 12adc0102ec4e0ef1461badd50956b271eea1ddadef5591be1db62559e83c440

See more details on using hashes here.

File details

Details for the file nequix-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: nequix-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for nequix-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c467d463ac9a9c27c66c6c83400c9c59df6ca88f5d75de1fda1753bc519938e7
MD5 51fa7dfa4009e96a2bcb59dc123a1f68
BLAKE2b-256 fcb03bafa8cac91e6038c965164b456d74f36587f021cc0bb819b4c7d2160900

See more details on using hashes here.

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