SkillAgentSearch skills...

CuRDF

CUDA-accelerated radial distribution functions using NVIDIA ALCHEMI Toolkit-Ops O(N) neighbor lists and PyTorch.

Install / Use

/learn @joehart2001/CuRDF
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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.

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) match reference curves for all pairs (cite Darren paper):

<table> <tr> <td><img src="tests/cuRDF_results/rdf_OO_comparison.svg" alt="O–O RDF" width="250"></td> <td><img src="tests/cuRDF_results/rdf_HH_comparison.svg" alt="H–H RDF" width="250"></td> <td><img src="tests/cuRDF_results/rdf_OH_comparison.svg" alt="O–H RDF" width="250"></td> </tr> </table>

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}
}
View on GitHub
GitHub Stars8
CategoryDevelopment
Updated1mo ago
Forks0

Languages

Python

Security Score

85/100

Audited on Feb 26, 2026

No findings