Metadata-Version: 2.4
Name: NewtonNet
Version: 2.0.1
Summary: A Newtonian message passing network for deep learning of interatomic potentials and forces
Author-email: Teresa Head-Gordon <thg@berkeley.edu>
License: MIT
Project-URL: repository, https://github.com/THGLab/NewtonNet
Keywords: Machine Learning,Data Mining,Quantum Chemistry,Molecular Dynamics
Classifier: Development Status :: 4 - Beta
Classifier: Natural Language :: English
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Description-Content-Type: text/markdown
Requires-Dist: numpy<2.0.0
Requires-Dist: scipy
Requires-Dist: scikit-learn
Requires-Dist: pandas
Requires-Dist: ase
Requires-Dist: tqdm
Requires-Dist: pyyaml
Requires-Dist: wandb
Requires-Dist: torch
Requires-Dist: torch_geometric
Requires-Dist: torch_scatter
Requires-Dist: torch_cluster

# NewtonNet
A [Newtonian message passing network](https://doi.org/10.1039/D2DD00008C) for deep learning of interatomic potentials and forces

![architecture](newtonnet/models/newtonnet.png) 

## Installation and Dependencies
We recommend using conda environment to install dependencies of this library.
Please install (or load) conda and then proceed with the following commands:

    conda create --name newtonnet python=3.12
    conda activate newtonnet

Now, you can install NewtonNet in the conda environment by cloning this repository:

    git clone https://github.com/THGLab/NewtonNet.git

    cd NewtonNet

    pip install torch
    pip install -e .

Once you finished installations succesfully, you will be able to run NewtonNet modules anywhere on your computer as long as the `newtonnet` environment is activated. If you have trouble installing `torch_geometric`, `torch_scatter`, or `torch_cluster`, please refer to the [PyG documentation page](https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html). Optionally, if you want to use [Weights & Biases](https://docs.wandb.ai) for logging, you can initialize it with

    wandb login


## Training and Inference
You can find several run files inside the `scripts` directory that rely on the implemented modules in the NewtonNet library. The run scripts need to be accompanied with a yaml configuration file. You can run an example training script with the following command:

    python newtonnet_train.py --config config.yml

or resume a checkpoint of an interupted training with the following command:

    python newtonnet_train.py --resume md17_model/training_1

Optionally for large datasets, you might want to process the data on a CPU node with larger memory using:

    python preprocess.py --root md17_data/aspirin/ccsd_train

All models are assumed in [ASE units](https://wiki.fysik.dtu.dk/ase/ase/units.html), such as eV and Ang. You can call an ASE calculator from `newtonnet.utils.ase_interface`. An example MD script can be found in `simulate.py`.

The documentation of the modules are available at most cases. Please look up local classes or functions and consult with the docstrings in the code.

