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 via SMD, CPCM-X for xTB
    • 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

occpy-0.9.3-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (48.4 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

occpy-0.9.3-cp312-abi3-macosx_11_0_arm64.whl (30.1 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

occpy-0.9.3-cp312-abi3-macosx_10_15_universal2.whl (61.7 MB view details)

Uploaded CPython 3.12+macOS 10.15+ universal2 (ARM64, x86-64)

occpy-0.9.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (48.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

occpy-0.9.3-cp311-cp311-macosx_11_0_arm64.whl (30.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

occpy-0.9.3-cp311-cp311-macosx_10_15_universal2.whl (61.7 MB view details)

Uploaded CPython 3.11macOS 10.15+ universal2 (ARM64, x86-64)

occpy-0.9.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (48.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

occpy-0.9.3-cp310-cp310-macosx_11_0_arm64.whl (30.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

occpy-0.9.3-cp310-cp310-macosx_10_15_universal2.whl (61.7 MB view details)

Uploaded CPython 3.10macOS 10.15+ universal2 (ARM64, x86-64)

File details

Details for the file occpy-0.9.3-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for occpy-0.9.3-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a931009366d69a8815981fc63e4cfc6aa9a9cb17ad5e8140c374fe33ec42c348
MD5 3b5d731cba5e74e5c60625180832debd
BLAKE2b-256 fe259922a28b5659f7ef9e22eb2fae4207f8b850ca5a35f71f49e698e904d16b

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.9.3-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on peterspackman/occ

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file occpy-0.9.3-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for occpy-0.9.3-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 33f310a9595612d74db861660204c2bd8de24771eb5c737f19112afc86a0dd21
MD5 98fb6588e14b270c89822b2409c2729e
BLAKE2b-256 4561d96e511da8fc277bf9ccbc307c5c25086dfad48fb07da49d6773506c21ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.9.3-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on peterspackman/occ

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file occpy-0.9.3-cp312-abi3-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for occpy-0.9.3-cp312-abi3-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 7d1353c418d26956e0c440bd3017e2c187c7f75639f671cfba06248eaffe9103
MD5 1586b51f777dbf6c4f4d8fa1ea0f67cf
BLAKE2b-256 57b4e92b4cfe9e7cd02ed7bf2af2a65bc462b2abae56b8ffac54313bbf2f71ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.9.3-cp312-abi3-macosx_10_15_universal2.whl:

Publisher: build_wheels.yml on peterspackman/occ

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file occpy-0.9.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for occpy-0.9.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8147a22edb05545de98bef9f401f78fc5ef22f1af0568bd578ea815b313e6a1d
MD5 21c8565d8a4d8c30c1f9f4d8b8ce6ad4
BLAKE2b-256 586bd49861dd5b993e8e7d956c0aa3ef37316901ca504b78ddf0ec12adca70a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.9.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on peterspackman/occ

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file occpy-0.9.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for occpy-0.9.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b6b897274e5ec25bcbd1985d83230f88b63c61d013e1e18ef482d7baed941c1a
MD5 e1252659ced1e7f69064d253d0e6faff
BLAKE2b-256 6c27d496c018f400d9726dbf7222421852c05e8e56213c0209b1ed8d15660cc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.9.3-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on peterspackman/occ

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file occpy-0.9.3-cp311-cp311-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for occpy-0.9.3-cp311-cp311-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 88186c37e9faaaa090a0e99c0a069638359a18d174e1568413fee086d0ab4092
MD5 aa964f20183cac7151d4f0d7b64fc4e3
BLAKE2b-256 97968ef3d9bfb07715062b06d8ba2e749bcf7cd6e16395e4afced7203c4e6c42

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.9.3-cp311-cp311-macosx_10_15_universal2.whl:

Publisher: build_wheels.yml on peterspackman/occ

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file occpy-0.9.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for occpy-0.9.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 56c344342af29d6c23f641050a30f67501c2b8f1140f2e1e264e63466eac1131
MD5 fb7553fff689e7c7f2bd67ad36d1b983
BLAKE2b-256 1a196c1ba6e7fbcbf5a29321295baf9d7413bbdf115a9756c329fcdabe59a90b

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.9.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on peterspackman/occ

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file occpy-0.9.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for occpy-0.9.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d82f5cfbc84bd9081b1ed3186c88f076da6bb69d157eba9370b7503b5ffbd9c7
MD5 514b4cf094a5697f08f7a7bf7e2ec4cb
BLAKE2b-256 ee5be060b4030c176a7c3db3fc4a4e86aa7650f17a7e763e5b42240d169ef7de

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.9.3-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on peterspackman/occ

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file occpy-0.9.3-cp310-cp310-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for occpy-0.9.3-cp310-cp310-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 8100874573a3084783f39e2ac72161f43ae3112c0a6497b4d74ef65700d341b1
MD5 be0fb79c2eab2a5bf4b6c16ad8f0d76c
BLAKE2b-256 d90442b5a301a78b0b4e15b4637e016b9bbd14c1f68528d330fb79af39ab8f2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.9.3-cp310-cp310-macosx_10_15_universal2.whl:

Publisher: build_wheels.yml on peterspackman/occ

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.9.3 This release

9 files

0.9.2

9 files

0.9.1

9 files

0.9.0

9 files

0.8.8

9 files

0.8.6

6 files

0.8.5

9 files

0.8.4

9 files

0.8.3

9 files

0.7.10

9 files

0.7.9

9 files

0.7.8

9 files

0.7.7

9 files

0.7.6

9 files

0.7.5

9 files

0.7.4

9 files

0.7.3

9 files

0.7.2

9 files

0.6.12

9 files

0.6.11

9 files

0.6.9

9 files

0.6.8

9 files

0.6.2

12 files

0.5.7

16 files

0.5.5

8 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