Skip to main content

Open Computational Chemistry (OCC)

Build & Test PyPI version PyPI Downloads Zenodo DOI Paper DOI

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, or occ cg --solvation-model cosmo-rs); CPCM-X for xTB. No solvent segment ensembles are shipped: compute them with occ 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 XtbCalculator class 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 .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

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

  1. Clone the repository:

    git clone https://github.com/peterspackman/occ.git
    cd occ
    
  2. Configure dependency caching (recommended):

    export CPM_SOURCE_CACHE="$HOME/.cache/cpm"
    
  3. 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.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for occpy 0.9.5
File
occpy-0.9.5-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
occpy-0.9.5-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
occpy-0.9.5-cp312-abi3-macosx_10_15_universal2.whl CPython 3.12 abi3 macOS 10.15+ universal2 (ARM64, x86-64) Details
occpy-0.9.5-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.5-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
occpy-0.9.5-cp311-cp311-macosx_10_15_universal2.whl CPython 3.11 CPython 3.11 macOS 10.15+ universal2 (ARM64, x86-64) Details
occpy-0.9.5-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.5-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
occpy-0.9.5-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.7 MB

Release files / occpy-0.9.5-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL occpy-0.9.5-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 49.0 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
3b64f92f35389aac85bd2f453c152aef91007de05da05cf2201bf30d3df43b84
BLAKE2b-256 checksum
How to use checksums
fd086f55c385432be563bc5421331d0a2d90df6fb353a63af78223dca45781d3
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 5, 2026.

Transparency log

Release files / occpy-0.9.5-cp312-abi3-macosx_11_0_arm64.whl

Download URL occpy-0.9.5-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
34dda9c14be72f3ae4fd70d618d83fdad70b89720a4ade0c11af7f28937df203
BLAKE2b-256 checksum
How to use checksums
78bee779d9b3630cc3fdfddd2f8f51051eb59335c8f499495199fc52a9ddba7b
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 5, 2026.

Transparency log

Release files / occpy-0.9.5-cp312-abi3-macosx_10_15_universal2.whl

Download URL occpy-0.9.5-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
fb00a20fe33941e04209506ee9bf50715b751f79853dc70cb6ced586ef837268
BLAKE2b-256 checksum
How to use checksums
208754468b0559ce1fa811435764c6efb86bae3caf89f30cd15ca0e47abec25b
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 5, 2026.

Transparency log

Release files / occpy-0.9.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL occpy-0.9.5-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
89375cb7d898a878c753324cc5a518e6f14052fa7290f9a84b12c104446fc12c
BLAKE2b-256 checksum
How to use checksums
98d0ca2618481a0048a6929decce8ef4587c3222fa3c2aefdc581df220cb9adc
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 5, 2026.

Transparency log

Release files / occpy-0.9.5-cp311-cp311-macosx_11_0_arm64.whl

Download URL occpy-0.9.5-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
ae93ad93378d3db813fd633ac5a172b3bc397cf6e2011b9d7be3e96b7085bf35
BLAKE2b-256 checksum
How to use checksums
1bc68054d9d291063e634e8b986edef21fab4ab2c59c52624dae9945ce7aa070
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 5, 2026.

Transparency log

Release files / occpy-0.9.5-cp311-cp311-macosx_10_15_universal2.whl

Download URL occpy-0.9.5-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
c0e824b0fdac50e5143cbfd458a22dab21970519441794681c251e8ffd40f7f3
BLAKE2b-256 checksum
How to use checksums
966d41cce1e3d822b539ce92d7f0364bdb7a4d228c8ce26547a87b612e4f20b7
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 5, 2026.

Transparency log

Release files / occpy-0.9.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL occpy-0.9.5-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
f14917ae581bcec44a4a92a8750169b1707aba0125047ae825726237118aeb07
BLAKE2b-256 checksum
How to use checksums
6ae4483350a671ae10f6964cbcdf0f2258abb21332ea07682f3e6ba0e91342c6
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 5, 2026.

Transparency log

Release files / occpy-0.9.5-cp310-cp310-macosx_11_0_arm64.whl

Download URL occpy-0.9.5-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
56bbd70e0295f809dbc51fd6ec236f5cdb2497113b003dfe01d790738bc85c6f
BLAKE2b-256 checksum
How to use checksums
9e8b539394696974879af0d192860b55cfeb0f311054be7a44f97da5bc3337b7
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 5, 2026.

Transparency log

Release files / occpy-0.9.5-cp310-cp310-macosx_10_15_universal2.whl

Download URL occpy-0.9.5-cp310-cp310-macosx_10_15_universal2.whl
Size 62.7 MB
Tags CPython 3.10 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
651feef89e3536619342ca24ea2e5e02db7c2ffb298f6ba818aa238402b44fbe
BLAKE2b-256 checksum
How to use checksums
e230f874d80648c8316f657332d635e50c95cbb9c17390ae2bac9eae57ef8f46
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 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.5 This release

9 release files

0.9.4

9 release files

0.9.3

9 release files

0.9.2

9 release files

0.9.1

9 release files

0.9.0

9 release files

0.8.8

9 release files

0.8.6

6 release files

0.8.5

9 release files

0.8.4

9 release files

0.8.3

9 release files

0.7.9

9 release files

0.7.8

9 release files

0.7.7

9 release files

0.7.6

9 release files

0.7.5

9 release files

0.7.4

9 release files

0.7.3

9 release files

0.7.2

9 release files

0.6.12

9 release files

0.6.11

9 release files

0.6.9

9 release files

0.6.8

9 release files

0.5.7

16 release files

0.5.5

8 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page