Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

monoprop

because your operators deserve to propagate at escape velocity

Documentation Test monoprop codecov Track benchmarks

monoprop is a high-performance C++ library with Python bindings for Majorana and Pauli propagation — a backend for classically simulating and variationally optimising quantum circuits. Rather than storing the full quantum state, it expands an operator in the Majorana basis and propagates it through a circuit, truncating terms that contribute little. It scales to large systems by partitioning the operator across cores and across nodes with MPI.

Benchmarks

monoprop is compared with other open-source Pauli and Majorana propagation engines:

Runtime per step for Pauli and Majorana propagation benchmarks

Pauli propagation runtime versus lattice size Pauli propagation working memory versus lattice size

Head to our benchmarks page for more details.

Every commit on main also runs the internal benchmark suite, tracked over time with Bencher to catch performance regressions.

📖 Full documentation: https://docs.monoprop.algorithmiq.tech

Installation

pip install monoprop      # or: uv add monoprop

The PyPI wheels support MPI: install mpi4py with the mpi extra and pass a communicator to a propagator. They use the MPI library already on your machine, from the MPICH family (MPICH, Intel MPI, MVAPICH, Cray MPICH) or Open MPI, as provided by your cluster, package manager or own build:

pip install "monoprop[mpi]"

The parallelism docs list the minimum versions and how to get an MPI onto a machine that has none.

To build the C++ library and executables, build from source (see below).

For HPC systems without outbound network, an MPI-enabled container image is published to ghcr.io/algorithmiq/monoprop; see the HPC clusters documentation.

Quick example

Back-propagate a Majorana observable through a one-gate circuit:

from monoprop import MajoranaPropagator, ExpGate, Circuit, MajoranaOperator

# Observable m_0 m_1 m_2 m_4, evolved under one Majorana rotation exp(+i θ · M_γ),
# generated by M_γ = i*m_4 m_5.
observable = MajoranaOperator({(0, 1, 2, 4): 1.0}, num_modes=8)
gate = ExpGate(
    MajoranaOperator({(4, 5): 1j}, num_modes=8)
)  # Hermitian generator: weight-2 => imaginary coeff
circuit = Circuit(gates=[gate], system_size=8, parameters=[0.5])  # one angle per gate

mp = MajoranaPropagator.from_circuit(circuit, observable, cutoff=16)
print(mp.evolved_operator())  # the gate splits the monomial into two terms

Qubit (Pauli) operators are simulated with PauliPropagator. Here we back-propagate Z ⊗ Z through one exp(-i θ/2 · X_0) rotation:

from monoprop import PauliPropagator, ExpGate, Circuit, PauliOperator, Pauli

observable = PauliOperator(
    {"ZZ": 1.0}, num_qubits=2
)  # num_qubits lives on the observable
gate = ExpGate(PauliOperator({Pauli("X", 0): 1.0}, num_qubits=2))  # exp(+i θ · X_0)
circuit = Circuit(gates=[gate], system_size=2, parameters=[0.5])  # one angle per gate

mp = PauliPropagator.from_circuit(circuit, observable, cutoff=16)  # construct + evolve
print(mp.evolved_operator())  # the gate splits Z ⊗ Z into two terms

See the getting-started guide for fermionic operators and more.

Building from source

A from-source build gives you the editable Python bindings and the C++ build tree used for the library and unit tests. MPI is off by default in every build path; enable it explicitly.

Python bindings (via uv):

uv sync --all-extras -v
# with MPI:
monoprop_ENABLE_MPI=ON uv sync --all-extras -v

C++ unit-test build:

uv sync --all-extras -v
ctest --test-dir build/editable/Release

The platform packages are listed in tools/packages/ (apt.txt / brew.txt, plus the -mpi lists), which is what CI and the devcontainer install. just build [uv sync args…] performs the build CI performs — the same recipe GitHub Actions calls, so a lane can be reproduced locally.

