PyFock

Pure Python quantum chemistry.
GPU-accelerated. Beautifully simple.

Get Started Try GUI

Quantum chemistry,
reimagined in Python

PyFock is a pure Python DFT code that achieves performance comparable to traditional C/C++ implementations of molecular integrals (ex: libcint, libint) and DFT—all while being incredibly easy to install and use.

Built keeping ease of development & use, and performance in mind

🐍

100% Pure Python

All code, including molecular integrals and exchange-correlation term evaluation, written entirely in Python. No hidden C/C++ libraries. Easy for researchers and developers to tweak and modify.

GPU Accelerated

CUDA support via Numba and CuPy delivers up to 90× speedup compared to single-core PySCF on large systems (H2O)139.

📦

Easy Installation

Simple pip install on Linux, macOS, and Windows. No complex build process. Code gets compiled and cached at the first run.

📊

Near-Quadratic Scaling

Favorable ~O(N²·⁰⁵) scaling through density fitting with Cauchy-Schwarz screening.

🔬

Accurate Results

Numerical accuracy consistent with PySCF (< 10⁻⁷ Ha).

🌐

Web-based GUI

Interactive interface for visualization and input script generation.

Performance that matters

Competitive with state-of-the-art codes while maintaining pure Python simplicity.

90×
GPU speedup vs PySCF (CPU) on single-core
~N²
Scaling with system size
Up to ~2×
Faster than PySCF on CPU using same no. of cores

Simple, elegant code

Run a KS-DFT calculation with just a few lines of Python.

from pyfock import Basis, Mol, DFT

# Define molecule from XYZ file
mol = Mol(coordfile='h2o.xyz')

# Set up basis sets
basis = Basis(mol, {'all': Basis.load(mol=mol, basis_name='def2-SVP')})
auxbasis = Basis(mol, {'all': Basis.load(mol=mol, basis_name='def2-universal-jfit')})

# Configure DFT calculation (PBE functional)
dftObj = DFT(mol, basis, auxbasis, xc='PBE')

# Run SCF calculation
energy, dmat = dftObj.scf()
print(f"Total Energy: {energy} Ha")

Get started in seconds

1. Install PyFock

Simple pip installation on any platform

pip install pyfock

2. Optional: Install LibXC

For access to exchange-correlation functionals not implemented in PyFock

conda install -c conda-forge pylibxc -y

3. Optional: GPU Support

Enable CUDA acceleration

pip install cupy-cuda11x

Everything you need

Density Fitting

Efficient Coulomb term evaluation with Cauchy-Schwarz screening

Multiple Integration Schemes

Classical, Obara-Saika and Rys quadrature methods (roots 1–10) for ERIs

Linear Scaling XC term Evaluation

LDA, GGA and meta-GGA functionals supported natively and also via LibXC

DIIS

Accelerated SCF convergence

Parallel Execution

Multi-core CPU (single node) and GPU support through Numba, Cupy and Joblib

Cross-Platform

Works on Linux, macOS, and Windows

Cite PyFock

If you use PyFock in your research, please cite the following article:

TOC Graphical Abstract
PyFock TOC Graphic
@misc{sharma2026pyfock,
  title        = {PyFock: A Just-In-Time Compiled Gaussian Basis DFT Python Code for CPU and GPU Architectures},
  author       = {Sharma, Manas and Sierka, Marek},
  year         = {2026},
  publisher    = {ChemRxiv},
  note         = {Preprint},
  doi          = {https://doi.org/10.26434/chemrxiv.15003943/v1}
}
📄 Read the Preprint

Preprint available on ChemRxiv