Skip to main content

Python bindings for MSH-QC quantum mechanics library

Project description

MSHQC - Multi-State High-Quality Calculations

License: MIT C++17 Python 3.8-3.13 PyPI version

MSHQC is a high-performance, open-source quantum chemistry library implementing modern electronic structure methods with seamless Python bindings. Designed for both accuracy and extreme computational efficiency, it leverages a highly optimized C++ core utilizing hardware-specific vectorization (AVX2/FMA).

🚀 The "Ultimate" Computational Engine

Under the hood, MSHQC is built on a heavily optimized scientific computing stack to handle extremely large-scale out-of-core calculations:

  • libcint: High-performance analytical integral engine for electron repulsion integrals (ERI).
  • TBLIS: Fast tensor contraction framework that avoids explicit multidimensional array transposition.
  • HDF5: Out-of-core data handling for massive tensor storage (specifically optimized for ABI stability).
  • Eigen3: Modern C++ template library for linear algebra, heavily vectorized.
  • BLIS / OpenBLAS & LAPACKE: Multithreaded standard linear algebra backend.
  • nanobind: Lightweight, highly efficient Python/C++ binding interface (replacing Pybind11).
  • Jemalloc (Optional): Scalable and fragmentation-resistant memory allocator.

🌟 Features

1. Self-Consistent Field (SCF)

  • Restricted, Unrestricted, and Restricted Open-shell Hartree-Fock (RHF, UHF, ROHF).
  • DIIS convergence acceleration.
  • Cholesky Decomposition Variants (CD-RHF, CD-UHF, CD-ROHF).

2. Perturbation Theory (MPn)

  • Møller-Plesset MP2 & MP3 (Restricted and Unrestricted).
  • Orbital-Optimized MP2/MP3 (OMP2/OMP3).
  • Cholesky Decomposition Variants (CD-RMP2/3, CD-UMP2/3, CD-OMP2/3).

3. Multi-Configurational Methods (MCSCF)

  • Complete Active Space SCF (CASSCF) & State-Averaged CASSCF (SA-CASSCF).
  • Complete Active Space Perturbation Theory 2nd order (CASPT2).
  • Cholesky Decomposition Variants (CD-CASSCF, CD-SA-CASSCF).
  • Cholesky Decomposition Perturbation Theories (CD-CASPT2, CD-SA-CASPT2, CD-SA-CASPT3).

4. Advanced Tooling

  • Integral Transformations: Cholesky decomposition for ERI and Four-Index Transformations.
  • Gradients: Analytical and numerical gradients, and geometry optimization.
  • Properties: Natural orbitals, transition density matrices, and one-particle density matrices (OPDM).

📦 Installation

Option A: Install Pre-compiled Wheels via PyPI (Recommended)

MSHQC is continuously tested and deployed via GitHub Actions. Pre-compiled, manylinux-compatible wheels are available for Python 3.10 through 3.13.

pip install mshqc
Option B: Compiling from Source (Super-Turbo Mode)

If you want to compile MSHQC locally to leverage -march=native optimizations for your specific CPU architecture, we highly recommend using an isolated Conda environment to manage the complex C++ library dependencies.
1. System Requirements

    C++ Compiler: GCC 7+ or Clang 5+ (Must support C++17, AVX2, and FMA).

    CMake: Version 3.18 or higher.

    Build Tools: Ninja, Make, ccache (recommended).

2. Conda Environment Setup

To prevent linking errors, install the complete "Ultimate Stack" via conda-forge:
Bash

# Create and activate environment
conda create -n mshqc_env python=3.12
conda activate mshqc_env

# Install critical C++ libraries and build tools
conda install -y -c conda-forge \
    cmake make compilers eigen pkg-config \
    "hdf5=1.14.3" pip libcint tblis liblapacke openblas

# Install Python-level build requirements
python -m pip install build wheel nanobind numpy scipy

3. Build and Install

Clone the repository and install it in editable mode:
Bash

git clone [https://github.com/syahrulhidayat/mshqc.git](https://github.com/syahrulhidayat/mshqc.git)
cd mshqc

# Compile and install the Python bindings
pip install -e .

(Note: The build system automatically detects the Conda environment and links against the optimized versions of libcint, TBLIS, and HDF5).
💻 Quick Start
Python

import mshqc
import numpy as np

# Set up your calculation parameters
# (Refer to the official documentation for detailed API usage)
print(f"MSHQC Version: {mshqc.__version__}")

🛠️ Development & CI/CD

This project utilizes GitHub Actions for continuous integration. Upon pushing to specified branches or tagging releases, the pipeline automatically:

    Compiles the C++ core with Universal HPC optimizations.

    Generates Python bindings via nanobind.

    Repairs Linux binaries using auditwheel to ensure cross-platform compatibility.

    Deploys the wheels to PyPI and a public facing repository.

🐛 Bug Reports & Contributions

If you encounter any issues, compile errors, or have feature requests, please report them on the Issue Tracker. Code contributions, bug fixes, and documentation improvements are highly appreciated.
📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

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.

mshqc-1.0.0.dev94-cp313-cp313-manylinux_2_39_x86_64.whl (70.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

mshqc-1.0.0.dev94-cp312-cp312-manylinux_2_39_x86_64.whl (70.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

mshqc-1.0.0.dev94-cp311-cp311-manylinux_2_39_x86_64.whl (70.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

mshqc-1.0.0.dev94-cp310-cp310-manylinux_2_39_x86_64.whl (70.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

File details

Details for the file mshqc-1.0.0.dev94-cp313-cp313-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mshqc-1.0.0.dev94-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 80e4a35faff43911b572fa244e4bc81a3d5b9495c9394244f239d3a48837c247
MD5 073d071748ce95ca69add7d1dc134257
BLAKE2b-256 607cbacc2fc68a22aae7d8f8111c9a0ea7964ba2b68cd31f14a05962caa957dd

See more details on using hashes here.

File details

Details for the file mshqc-1.0.0.dev94-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mshqc-1.0.0.dev94-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 6739dfc0c24cebc0f7805223ff036fe88fb0b46539a2fb003ae7ca76699538a8
MD5 f1aa0482aee80bf570a0fd76a5b25fc0
BLAKE2b-256 415f38a9cf1ae6c99f9542ca536aac8abc5f5ade66a1cfa538e7143b63134ac6

See more details on using hashes here.

File details

Details for the file mshqc-1.0.0.dev94-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mshqc-1.0.0.dev94-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 7bb792432f80d9496c5a4fbbe0971961f4908708e7154bdd7ea0604bfcb28846
MD5 e899de907d5645a9c88d2d46bca0582e
BLAKE2b-256 9fdb8bdfc53aefb08b28cd804ddb38757eb95ab8934d89f8ffa0fbe6346b0b66

See more details on using hashes here.

File details

Details for the file mshqc-1.0.0.dev94-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mshqc-1.0.0.dev94-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 ebc988fc837a65477b9f307a6fdef5c7605f24e9f0a76dc9317fc31af0ab3ade
MD5 fd5cc0ef92edde0f804008aa21a54b29
BLAKE2b-256 987c093b08e7aad45ecc4e5692b21f4b24bfdff0843c5af59c7c1fb2b552d1ad

See more details on using hashes here.

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