Build options (MPI, sanitizers, C++ tests) can be set through environment variables or config-settings such as -C monoprop.mpi=ON. Full instructions — prerequisites, build options, and running the example executable — are in the building guide. In particular, from-source builds require hwloc and pkg-config so CMake can locate hwloc.

Running the tests

uv sync --all-groups --all-extras -v    # installs the workspace, incl. the bench tooling
just test                              # build, then the Python and C++ suites
just test-py / just test-cpp           # one leg, against whatever is installed
just test-mpi                          # Python + C++ tests under MPI

See the testing guide for the with/without-MPI details and the MPI configurations. CI has explicit MPI-enabled lanes on Linux x86-64, Linux ARM64, and macOS; installing the mpi extra alone does not enable the C++ MPI build. CI requires a registered MPI CTest variant, and each whole-suite MPI run has a 600-second deadlock timeout. Source builds select the MPI variant with monoprop_ENABLE_MPI=ON in the environment (or -C monoprop.mpi=ON). Standalone MPI-enabled C++ programs must initialize MPI before constructing a propagator and finalize it only after all propagators have been destroyed. The exported monoprop::monoprop CMake target is always serial; MPI consumers request the MPI component (find_package(monoprop CONFIG REQUIRED COMPONENTS MPI)) and link monoprop::monoprop_mpi. QA coverage merges separate serial and MPI-instrumented builds, including two-rank Python and C++ MPI runs, so both compatibility paths contribute to the reports. Run just code-coverage for the same combined report locally; it builds both variants and renders monoprop-coverage/index.html.

Repository layout

The repository is a uv workspace:

  • the root is monoprop itself (src/monoprop, cpp/);
  • packages/monoprop-bench-tools is the reusable benchmark harness — peak-memory measurement, the benchmarked model builders, and the result renderers — published separately so scripts and notebooks can depend on it without the repository;
  • packages/bench-third-party holds the cross-engine comparison scripts. It has CUDA-specific pins, so it is a standalone uv project with its own lockfile;
  • benches/ is monoprop's own benchmark suite, which uses the tooling above.

Development environment

The repository ships a DevContainer that installs every dependency (including the MPI toolchain and pre-commit hooks) and configures the editor. To use it you need:

  1. A working Docker installation (Docker Desktop on macOS/Windows, Docker Engine on Linux).
  2. Visual Studio Code with the Dev Containers extension.

Clone the repository and open the folder in VS Code; it will build the container and run the setup automatically (this takes a few minutes the first time):

git clone https://github.com/Algorithmiq/monoprop.git

Without a DevContainer, install the prerequisites from the building guide by hand.

Nix

The repository is a Nix flake, so on Nix or NixOS none of the prerequisites have to be installed by hand:

nix develop            # dev shell: C++ toolchain, hwloc, MPI, uv, just, node
nix build .#monoprop   # build the package (`.#monoprop-mpi` for the MPI build)
nix build .#monoprop-py313  # pick the interpreter: py312, py313, py314 (default)
nix run                # Python interpreter with monoprop importable

Inside nix develop the usual uv sync and just workflows apply unchanged. Downstream flakes can follow their own nixpkgs, import monoprop.overlays.default, and consume ps.monoprop or ps.monoprop-mpi from any Python package set; see the building guide. The Nix entrypoints are distributed from the repository flake, not in the PyPI source distribution. Nix sandbox builds read the latest stable release from the root VERSION file; setuptools-scm remains authoritative for normal Git-based Python builds.

Contributing

Please read CONTRIBUTING.md before opening a pull request. All contributions require accepting the Individual CLA through CLA Assistant. If you are contributing on behalf of your employer, contact cla@algorithmiq.fi to arrange a Corporate CLA.

Documentation

The documentation is built with Fumadocs and hosted at https://docs.monoprop.algorithmiq.tech. The Python API reference is generated from docstrings (griffe) and the tutorials are executed from the notebooks in docs/notebooks/. Building the documentation locally requires npm, the Node.js package manager. Once that is available, you can run:

