Skip to main content

A library for quantum chemistry

Project description

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
    • 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.9.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (42.6 MB view details)

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

occpy-0.9.0-cp312-abi3-macosx_11_0_arm64.whl (26.2 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

occpy-0.9.0-cp312-abi3-macosx_10_15_universal2.whl (54.2 MB view details)

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

occpy-0.9.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (42.6 MB view details)

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

occpy-0.9.0-cp311-cp311-macosx_11_0_arm64.whl (26.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

occpy-0.9.0-cp311-cp311-macosx_10_15_universal2.whl (54.2 MB view details)

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

occpy-0.9.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (42.9 MB view details)

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

occpy-0.9.0-cp310-cp310-macosx_11_0_arm64.whl (26.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

occpy-0.9.0-cp310-cp310-macosx_10_15_universal2.whl (54.2 MB view details)

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

File details

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

File metadata

File hashes

Hashes for occpy-0.9.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 56ef9205bcb04f2e4195081bd5027c7a938c7bf1de0eee4b5c359409215e629e
MD5 5a7ec6ea9ea75ecb83a07e13f90e719e
BLAKE2b-256 a8a086732b875383ba31f8b99076be9083336f92fc04b82755743d8e209980d1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 075d08b0e5515d37f89af05b81ddb8156048bfe79853b4524eb77cc677f5264e
MD5 459f4aa37f694a62c109579015f0a803
BLAKE2b-256 3a2443e285d7c51a1e345d02f0bd1a24c205f99bffd7941108f208352c8bdae4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.0-cp312-abi3-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 71427a52966fa20cf6df1846737272978f02993a7e3d345f6794ed9d4185a278
MD5 d9dd66c028093feb4440978d48185207
BLAKE2b-256 eccf8d973f9d03ffe80098097666290080835442d82b9313b94f656457b118cf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 211102b8264edd2845e919d64a6119fb72de97c1ffc19692a653b93c921e0212
MD5 9668abe771269045ebfbe7e20d09c7fe
BLAKE2b-256 ca3f934e60311a8d7506412abab5c064519873d9c365a8b80127418d3e9448af

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 180570566a2b1c2e6e44704334e5edbe6102faabb4b6547a54e61c61a068a85d
MD5 3de8c97dd5741918e6d6b3fca8f53e91
BLAKE2b-256 d102f51869b6b88ad5c8294c9ff2b30dfdeed4092c95520a3d51a11beed104ba

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.0-cp311-cp311-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 dca21ac37d4130b7fcff40a9f7c9e3bbb450e361d9283f64e4bc4f68d22d1f6f
MD5 ee863f7c721532afcbb78a467ea0728f
BLAKE2b-256 ad7c032fd393c6d3d47c3e9e89532892bc8f55b996b3fb578118a4730f908ac4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1fb2cb05ece4db76c60f7a814d75e474d504ab7411bf91546781d17267026ab8
MD5 6867b423c39d7d8c26ebc87a72368ad7
BLAKE2b-256 b22fcbcc92a2847077b80d2b22f379ea7a3cde25ff4b4aaf59e6dd19fe590a1f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4ccd1201bda5d131e41fb2cf22206c0c38e7a3bcd27e2d803da942d4ffb1cca3
MD5 7e0fef4088573568bdea25c633ebbabc
BLAKE2b-256 eea0e8fb3ba1fd7524eed68b3dee73bafef2386099ea70e3dcd1c5fd41040601

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.0-cp310-cp310-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 0071f85a327a4c430543408934cd7690e528177745ff8f6644ae0c4539d6cde8
MD5 b54d6ab1d5897e52440ffb7825a09303
BLAKE2b-256 84b897e1006875735a364d6cb54753617edd1c0bb67936097ad037551c7cb360

See more details on using hashes here.

Provenance

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