Pauli Propagation of Parametrized Circuits
Try it without installation via Binder:
Overview
Convert the expectation values of a circuit’s observables into explicit functions of the circuit’s parameters.
Usage
- First import all the necessary libraries:
import pennylane as qml # To define the circuit
from pprop.propagator import Propagator # For Pauli Propagation
- Define the circuit as a function of the parameters
# Function of parameters
def ansatz(params : list[float]):
qml.RX(params[0], wires=0)
qml.RX(params[1], wires=1)
qml.RY(params[2], wires=0)
qml.RY(params[3], wires=1)
qml.Hadamard(wires = 2)
qml.Barrier()
qml.CNOT(wires = [0, 1])
qml.CNOT(wires = [1, 2])
qml.Barrier()
qml.RY(params[4], wires=0)
qml.RY(params[5], wires=1)
qml.RY(params[6], wires=2)
return [qml.expval(qml.PauliZ(qubit)) for qubit in range(1)] + [qml.expval(qml.PauliX(0)@qml.PauliX(1)@qml.PauliX(2))] + [qml.expval(qml.PauliY(2))] + [qml.expval(-qml.PauliX(0)@qml.PauliX(1)@qml.PauliX(2) + 13*qml.PauliZ(2))]
- Define the propagator
prop = Propagator(
ansatz,
k1 = None, # Cutoff on the Pauli Weight
k2 = None, # Cutoff on the frequencies
)
>>> prop
Propagator
Number of qubits : 3
Trainable parameters : 7
>>> prop.show()
0: ──RX(0.00)──RY(2.00)──||─╭●─────||──RY(4.00)─┤ <Z> ╭<X@X@X> ╭<𝓗(-1.00,13.00)>
1: ──RX(1.00)──RY(3.00)──||─╰X─╭●──||──RY(5.00)─┤ ├<X@X@X> ├<𝓗(-1.00,13.00)>
2: ──H───────────────────||────╰X──||──RY(6.00)─┤ ╰<X@X@X> <Y> ╰<𝓗(-1.00,13.00)>
- Propagate the observables (this runs in the Rust extension
pprop_rs):
prop.propagate()
- Get the output expectation values by calling the class and feeding the circuit's parameters
random_params = qml.numpy.arange(prop.num_params)
prop_output = prop(random_params)
[ 0.32448205 -0.52806187 0. 4.1604633 ]
- You can inspect the explicit functions using
.expression()
>>> prop.expression(0)
-1.0*sin(θ2)*sin(θ3)*sin(θ4)*cos(θ0)*cos(θ1) + 1.0*cos(θ0)*cos(θ2)*cos(θ4)
Installation
pip install pauli-propagator
This pulls in the Rust extension pprop_rs as a prebuilt wheel (Linux x86_64/aarch64,
macOS arm64, Windows x64; Python 3.12+). On other platforms pip builds it from
source, which needs a Rust toolchain (rustup).
Development install
pip install maturin
cd native/pprop_rs
maturin develop --release
cd ../..
pip install -e .
maturin develop builds pprop_rs and installs it straight into the active
virtual environment. Re-run it after pulling changes to native/pprop_rs.
Examples
For detailed examples, please refer to the notebooks directory, which
contains Jupyter notebooks that demonstrate various use cases and tests of
the propagator.
Citation
If you use this software in your research or publications, please cite the following:
@software{monaco_2026_23020043,
author = {Monaco, Saverio and
Lipponen, Aapo},
doi = {10.5281/zenodo.23021244},
month = sep,
publisher = {Zenodo},
swhid = {swh:1:dir:ce152d847302ce6b14f1197f106986050d09c0f4
;origin=https://doi.org/10.5281/zenodo.16028009;vi
sit=swh:1:snp:a9b8558798b8b9e8375e83e7aca935976731
18b2;anchor=swh:1:rel:6f6cac02e75daff2e374b752bb49
f157960d3915;path=SaverioMonaco-Pauli-
Propagator-4bb7e0d
},
title = {Pauli-Propagator},
url = {https://doi.org/10.5281/zenodo.23021244},
version = {v3.1.0},
year = 2026
}
Metadata
Release files for pauli-propagator 3.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pauli_propagator-3.3.0.tar.gz | 150.7 kB | With provenance | Details for pauli_propagator-3.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pauli_propagator-3.3.0-py3-none-any.whl | Python 3 | none | any | Details for pauli_propagator-3.3.0-py3-none-any.whl |
Total release size: 192.2 kB
Release files / pauli_propagator-3.3.0.tar.gz
| Download URL | pauli_propagator-3.3.0.tar.gz |
|---|---|
| Size | 150.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d781a11c6140780e8beeeb72ec010004d30c98adc2380c80026157dc4500b5de
|
|
BLAKE2b-256 checksum How to use checksums |
f761e9f4a3d104ddfacc1458c0de973db9291c23fc60912b11e2ca39e6a752c5
|
| 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 Oct 22, 2026.
Transparency logRelease files / pauli_propagator-3.3.0-py3-none-any.whl
| Download URL | pauli_propagator-3.3.0-py3-none-any.whl |
|---|---|
| Size | 41.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f828d83d59bbe2a7f7b6667abf0042132981299bf498a6d9726dcf1933c1660b
|
|
BLAKE2b-256 checksum How to use checksums |
c01d7e90d9f1dda7abffa9219b2c69f5d4c0f64baa546ad9f3a4ff5d67f87746
|
| 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 Oct 22, 2026.
Transparency logSecurity for pauli-propagator 3.3.0
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 2 files in this release have been uploaded with provenance metadata.
Attestation for pauli_propagator-3.3.0.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 Oct 22, 2026.
Transparency logA 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.