Skip to main content

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: CUDA-accelerated radial distribution functions using NVIDIA ALCHEMI Toolkit-Ops O(N) neighbor lists and PyTorch.},
  month     = dec,
  year      = 2025,
  publisher = {Zenodo},
  version   = {0.5.0},
  doi       = {10.5281/zenodo.1085332119},
  url       = {https://doi.org/10.5281/zenodo.1085332119}
}

Metadata

Release files for cuRDF 0.5.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cuRDF 0.5.4
File Size Uploaded
curdf-0.5.4.tar.gz 14.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cuRDF 0.5.4
File Interpreter ABI Platform
curdf-0.5.4-py3-none-any.whl Python 3 none any Details

Total release size: 28.2 kB

Release files / curdf-0.5.4.tar.gz

Download URL curdf-0.5.4.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
24fcb0eb83de8398f8f8a5b605a860dab0fda4fd2837c6f32864dace89740505
BLAKE2b-256 checksum
How to use checksums
7c2b9df8a8ccda7ee18cf5b347018afb21c111ab2522e3cf8439fe4e7fb5919b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / curdf-0.5.4-py3-none-any.whl

Download URL curdf-0.5.4-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9cd40cd270940966aa4ea37d88828338f4ab5bb68913892b7c3a3bbd9973f300
BLAKE2b-256 checksum
How to use checksums
0fdc350600fb6e1e245ba0855a55facb05912cd49b51a477fed0f71f628828fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.5.4 This release

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page