A next-generation quantum chemistry and crystallography program and library, designed for modern computational workflows.
Note: OCC is in active development and undergoes frequent changes. The API and features are not yet stable.
The easiest way to install OCC is via pip:
pip install occpy
Supported Python versions:
- Python 3.10, 3.11, 3.12, 3.13
Pre-built wheels are available for:
- Linux (x86_64)
- macOS (x86_64 and ARM64/Apple Silicon via universal2 wheels)
OCC provides comprehensive functionality for ground-state single-point calculations:
-
Electronic Structure Methods
- Hartree-Fock (Restricted, Unrestricted, and General Spinorbitals)
- Density-Functional Theory (Restricted & Unrestricted)
- Supported approximations: LDA, GGA, meta-GGA
- Global hybrid functionals (range-separated support planned)
- Density fitting (RI-JK) with auxiliary basis sets
- Implicit solvation via SMD
- XDM dispersion model
-
Property Calculations
- Molecular and atomic multipole moments (up to hexadecapole)
- Electron density, Electrostatic potential
- CHELPG charges
- Isosurfaces, generation of volumetric data and more...
- CIF file processing (via gemmi)
- Advanced periodic analysis:
- Fast periodic bond detection
- Symmetry-unique molecule generation
- Dimer identification
- Energy calculations:
- CrystalExplorer model energies
- Automatic direct space lattice energy summation
- Wolf summation for neutral molecular crystals
- Surface analysis:
- Hirshfeld surfaces
- Promolecule surfaces
- Spherical harmonic transforms (FFT-based)
- Molecular point group detection
- File format support:
- Gaussian fchk files (read/write)
- Molden files
- NumPy
.npy
arrays (write) - QCSchema JSON
- Basic Gaussian input files
- Geometric algorithms:
- Marching cubes
- Morton codes for linear-hashed octrees
- Electronegativity equilibration method for charges
- Python bindings via nanobind
import occ
# Set up basic configuration
occ.setup_logging(1) # Configure logging level
occ.set_data_directory("/path/to/basis/sets") # Optional: Set basis set path
# Load molecule from XYZ file
mol = occ.Molecule.from_xyz_file("h2o.xyz")
# Basic Hartree-Fock calculation
basis = occ.AOBasis.load("6-31G", mol.atoms())
hf = occ.HartreeFock(basis)
scf = hf.scf(unrestricted=False) # Restricted calculation
scf.set_charge_multiplicity(0, 1) # Neutral singlet
energy = scf.run()
wfn = scf.wavefunction()
# DFT calculation
dft = occ.DFT("B3LYP", basis)
ks = dft.scf(unrestricted=False)
ks.set_charge_multiplicity(0, 1)
energy = ks.run()
# Crystal structure analysis
crystal = occ.Crystal.from_cif_file("structure.cif")
dimers = crystal.symmetry_unique_dimers(radius=10.0) # Get unique dimers within 10 Å
For more examples and detailed API documentation, please refer to the documentation.
- C++17 compliant compiler (GCC 10+ recommended)
- CMake 3.15+
- Ninja (recommended) or Make
OCC uses modern C++ libraries to provide its functionality:
Library | Version | Description |
---|---|---|
CLI11 | 2.4.2 | Command line parser |
Eigen3 | 3.4.0+ | Linear algebra |
fmt | 11.0.2 | String formatting |
gemmi | 0.6.5 | Crystallographic file handling |
LBFGS++ | master | Optimization algorithms |
libcint | 6.1.2 | Gaussian integrals |
libxc | 6.2.2 | Exchange-correlation functionals |
nlohmann/json | 3.11.3 | JSON handling |
scnlib | 4.0.1 | String parsing |
spdlog | 1.15.0 | Logging |
unordered_dense | 4.5.0 | Hash containers |
Optional dependencies:
- nanobind (2.4.0) - For Python bindings
Most dependencies are automatically handled through CPM. System-installed versions of Eigen3 and libxc can be used if available.
-
Clone the repository:
git clone https://github.com/peterspackman/occ.git cd occ
-
Configure dependency caching (recommended):
export CPM_SOURCE_CACHE="$HOME/.cache/cpm"
-
Build with CMake:
mkdir build && cd build # Using system dependencies (if available) cmake .. -GNinja # OR download all dependencies cmake .. -GNinja -DUSE_SYSTEM_LIBXC=OFF -DUSE_SYSTEM_EIGEN=OFF # Build the executable ninja occ
USE_SYSTEM_LIBXC
: Use system-installed libxc (default: ON)USE_SYSTEM_EIGEN
: Use system-installed Eigen3 (default: ON)WITH_PYTHON_BINDINGS
: Build Python bindings (default: OFF)USE_MLX
: Enable MLX integration (default: OFF)USE_QCINT
: Use QCInt instead of libcint (default: OFF)ENABLE_HOST_OPT
: Enable host-specific optimizations (default: OFF)
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
If you use OCC in your research, please cite the appropriate papers for all functionals, methods etc. you use, along with the citations for the core dependencies here.