pyscf/gpu4pyscf

A plugin to use Nvidia GPU in PySCF package

What it solves

Quantum chemistry calculations like Hartree-Fock (HF) and density functional theory (DFT) are computationally demanding, especially for larger molecules or periodic systems. Running them on CPUs can take hours or days. This plugin offloads the heavy math to NVIDIA GPUs, cutting wall-time by 10–30× in the included benchmarks.

How it works

It acts as a drop-in GPU backend for the PySCF framework. You install a pre-built package that matches your CUDA version (11.x, 12.x, or 13.x) and optionally add cuTENSOR to accelerate tensor contractions. In your Python script, you create a normal PySCF molecule and then call .to_gpu() on the mean-field object to move it onto the GPU. The .kernel() method then runs the SCF (self-consistent field) calculation on the GPU. The same object can also compute gradients and Hessians without extra setup.

Who it’s for

Computational chemists, materials scientists, and researchers who already use PySCF for molecular or periodic simulations and have access to NVIDIA GPUs (compute capability 7.0 or newer, e.g., V100, RTX 20-series and later). It is designed for people who want to speed up existing PySCF workflows without rewriting their code.

Highlights

  • Supports molecular and periodic Hartree-Fock and DFT, analytical derivatives, excited states, solvent models, properties, geometry optimization, and non-adiabatic dynamics.
  • Simple installation: pip install gpu4pyscf-cuda12x (adjust for your CUDA version) and optionally install cutensor for better performance.
  • Benchmarks show 10–30× speedups over Q-Chem on 32 CPU cores for density-fitted SCF with various functionals (LDA, PBE, B3LYP, M06, wB97M-V) on an A100 GPU.
  • Interoperability with PySCF: convert existing PySCF objects to GPU objects with .to_gpu() and run calculations immediately.
  • Limitations: basis sets only up to g orbitals (auxiliary up to i), no double hybrid functionals, and density fitting is bounded by CPU memory for ~168 atoms with def2-tzvpd.

Related

  • Project
  • Project
  • Project
  • Project
  • Project