Metadata-Version: 2.4
Name: cuRDF
Version: 0.4.0
Summary: GPU-accelerated radial distribution functions with NVIDIA ALCHEMI Toolkit-Ops neighbor lists and PyTorch.
Author: Joseph Hart
License-Expression: MIT
Project-URL: Homepage, https://github.com/joehart2001/cuRDF
Project-URL: Repository, https://github.com/joehart2001/cuRDF
Project-URL: Issues, https://github.com/joehart2001/cuRDF/issues
Project-URL: Documentation, https://github.com/joehart2001/cuRDF#readme
Project-URL: DOI, https://doi.org/10.5281/zenodo.1085332119
Keywords: rdf,radial distribution function,cuda,gpu,pytorch,neighbor list,molecular dynamics,ase,mdanalysis
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Distributed Computing
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: torch>=2.8.0
Requires-Dist: nvalchemi-toolkit-ops>=0.2.0
Requires-Dist: MDAnalysis
Requires-Dist: ase
Requires-Dist: matplotlib
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Requires-Dist: myst-parser; extra == "docs"
Dynamic: license-file

# cuRDF

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1085332119.svg)](https://doi.org/10.5281/zenodo.1085332119) [![PyPI](https://img.shields.io/pypi/v/cuRDF.svg)](https://pypi.org/project/cuRDF/)


CUDA-accelerated radial distribution functions using [NVIDIA ALCHEMI Toolkit-Ops](https://github.com/NVIDIA/nvalchemi-toolkit-ops) O(N) neighbor lists and PyTorch. Compatible with ASE Atoms or MDAnalysis Universe objects.

## Benchmarking

![cuRDF benchmark](benchmarks/results/results.png)

cuRDF is benchmarked against RDF (MDAnalysis) and neighbour list implementations on CPU (AMD Ryzen 9 9950X, 32 threads) and GPU (NVIDIA RTX 5090) for systems of varying sizes at a density of 0.05 atoms/Å³ over 1000 frames.

## Install
Latest release:
```
pip install cuRDF
```
For development:
```
git clone https://github.com/joehart2001/curdf.git
cd curdf
pip install -e .
```

## Quickstart
ASE Atoms object:
```python
from ase.io import read
from curdf import rdf

# Load trajectory or frame e.g. XYZ, extxyz, traj, LAMMPS data/dump
atoms = read("md_run.extxyz")

# Compute RDF between species C and O from 1.0 to 8.0 Å
bins, gr = rdf(
  atoms,
  species_a="C",
  species_b="O", # species b can be the same as species a
  r_min=1.0,
  r_max=8.0,
  nbins=200, # resolution of rdf histogram binning
  method="cell_list", # neighbor list method: "cell_list" (larger systems) or "naive" (smaller systems, less overhead)
  output = "results/rdf.csv" # optional output
)

# Plot RDF
plot_rdf(bins, gr, path="results/rdf.png")
```



MDAnalysis Universe (topology and trajectory):
```python
import MDAnalysis as mda
from curdf import rdf

u = mda.Universe("topology.data", "traj.dcd", atom_style="id type x y z")
bins, gr = rdf(
  u,
  species_a="C",
  species_b="O",
  r_min=1.0,
  r_max=8.0,
)
```

## Citation
If you use cuRDF in your work, please cite:
```
@software{cuRDF,
  author    = {Hart, Joseph},
  title     = {cuRDF: GPU-accelerated radial distribution functions},
  month     = dec,
  year      = 2025,
  publisher = {Zenodo},
  version   = {0.1.0},
  doi       = {10.5281/zenodo.1085332119},
  url       = {https://doi.org/10.5281/zenodo.1085332119}
}
```
