agentleFS
dtunaidtunai/agent-skills-for-compute/skills/alchemi-toolkit-ops/SKILL.md

alchemi-toolkit-ops

Skill8 starsChanged 8 months agoMITView on GitHub

Provides NVIDIA ALCHEMI Toolkit-Ops patterns for GPU-accelerated atomistic simulation kernels. Applies to tasks involving neighbor list construction, electrostatic interactions (Ewald, PME, Coulomb, multipole), DFT-D3 dispersion corrections, molecular dynamics, GNN-based molecular property prediction, or high-throughput computational chemistry on NVIDIA GPUs.

  • Installs packages

The file

Files
SKILL.md

ALCHEMI Toolkit-Ops

Overview

GPU-accelerated library of low-level, high-performance kernels for atomistic simulations, computational chemistry, and graph neural networks. Built on NVIDIA Warp, outputs native PyTorch tensors with full torch.compile compatibility. Covers neighbor list construction, long-range electrostatics (Ewald/PME/multipole), and DFT-D3 dispersion corrections — all with native batch processing for heterogeneous molecular systems.

Quick Pattern

Incorrect — CPU-based neighbor search without batching:

from scipy.spatial import KDTree
tree = KDTree(positions)
pairs = tree.query_pairs(cutoff)

Correct — GPU-accelerated neighbor list with auto-dispatch:

import torch
from nvalchemiops.neighborlist import neighbor_list

positions = torch.randn(10000, 3, device="cuda")
cell = torch.eye(3, device="cuda").unsqueeze(0) * 30.0
pbc = torch.tensor([[True, True, True]], device="cuda")

result = neighbor_list(
    positions, cutoff=5.0, cell=cell, pbc=pbc,
)
# result.neighbor_matrix: [N, max_neighbors], int32
# result.num_neighbors: [N], int32
# result.neighbor_matrix_shifts: [N, max_neighbors, 3], int32

Quick Command

# Install from PyPI
pip install nvalchemi-toolkit-ops

# Install from source
pip install git+https://github.com/NVIDIA/nvalchemi-toolkit-ops.git

# Verify installation
python -c "import nvalchemiops; print(nvalchemiops.__version__)"

# Docker
docker run --gpus all nvidia/cuda:13.0.0-runtime-ubuntu24.04
# Then: pip install nvalchemi-toolkit-ops

Quick Reference

Core Modules

ModuleImportPurpose
Neighbor Listnvalchemiops.neighborlistGPU-accelerated neighbor search
Ewald Summationnvalchemiops.interactions.electrostaticsLong-range electrostatics O(N^2)
PMEnvalchemiops.interactions.electrostaticsParticle Mesh Ewald O(N log N)
Coulombnvalchemiops.interactions.electrostatics.coulombDirect Coulomb interactions
Multipolenvalchemiops.interactions.electrostaticsDipole/quadrupole Ewald/PME
DFT-D3nvalchemiops.interactions.dispersion.dftd3Dispersion corrections (BJ damping)
Spherical Harmonicsnvalchemiops.math.spherical_harmonicsReal spherical harmonics
GTOnvalchemiops.math.gtoGaussian Type Orbital functions

Neighbor List Algorithms

MethodComplexityAuto-Selected When
"naive"O(N^2)Single system, <5000 atoms
"cell_list"O(N)Single system, >=5000 atoms
"batch_naive"O(N^2)/systemBatched small systems
"batch_cell_list"O(N)/systemBatched large systems
"naive_dual_cutoff"O(N^2)cutoff2 provided
"batch_naive_dual_cutoff"O(N^2)Batched + cutoff2

Electrostatics Methods

MethodComplexityBest For
Ewald SummationO(N^(3/2))Systems <5000 atoms
PMEO(N log N)Large periodic systems
Direct CoulombO(N * pairs)Non-periodic or real-space only
Multipole Ewald/PMEExtendedDipoles and quadrupoles

Output Formats

FormatTensorsBest For
Neighbor Matrix (dense)neighbor_matrix [N, max_nb], num_neighbors [N]torch.compile, uniform density
Neighbor List (COO sparse)neighbor_list [2, pairs], neighbor_ptrGNNs, variable density

Hardware Requirements

PlatformSupportNotes
NVIDIA GPU (CC 8.0+)Full GPUA100, H100 recommended
CUDA Toolkit 12+Required for GPUDriver 570.xx+
CPU (x86/ARM)Via WarpDevelopment/testing
Apple SiliconCPU onlymacOS support

When to Apply

Reference these guidelines when:

  • Building neighbor lists for molecular simulations or GNNs
  • Computing long-range electrostatic interactions (periodic systems)
  • Adding DFT-D3(BJ) dispersion corrections to DFT workflows
  • Batching heterogeneous molecular systems for GPU throughput
  • Integrating atomistic kernels with torch.compile
  • Building molecular dynamics simulations with rebuild detection
  • Computing multipole electrostatics for ML force fields
  • Accelerating computational chemistry pipelines on NVIDIA GPUs

Priority-Ordered Guidelines

PriorityCategoryImpactPrefix
1Neighbor ListsCRITICALneighbor-*
2ElectrostaticsCRITICALelectrostatics-*
3Dispersion CorrectionsHIGHdispersion-*
4Math & UtilitiesMEDIUMmath-*

References

Full documentation with code examples in references/:

FileImpactDescription
neighbor-lists.mdCRITICALAuto-dispatch, cell list, rebuild detection, pre-allocation, torch.compile
electrostatics.mdCRITICALEwald, PME, Coulomb, multipole, parameter estimation, autograd
dispersion-corrections.mdHIGHDFT-D3(BJ), D3Parameters, functional params, multi-pass kernels
math-and-utilities.mdMEDIUMSpherical harmonics, GTO, batch processing, type converters

Problem -> Skill Mapping

ProblemStart With
Build neighbor list for moleculesneighbor-lists.md
Compute electrostatic energy/forceselectrostatics.md
Add dispersion corrections to DFTdispersion-corrections.md
Batch multiple molecular systemsmath-and-utilities.md
Optimize with torch.compileneighbor-lists.md
Molecular dynamics with skin distanceneighbor-lists.md
Compute PME for large periodic systemelectrostatics.md
Multipole electrostatics for MLelectrostatics.md
Compute coordination numbersdispersion-corrections.md
GNN edge construction from atomsneighbor-lists.md
Stress tensor from cell gradientselectrostatics.md
Choose Ewald vs PMEelectrostatics.md

Attribution

Based on NVIDIA ALCHEMI Toolkit-Ops documentation and nvalchemi-toolkit-ops repository.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.