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, with or without multipoles, validated to 1e-5 Ha/Bohr against finite differences of the energy; 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.
  • 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 molecular geometry optimizer follows the translation-rotation internal coordinates (TRIC) and step control of geomeTRIC (L.-P. Wang and C. Song, J. Chem. Phys. 144, 214108 (2016)), and starts from Lindh's model Hessian (R. Lindh et al., Chem. Phys. Lett. 241, 423 (1995)).

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.

If you use the RINSE crystal descriptor (occ describe on a crystal structure, or Rinse in the Python and Lua bindings), cite the X-ray scattering factors it is built on:

  • D. Waasmaier, A. Kirfel, New analytical scattering-factor functions for free atoms and ions, Acta Cryst. A 51, 416-431 (1995). doi:10.1107/S0108767394013292
  • R. F. Stewart, E. R. Davidson, W. T. Simpson, Coherent X-Ray Scattering for the Hydrogen Atom in the Hydrogen Molecule, J. Chem. Phys. 42, 3175-3187 (1965). doi:10.1063/1.1696397
  • R. W. Grosse-Kunstleve, N. K. Sauter, N. W. Moriarty, P. D. Adams, The Computational Crystallography Toolbox: crystallographic algorithms in a reusable software framework, J. Appl. Cryst. 35, 126-136 (2002). doi:10.1107/S0021889801017824 -- the source of the five-Gaussian fit to the Stewart-Davidson-Simpson bonded hydrogen used for H.

The OCC implementation is a port of, and reproduces the descriptors and hashes of, the rinse-descriptor reference implementation by T. Fellowes, including its bundled PCA hash model.

Metadata

Release files for occpy 0.10.0

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.10.0
File Actions
occpy-0.10.0-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 for occpy-0.10.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
occpy-0.10.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for occpy-0.10.0-cp312-abi3-macosx_11_0_arm64.whl
occpy-0.10.0-cp312-abi3-macosx_10_15_universal2.whl CPython 3.12 abi3 macOS 10.15+ universal2 (ARM64, x86-64) Details for occpy-0.10.0-cp312-abi3-macosx_10_15_universal2.whl
occpy-0.10.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for occpy-0.10.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
occpy-0.10.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for occpy-0.10.0-cp311-cp311-macosx_11_0_arm64.whl
occpy-0.10.0-cp311-cp311-macosx_10_15_universal2.whl CPython 3.11 CPython 3.11 macOS 10.15+ universal2 (ARM64, x86-64) Details for occpy-0.10.0-cp311-cp311-macosx_10_15_universal2.whl
occpy-0.10.0-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 for occpy-0.10.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
occpy-0.10.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for occpy-0.10.0-cp310-cp310-macosx_11_0_arm64.whl
occpy-0.10.0-cp310-cp310-macosx_10_15_universal2.whl CPython 3.10 CPython 3.10 macOS 10.15+ universal2 (ARM64, x86-64) Details for occpy-0.10.0-cp310-cp310-macosx_10_15_universal2.whl

Total release size: 490.4 MB

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

Download URL occpy-0.10.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 54.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
e2107df133a2f1ae7b5a48d563192acfe99d3e0e23001269f693ebd8f92a38e4
BLAKE2b-256 checksum
How to use checksums
ebc19cc6444f2f10cd2d13f07a22e274cb45c5eeef5638f0e8ed59425587ebb1
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 Dec 3, 2026.

Transparency log

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

Download URL occpy-0.10.0-cp312-abi3-macosx_11_0_arm64.whl
Size 34.9 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9aab5ce881f7d2dbfc4e1e3bcc005ac96096cfbcb26e4ffa0d49a935228594f8
BLAKE2b-256 checksum
How to use checksums
0dd4f4a0e1e7b4bf9fcb1c19268bb3e2fa44da2454e24848784004aea25f0a38
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 Dec 3, 2026.

Transparency log

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

Download URL occpy-0.10.0-cp312-abi3-macosx_10_15_universal2.whl
Size 73.7 MB
Tags CPython 3.12 abi3 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
987d32ef413be1a57ba144050bc520f2bdf4724cad0838388ca9c21d673212ca
BLAKE2b-256 checksum
How to use checksums
41846bbb0144a648317d7687195540ee988fe5b7fb30132af5a357ccb23b14d7
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 Dec 3, 2026.

Transparency log

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

Download URL occpy-0.10.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 54.9 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
5c6cb4f48b558ac2c3cd55d73782f15013b3e15cecf25fb0f107013f53bf4445
BLAKE2b-256 checksum
How to use checksums
94351f38378486708f80790644ba4edaf9f686434ea225ed0ab928d3ab7d8233
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 Dec 3, 2026.

Transparency log

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

Download URL occpy-0.10.0-cp311-cp311-macosx_11_0_arm64.whl
Size 34.9 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
550aa697a0c2b50c9f010d2b9a403066ea1f8a3a1a94af6ff3846f709bc73ea3
BLAKE2b-256 checksum
How to use checksums
02e751a58ca8cc07709526abd6c87443027717c00a71510a3369a1c8895afc29
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 Dec 3, 2026.

Transparency log

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

Download URL occpy-0.10.0-cp311-cp311-macosx_10_15_universal2.whl
Size 73.7 MB
Tags CPython 3.11 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
a2994ee282dafd9bd4a0fb4c4e4724f4c02fcf2400b50e6a90d3bc5701257d1e
BLAKE2b-256 checksum
How to use checksums
f14f7c72cae10fdfc168cbe349fc28de623079a9c7e0d03b1a5496ce6fbafdfd
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 Dec 3, 2026.

Transparency log

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

Download URL occpy-0.10.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 54.9 MB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d652e3d1389fc9172ddeec5de784f8b980cd19c76065942ba4e0535b85b970b1
BLAKE2b-256 checksum
How to use checksums
41f2a5b8210aaeafa4d779903ce2d467d2c0131e9870ad21b8b5733c9bbddcf1
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 Dec 3, 2026.

Transparency log

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

Download URL occpy-0.10.0-cp310-cp310-macosx_11_0_arm64.whl
Size 34.9 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4f29a26404054af24b86697bc4207d7d6ab3553019c42419643fb306965863e5
BLAKE2b-256 checksum
How to use checksums
745e338ff4ba87dc66f20f1bf2029bd4746f5a3210386342858ac7176aa97543
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 Dec 3, 2026.

Transparency log

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

Download URL occpy-0.10.0-cp310-cp310-macosx_10_15_universal2.whl
Size 73.7 MB
Tags CPython 3.10 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
8711a0fc7bef5629553a6e3fc96fdaeee8253e5cac87fbb86b330a916ae9069f
BLAKE2b-256 checksum
How to use checksums
97868d08306e88ae6f8c811dabe6730324aecae816106e00dcd974529fdf4075
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 Dec 3, 2026.

Transparency log

Security for occpy 0.10.0

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.

Full provenance

All 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for occpy-0.10.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

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 Dec 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.10.0 This release

9 release files Full provenance

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