just build-docs   # output: docs/out/
just serve-docs   # live-reloading dev server
just check-doc-links  # checks exported HTML links (including external URLs)

The link checker's options live in .lychee.postbuild.toml, so the recipe and the docs workflow (which runs lychee through its own action) check the same thing.

Keeping documentation up to date

Any PR that changes behavior, public APIs, build/test commands, or repository paths must update the relevant docs in the same change:

  1. AGENTS.md for agent/developer workflow instructions.
  2. README.md for top-level usage and contributor guidance.
  3. docs/ pages for user-facing and in-depth technical documentation.

Citation

If you use monoprop in your research, please cite:

@ARTICLE{Miller2025-aj,
  title         = "{Simulation of Fermionic circuits using Majorana Propagation}",
  author        = "Miller, Aaron and Holmes, Zoë and Salehi, Özlem and
                   Chakraborty, Rahul and Nykänen, Anton and Zimborás, Zoltán
                   and Glos, Adam and García-Pérez, Guillermo",
  journal       = "arXiv [quant-ph]",
  year          =  2025,
  eprint        = "2503.18939",
  archivePrefix = "arXiv",
  primaryClass  = "quant-ph",
  url           = "https://arxiv.org/abs/2503.18939"
}

License

monoprop is released under the Apache License 2.0.

Metadata

Release files for monoprop 0.10.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for monoprop 0.10.0rc1
File Size Uploaded Provenance Actions
monoprop-0.10.0rc1.tar.gz 2.3 MB With provenance Details for monoprop-0.10.0rc1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for monoprop 0.10.0rc1
File Interpreter ABI Platform Actions
monoprop-0.10.0rc1-cp311-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for monoprop-0.10.0rc1-cp311-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
monoprop-0.10.0rc1-cp311-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details for monoprop-0.10.0rc1-cp311-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
monoprop-0.10.0rc1-cp311-abi3-macosx_15_0_arm64.whl CPython 3.11 abi3 macOS 15.0+ ARM64 Details for monoprop-0.10.0rc1-cp311-abi3-macosx_15_0_arm64.whl

Total release size: 39.9 MB

Release files / monoprop-0.10.0rc1.tar.gz

Download URL monoprop-0.10.0rc1.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
45a55d472fb207f55461c519aa2379d5ff2c28f8c7a11979d361ba2a791d1136
BLAKE2b-256 checksum
How to use checksums
2acebc398a0a75e51c3e74bc1c80d1c4ea79e03c832c24145690c753e0268c88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / monoprop-0.10.0rc1-cp311-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL monoprop-0.10.0rc1-cp311-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 13.0 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
dbc7b6c24fe1002a01ee991dbb98114b0de86ac831a29241249207ca84f0ba4a
BLAKE2b-256 checksum
How to use checksums
1015aa24c1ebf5a3640b604b93390489e4d1e52f4e0b047cee7ff20651e80aa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / monoprop-0.10.0rc1-cp311-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL monoprop-0.10.0rc1-cp311-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 12.2 MB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
e7133a20210372bf5361ee2aaa4776104e9d8e54007a8c509e6735592759f9fe
BLAKE2b-256 checksum
How to use checksums
106172e3447d37452a5bd0249b1431aec93bc8c38bd96cb819bc5aec8c5a857d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / monoprop-0.10.0rc1-cp311-abi3-macosx_15_0_arm64.whl

Download URL monoprop-0.10.0rc1-cp311-abi3-macosx_15_0_arm64.whl
Size 12.2 MB
Tags CPython 3.11 abi3 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
f66c462609ed481574707097b08086c06114b1a8820ddec53c7b070738a40fe6
BLAKE2b-256 checksum
How to use checksums
d402eef1d143dd46830cd98c84af8c021254f260e9f4812e9a4e16f5a1191c28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for monoprop 0.10.0rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for monoprop-0.10.0rc1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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