Metadata-Version: 2.4
Name: propaq
Version: 0.1.8
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Typing :: Typed
Requires-Dist: numpy>=1.24
Requires-Dist: qiskit~=2.4.1
Requires-Dist: scipy>=1.10
Requires-Dist: tqdm
Requires-Dist: propaq[ffsim] ; extra == 'benchmarks'
Requires-Dist: pyscf>=2.6 ; extra == 'benchmarks'
Requires-Dist: cirq~=1.5.0 ; extra == 'cirq'
Requires-Dist: pytest~=8.0.2 ; extra == 'dev'
Requires-Dist: ruff~=0.9.4 ; extra == 'dev'
Requires-Dist: mypy~=1.14.1 ; extra == 'dev'
Requires-Dist: maturin>=1.7,<2 ; extra == 'dev'
Requires-Dist: coverage~=7.14.0 ; extra == 'dev'
Requires-Dist: pre-commit~=4.0 ; extra == 'dev'
Requires-Dist: mkdocs>=1.6 ; extra == 'docs'
Requires-Dist: mkdocs-material>=9.5 ; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.26 ; extra == 'docs'
Requires-Dist: mkdocs-jupyter>=0.25 ; extra == 'docs'
Requires-Dist: mkdocs-autorefs>=1.2 ; extra == 'docs'
Requires-Dist: pymdown-extensions>=10.9 ; extra == 'docs'
Requires-Dist: ipywidgets>=8.1 ; extra == 'docs'
Requires-Dist: propaq[cirq,ffsim,hybrid] ; extra == 'examples'
Requires-Dist: matplotlib>=3.7 ; extra == 'examples'
Requires-Dist: qiskit-nature>=0.7 ; extra == 'examples'
Requires-Dist: jupyter>=1.0 ; extra == 'examples'
Requires-Dist: ipywidgets>=8.1 ; extra == 'examples'
Requires-Dist: ffsim~=0.0.80 ; extra == 'ffsim'
Requires-Dist: quimb>=1.6,<1.15 ; extra == 'hybrid'
Requires-Dist: openfermion>=1.6 ; extra == 'openfermion'
Provides-Extra: benchmarks
Provides-Extra: cirq
Provides-Extra: dev
Provides-Extra: docs
Provides-Extra: examples
Provides-Extra: ffsim
Provides-Extra: hybrid
Provides-Extra: openfermion
License-File: LICENSE
License-File: NOTICE
Summary: Fast Majorana and Pauli propagation for quantum circuit simulation
Keywords: quantum computing,quantum simulation,fermionic circuits,Majorana propagation,Pauli propagation
Author-email: Hrishikesh Belagali <belagal1@msu.edu>
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Bug Tracker, https://github.com/hkbelagali/propaq/issues
Project-URL: Documentation, https://hkbelagali.github.io/propaq
Project-URL: Homepage, https://hkbelagali.github.io/propaq
Project-URL: Repository, https://github.com/hkbelagali/propaq

