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

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

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

occpy-0.9.1-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.1-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.1-cp311-cp311-macosx_11_0_arm64.whl (26.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

occpy-0.9.1-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.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (43.1 MB view details)

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

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

Uploaded CPython 3.10macOS 11.0+ ARM64

occpy-0.9.1-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.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for occpy-0.9.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d3fb488cf5f9a0c95574e7b69e1afed17173db1ba35aab6cea23c65918754da2
MD5 5af40be0e15c560eca22abe48d959618
BLAKE2b-256 c823c1b17965f1ffec97771f8667b9f135301f1fc597ef82b2047a02ba06c366

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.1-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1557d744fc6c504317dc9c530f554a71399f02f3b683e7b4330bf79b574f69ca
MD5 69db0e604047a3ae234ff3cf7c064667
BLAKE2b-256 e31e9828882ef4145e4897108ae93b660a0704cf00886a163dc65282e570ac98

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.1-cp312-abi3-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 fd77d350b1fd64322d6a169f48bf2a0bb2f072d4c77c2bc840b547328474a008
MD5 a541dc1949c383e3224cf841754add8a
BLAKE2b-256 ff45a1fdcc0a294477250c067953092dbbb3020aed45c307e95c5f38921877a1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6f0142fe6c77912aa46a9b2daab4f4840f2a04ba6408dff20af45ad9213de4df
MD5 ffefe8250300d93df48da18e6848ef7a
BLAKE2b-256 ed7af4b204b02a26b187ad3375be2f53029248be5cd461ca8a7cad3fccb74c3c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3621f1b16aa0df028e0f39b50fed63efcbaca9fdaa8b592e511fa1378ebf3a4b
MD5 443904334d430f3b791b17bda1530f4d
BLAKE2b-256 54aa403c252def7e5f359d61e6be9283365031e731d1f15afe82cacc39a3c6a3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.1-cp311-cp311-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 3cd3485832807fe3db3a95914aaa9cfbbf9019794787330e82c6eb7e2f8be0f8
MD5 6373267a206c3f804ab17687e6d520e7
BLAKE2b-256 4570865739ae728faa56f7ada4987bea3502482ead39c1de0793efcce63bbd00

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 db96b57874961d6465e2a184a0430959a93da2a2c3289bb7be929972242dc478
MD5 30757838306f68bf800624fff3f03aad
BLAKE2b-256 692eb7760c7ae8277e9c703358c2fb3c6b4e4aed47a2395771a16e00475d7322

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 88bb753b6e0546b94b40e5b9e24c73e0fe3c25cce7a843940da6053aadcc679f
MD5 f2b348b446514620d81d9503b718a55d
BLAKE2b-256 0b34049996c2d19274048ffcc0fcd9c098ee241bbc97b581a59ff385d2ad46f7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for occpy-0.9.1-cp310-cp310-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 20e02328e2120914e21c48fed4b0d3512c309e69dfbf293bcc94b36d774c9927
MD5 bab5d610de0c0bfc88eb3a5f0cb5c1b9
BLAKE2b-256 0b4b7e42918642d0139683de6ac4dab2e5f3e0cebbec84a41ce0f8e291d4f11b

See more details on using hashes here.

Provenance

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