Skip to main content

GPU-accelerated radial distribution functions with NVIDIA ALCHEMI Toolkit-Ops neighbor lists and PyTorch.

Project description

cuRDF logo


DOI PyPI

CUDA-accelerated radial distribution functions using NVIDIA ALCHEMI Toolkit-Ops O(N) neighbor lists and PyTorch. Compatible with ASE Atoms or MDAnalysis Universe objects.

GPU required: An NVIDIA GPU with CUDA is needed. For CUDA version selection, PyTorch wheel setup (CUDA 12 vs 13) and more information, see the Toolkit-Ops installation guide.

Benchmarking

cuRDF benchmark

cuRDF is benchmarked against other 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. Benchmarks use random positions in cubic cells sized to maintain a fixed number density (orthorhombic boxes, periodic in all directions).

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:

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):

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,
)

If the topology lacks atom names (only numeric types), supply a mapping:

bins, gr = rdf(
  u, 
  species_a="C", 
  species_b="O", 
  atom_types_map={1: "C", 2: "H"}
)

Validation

RDFs for liquid water (64 atoms, 1 ns) computed using a trajectory from Lim et al. (2026) match reference curves for all pairs:

O–O RDF H–H RDF O–H RDF

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.5.0},
  doi       = {10.5281/zenodo.1085332119},
  url       = {https://doi.org/10.5281/zenodo.1085332119}
}

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

curdf-0.5.3.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

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

curdf-0.5.3-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file curdf-0.5.3.tar.gz.

File metadata

  • Download URL: curdf-0.5.3.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for curdf-0.5.3.tar.gz
Algorithm Hash digest
SHA256 0b2312cbf9c0b3d6d664c36519a787fd1459496ed7ae5af8638b6ec1158ead77
MD5 14319509d3973be0612915381868ae27
BLAKE2b-256 9eaa77cc717b7fced7a6283f6495063cb8d03ba3a9b2a59a0f6cfbb282673b30

See more details on using hashes here.

File details

Details for the file curdf-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: curdf-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for curdf-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c91c33437163ffc9078bf8cac12c0104e8139c0a160e34c2693ac1ab3d2d4d24
MD5 c754b7e22bd423a30d3998d2c17d3292
BLAKE2b-256 16a804d66700edd918554f7260eb71d4d03373c55b419892fcb36e708c7c9a74

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