Skip to main content

A library for quantum chemistry

Project description

Open Computational Chemistry (OCC)

Build & Test PyPI version PyPI Downloads 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
    • 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...

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

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 Å

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.

Project details


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.8.8-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (38.7 MB view details)

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

occpy-0.8.8-cp312-abi3-macosx_11_0_arm64.whl (23.5 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

occpy-0.8.8-cp312-abi3-macosx_10_15_universal2.whl (48.4 MB view details)

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

occpy-0.8.8-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (38.7 MB view details)

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

occpy-0.8.8-cp311-cp311-macosx_11_0_arm64.whl (23.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

occpy-0.8.8-cp311-cp311-macosx_10_15_universal2.whl (48.4 MB view details)

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

occpy-0.8.8-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (38.7 MB view details)

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

occpy-0.8.8-cp310-cp310-macosx_11_0_arm64.whl (23.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

occpy-0.8.8-cp310-cp310-macosx_10_15_universal2.whl (48.4 MB view details)

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

File details

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

File metadata

File hashes

Hashes for occpy-0.8.8-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7a8bfa8694f21dbf27b8e5ff92803686b4e14e16f81b5995827c4e56e577a4da
MD5 c369e6dabb64280004f702d0d9493b2a
BLAKE2b-256 fb71abfa7161f569da5b0be540739570f1a2150fe3324bb1b8e3ab3b45a16e51

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.8.8-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.8.8-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for occpy-0.8.8-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7cc84beb593fda6da0142b524bd3abb9faf9cb94bef2f9044f8f4ac37b50030f
MD5 c11e19228881a0bc6af0246eb5221b8d
BLAKE2b-256 abd1e9a9b5f5267f9e17014e678fb16ee5b323a66f201bc061b1475167a3d7c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.8.8-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.8.8-cp312-abi3-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for occpy-0.8.8-cp312-abi3-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 4edfa20fb077af8d626949b00033d47dd667fa626ffa99983a2b04fbde28a23d
MD5 6c58e94721c508ca37e89677f9f0228a
BLAKE2b-256 e33cfe0645960db7606c46d2acae6a992789500f59e59604eaeea1439e22ea51

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.8.8-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.8.8-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for occpy-0.8.8-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 916bb5c156846b6660bfa213ab80b68c0c1b0161aa7bdaedf9cbb58c71868611
MD5 bb451cbaae2f7bbc2a626bbe417d4413
BLAKE2b-256 3359c1c0cb7ece685e190096b53f38da4c73f23c86563c8775ae930587305c1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.8.8-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.8.8-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for occpy-0.8.8-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 18bcfe444c1c54900567611b5d35ae68857ac4cccee93d4edd41bc923ca382f8
MD5 571ab16cbdf961b89dc29245f2acf5e5
BLAKE2b-256 c1e7a5db6749986993c3a73eefd3306f8bbfcb51e311666dd13b5d1d5f6690d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.8.8-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.8.8-cp311-cp311-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for occpy-0.8.8-cp311-cp311-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 9c59c9ef378e8b4697df079d9118131a736690c9805859f82235d876f986a8a0
MD5 ee0f332b75fa1ecad18bbd320af6d246
BLAKE2b-256 5dfb5ee802934931eeea1ca298990cf252ab66c08d8d1d64009f0ee9715d8f46

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.8.8-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.8.8-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for occpy-0.8.8-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3e3a9ec612ee602fe41881d6bc1bfaf50a0ac0eb994351b75d5fb188390b4baf
MD5 c2ffce061a607651f80bbe94618c3eaf
BLAKE2b-256 e894a4637e04661449e4bab07874dd4f3bc27adfa08fd2d3eb305db38effd0c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.8.8-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.8.8-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for occpy-0.8.8-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 485cd7839b4ffe01666ab561cc78614d4b1b5b74f4619a1c6d75d02523562984
MD5 67be16c07a181473849d70ac69fa0298
BLAKE2b-256 45c8996c44a53b5dff169516e7f26455c467be61f379485e07a45648db54f0aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.8.8-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.8.8-cp310-cp310-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for occpy-0.8.8-cp310-cp310-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 974a8a659c6d3b76876d258b8524c57d50b9f716fe8988355c3f6923b9c88081
MD5 ee6ffb5e21a5ae3fa94e2c3955099e66
BLAKE2b-256 3873e3ef6a5ca419aa7be8f5bef3b02715b6c957eb0a62a3115f29db8a579f4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for occpy-0.8.8-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page