# propaq
[![Docs](https://img.shields.io/badge/docs-hkbelagali.github.io/propaq-blue)](https://hkbelagali.github.io/propaq)
[![CI](https://github.com/hkbelagali/propaq/actions/workflows/workflow.yml/badge.svg)](https://github.com/hkbelagali/propaq/actions/workflows/workflow.yml)
[![PyPI](https://img.shields.io/pypi/v/propaq)](https://pypi.org/project/propaq/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![arXiv](https://img.shields.io/badge/arXiv-2609.07730-b31b1b.svg)](https://arxiv.org/abs/2609.07730)

Fast Heisenberg-picture propagation for quantum circuit simulation, with a parallel Rust backend!

propaq features the following: 
- Hybrid Schrodinger-Heisenberg simulation for quantum circuits, with functionality for both Pauli and Majorana propagation.
- Support for both Pauli and Majorana propagation, with integration with Qiskit and Cirq.
- Support for custom, composable noise models and truncation policies, written in C, Rust, AOT Julia, or Python via a plugin ABI.
- Support to define fast paths for custom unitary gates. 
- Logging and profiling capabilities for propagation runs, as well as lazy I/O operations for saving and loading results.
- Extrapolation methods for estimating expectation values in the limit of zero noise and/or zero truncation error.
- Surrogate/Symbolic propagation for computing expectation values of parameterized circuits, i.e. for variational quantum algorithms.

propaq implements the algorithms described in: 

>  M. S. Rudolph, T. Jones, Y. Teng, A. Angrisani, and Z. Holmes, "Pauli Propagation: A Computational Framework for Simulating Quantum Systems," May 27, 2025, arXiv: arXiv:2505.21606. doi: 10.48550/arXiv.2505.21606.

>  A. Miller et al., "Simulation of Fermionic circuits using Majorana Propagation," Dec. 16, 2025, arXiv: arXiv:2503.18939. doi: 10.48550/arXiv.2503.18939.

Propaq adopts several low-level design elements critical for performance from [monoprop](https://github.com/Algorithmiq/monoprop) ([Citation](https://github.com/Algorithmiq/monoprop/blob/main/CITATION.cff) and A. Miller et al., In preparation). These include BasisString, OperatorIndex, InvertedIndex, partitioning, thread assignment, and pinning, and are marked in relevant source files.

## Installation

```bash
pip install propaq
```

Requires Python 3.10+ and a pre-built wheel for your platform (Linux x86-64, macOS, Windows).

The core install pulls in only `numpy`, `scipy`, `qiskit` and `tqdm`. Framework
integrations are opt-in extras:

```bash
pip install "propaq[cirq,ffsim,openfermion,hybrid]"
```

| Extra | Enables |
| --- | --- |
| `cirq` | Building circuits from Cirq, and `register_cirq_gate` |
| `ffsim` | The `from_ffsim_*` circuit constructors and `MajoranaTermSum.from_ffsim` |
| `openfermion` | Converting OpenFermion fermionic operators into propaq observables |
| `hybrid` | `propaq.hybrid`: hybrid Schrodinger-Heisenberg expectation values against a `quimb` MPS |

For development, clone the repo and install with: 
```bash
pip install -e .[dev]   
```
which will install the Rust toolchain and build the Rust backend from source via `maturin`. You can also build the Rust backend manually with 
`maturin develop` or `maturin build` and then install the resulting wheel with `pip install target/wheels/propaq-*.whl`. 
We also recommend installing pre-commit hooks via 
```bash
pre-commit install
```

## Quick start

```python
import numpy as np
from qiskit import QuantumCircuit
from qiskit.circuit.library import XXPlusYYGate, RZGate, SwapGate
from qiskit.quantum_info import SparsePauliOp

from propaq.circuits import MajoranaCircuit
from propaq.datatypes import MajoranaTermSum
from propaq.noise import UniformNoiseModel
from propaq.propagators import MajoranaPropagator
from propaq.truncation import TruncationPolicy

# Build a random 4-qubit circuit
qc = QuantumCircuit(4)
qc.append(XXPlusYYGate(np.pi / 4, 0.0), [0, 1])
qc.append(RZGate(np.pi / 3), [2])
qc.append(SwapGate(), [2, 3])

# Observable: sum of single-site X operators
observable = SparsePauliOp.from_list([
    ("XIII", 1.0), ("IXII", 1.0), ("IIXI", 1.0), ("IIIX", 1.0)
])

# Convert to propaq types
mc = MajoranaCircuit.from_qiskit(qc, n_modes=2 * qc.num_qubits)
mts = MajoranaTermSum.from_sparse_pauli_op(observable)

# Build propagator with noise and truncation
prop = MajoranaPropagator(
    noise=UniformNoiseModel(damping=0.001),
    truncation=TruncationPolicy(weight_cutoff=10, coeff_cutoff=1e-5),
)

# Back-propagate and evaluate
result = prop.expectation_value(mts, mc, initial_state=0)
print("Expectation value:", result.expectation_value)
```

For a more detailed introduction, see the [documentation](https://hkbelagali.github.io/propaq):

- [Getting started](https://hkbelagali.github.io/propaq/getting-started/) - installation, quickstart, core concepts
- [Guides](https://hkbelagali.github.io/propaq/guides/) - truncation, noise, surrogate propagation, extrapolation, streaming, plugins
- [Examples](https://hkbelagali.github.io/propaq/examples/) - the notebooks under [`examples/`](examples), rendered
- [API reference](https://hkbelagali.github.io/propaq/reference/)

### Building the docs locally

```bash
pip install -e ".[docs]"
mkdocs serve
```

## Citation

If you use propaq in your research, please cite:

```bibtex
@misc{Propaq,
      title={Propaq: A Python package for Heisenberg Propagation}, 
      author={Hrishikesh Belagali and Ryan LaRose},
      year={2026},
      eprint={2609.07730},
      archivePrefix={arXiv},
      primaryClass={quant-ph},
      url={https://arxiv.org/abs/2609.07730}, 
}
```

