Open Computational Chemistry (OCC)
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.
Installation
From PyPI
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)
Features
Quantum Chemistry
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
- GFN2-xTB semi-empirical tight-binding (molecular + periodic; see below)
- Implicit solvation: SMD, and openCOSMO-RS 24a (
occ cosmo-rs, orocc cg --solvation-model cosmo-rs); CPCM-X for xTB. No solvent segment ensembles are shipped: compute them withocc cosmo-rs <solvent>.xyz --write-segments <solvent>.json, or give a solvent geometry directly with--solvent-geometry - XDM dispersion model
- D4 (DFT-D4) dispersion correction
-
Property Calculations
- Molecular and atomic multipole moments (up to hexadecapole)
- Electron density, Electrostatic potential
- CHELPG charges
- Isosurfaces, generation of volumetric data and more...
Crystal Structure Analysis
- 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
GFN2-xTB
OCC ships a native C++ implementation of the GFN2-xTB semi-empirical
tight-binding method (Bannwarth, Ehlers, Grimme, J. Chem. Theory Comput.
15, 1652 (2019), doi:10.1021/acs.jctc.8b01176).
The implementation was developed with reference to Grimme's xTB and the
tblite reference implementation
(Apache-2.0 / LGPL-3.0+), and uses the published GFN2-xTB parameter set
(bundled in share/xtb/gfn2.json).
Available now
- Molecular SCC: full GFN2 with CAMM multipole AES, on-site polarisation, third-order, and native D4 dispersion -- agrees with xTB to single uHa on small molecules.
- Periodic SCC (Gamma-only and Monkhorst-Pack k-point sampling) on real molecular crystals, with multipole AES, Ewald-summed gamma, and lattice-summed D4.
- Analytical molecular gradient (charge-only SCC variant), validated to 5e-5 Ha/Bohr against finite differences; numerical Hessian for frequencies.
- Implicit solvation via CPCM-X and SMD-xTB.
- Bindings via the
XtbCalculatorclass in Python (nanobind) and JS/WASM (emscripten/embind).
Current limitations
- Periodic gradient and crystal-cell optimisation are not yet wired up.
- The "multipole-on" analytical gradient still has a known ~1 mHa gap versus FD-of-energy from missing AO-multipole integral derivatives -- the charge-only gradient is the production variant.
- Open-shell GFN2 (and GFN1/GFN0) are out of scope for v1.
- Periodic energies on dense molecular crystals are ~0.4-0.6 mHa/atom too bound versus tblite (missing WSC-image averaging in the gamma build is the leading suspect).
Additional Features
- Spherical harmonic transforms (FFT-based)
- Molecular point group detection
- File format support:
- Gaussian fchk files (read/write)
- Molden files
- NumPy
.npyarrays (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
Python API Examples
import occpy
from occpy import Crystal, Molecule, AOBasis, HartreeFock, DFT
from occpy import SpinorbitalKind
# Set up basic configuration
occpy.set_log_level(occpy.LogLevel.WARN) # Configure logging level
# occpy.set_data_directory("/path/to/basis/sets") # Optional: Set basis set path
# Load molecule from XYZ file
mol = Molecule.from_xyz_file("h2o.xyz")
# Basic Restricted Hartree-Fock calculation
basis = AOBasis.load(mol.atoms(), "6-31G")
hf = HartreeFock(basis)
scf = hf.scf()
energy = scf.run()
wfn = scf.wavefunction()
# DFT calculation
dft = DFT("B3LYP", basis)
ks = dft.scf(SpinorbitalKind.Unrestricted)
ks.set_charge_multiplicity(0, 1)
energy = ks.run()
# Crystal structure analysis
crystal = Crystal.from_cif_file("structure.cif")
dimers = crystal.symmetry_unique_dimers(10.0) # Get unique dimers within 10 A
For more examples and detailed API documentation, please refer to the documentation.
Build from Source
Prerequisites
- C++17 compliant compiler (GCC 10+ recommended)
- CMake 3.15+
- Ninja (recommended) or Make
Dependencies
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.
OCC's geometry optimization implementation for molecules made significant use of the code and documentation from pyberny - the files in the opt submodule are therefore subject to the MPL license.
Build Instructions
-
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
CMake Options
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)
Contributing
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.
Citation
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.
If you use the GFN2-xTB implementation, cite:
- C. Bannwarth, S. Ehlers, S. Grimme, GFN2-xTB -- An Accurate and Broadly Parametrized Self-Consistent Tight-Binding Quantum Chemical Method with Multipole Electrostatics and Density-Dependent Dispersion Contributions, J. Chem. Theory Comput. 15, 1652-1671 (2019). doi:10.1021/acs.jctc.8b01176
- E. Caldeweyher, S. Ehlers, S. Grimme et al., A generally applicable atomic-charge dependent London dispersion correction, J. Chem. Phys. 150, 154122 (2019). doi:10.1063/1.5090222
The OCC implementation of GFN2-xTB is independent of, but was developed with reference to, the tblite project.
If you use the openCOSMO-RS solvation model (occ cosmo-rs, or
occ cg --solvation-model cosmo-rs), cite:
- S. Müller, T. Nevolianis, M. Garcia-Ratés, C. Riplinger, K. Leonhard, I. Smirnova, Predicting solvation free energies for neutral molecules in any solvent with openCOSMO-RS, Fluid Phase Equilibria 589, 114250 (2025). doi:10.1016/j.fluid.2024.114250
- A. Grigorash, S. Müller, P. Paricaud, E. H. Stenby, I. Smirnova, W. Yan, A comprehensive approach to incorporating intermolecular dispersion into the openCOSMO-RS, Chemical Engineering Science 309, 121425 (2025). doi:10.1016/j.ces.2025.121425
The OCC implementation uses the published 24a parameter set and is independent of, but was developed with reference to, the openCOSMO-RS_py project.
Metadata
Release files for occpy 0.9.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| occpy-0.9.4-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| occpy-0.9.4-cp312-abi3-macosx_11_0_arm64.whl | CPython 3.12 | abi3 | macOS 11.0+ ARM64 | Details |
| occpy-0.9.4-cp312-abi3-macosx_10_15_universal2.whl | CPython 3.12 | abi3 | macOS 10.15+ universal2 (ARM64, x86-64) | Details |
| occpy-0.9.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| occpy-0.9.4-cp311-cp311-macosx_11_0_arm64.whl | CPython 3.11 | CPython 3.11 | macOS 11.0+ ARM64 | Details |
| occpy-0.9.4-cp311-cp311-macosx_10_15_universal2.whl | CPython 3.11 | CPython 3.11 | macOS 10.15+ universal2 (ARM64, x86-64) | Details |
| occpy-0.9.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| occpy-0.9.4-cp310-cp310-macosx_11_0_arm64.whl | CPython 3.10 | CPython 3.10 | macOS 11.0+ ARM64 | Details |
| occpy-0.9.4-cp310-cp310-macosx_10_15_universal2.whl | CPython 3.10 | CPython 3.10 | macOS 10.15+ universal2 (ARM64, x86-64) | Details |
Total release size: 426.4 MB
Release files / occpy-0.9.4-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | occpy-0.9.4-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 48.9 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
942ce03d91c3c5947bf00d87e707d0340f06cc9d320bcb584a0443866d6a67eb
|
|
BLAKE2b-256 checksum How to use checksums |
7b10dce2882498eaaf82776d6a75e64ec7098b561b1f6ec72a473d6442e48bb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / occpy-0.9.4-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | occpy-0.9.4-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 30.5 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
448934493827df5396b592131b98347e5b5ef26733c8ec080cc1e87cbd926913
|
|
BLAKE2b-256 checksum How to use checksums |
4da25cfb928bc3faff761727a288fe0e0432f94c7933b09bc5acc6151ba7847e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / occpy-0.9.4-cp312-abi3-macosx_10_15_universal2.whl
| Download URL | occpy-0.9.4-cp312-abi3-macosx_10_15_universal2.whl |
|---|---|
| Size | 62.7 MB |
| Tags | CPython 3.12 abi3 macOS 10.15+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
3a771e353c910a70ecc4975cc7422032a776cf26e012c102c40fecbf11575a9a
|
|
BLAKE2b-256 checksum How to use checksums |
7cc8696476d2fe383bf92cfe52f7191149e45a5a9a719ade78aadde17e8fd781
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / occpy-0.9.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | occpy-0.9.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 49.0 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
cb1bdf89007f2b40776459a7b117f1d247e806163322e66cbe1e0491f34d18ae
|
|
BLAKE2b-256 checksum How to use checksums |
d98d217405ed1be5e35806084daf4d98884d2b66b46978f32119e351145cd54b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / occpy-0.9.4-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | occpy-0.9.4-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 30.5 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
688b1e2cc4a4fe6a6320cef103aa0a956f8f3d7df263be6ac12c5bedf0def11c
|
|
BLAKE2b-256 checksum How to use checksums |
ee41f87ec9bef62110a421da6ecb0dba5fe5e246a6b9ce46162dc2f3678896c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / occpy-0.9.4-cp311-cp311-macosx_10_15_universal2.whl
| Download URL | occpy-0.9.4-cp311-cp311-macosx_10_15_universal2.whl |
|---|---|
| Size | 62.7 MB |
| Tags | CPython 3.11 macOS 10.15+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
6c349cfd61a44f9feaaac9939a7834ce5ba81a2680c011c69e59c0c7fce3b712
|
|
BLAKE2b-256 checksum How to use checksums |
9dbba71470363857a662b75d88c5cacca9283a97cc6450e04575d768223c8c47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / occpy-0.9.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | occpy-0.9.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 49.0 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
960b50759f6cc34a65dd85b534060be778cfd235643d65b3d335f87c7e54ba84
|
|
BLAKE2b-256 checksum How to use checksums |
e8bed3f197c7ea8b2a10e692a477bfe6d854595133ba6deec06d8994e5263751
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / occpy-0.9.4-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | occpy-0.9.4-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 30.5 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6776209476252c4f9e9a1ad9ec24e7e74b78f6c408afdbfb6529e0fe2e6707ba
|
|
BLAKE2b-256 checksum How to use checksums |
08b269e85b25fa7b2573a819c65decc406ad97f0c1881fafccfe66c45e64a27c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / occpy-0.9.4-cp310-cp310-macosx_10_15_universal2.whl
| Download URL | occpy-0.9.4-cp310-cp310-macosx_10_15_universal2.whl |
|---|---|
| Size | 62.6 MB |
| Tags | CPython 3.10 macOS 10.15+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
2a9a4e3370f89127361be5a73138fa859520aef36225e3fc4902656cd9540af4
|
|
BLAKE2b-256 checksum How to use checksums |
9eaa7da397acd75c73230857ced020454bb03c749429d0eda8f7933033b0a58b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency log