Skip to main content

Pauli Propagation of Parametrized Circuits

DOI

Try it without installation via Binder: 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
    k2_mode = "frequency", # or "sine": k2 counts only sin factors (exact at theta = 0)
)
>>> 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).

Running on IBM hardware (optional)

pprop.qasm exports a trained circuit to OpenQASM 3 with no extra dependencies. To load it into Qiskit (pprop.qasm.to_qiskit) and run it on IBM Quantum devices, install the qiskit extra, which adds qiskit, qiskit-qasm3-import and qiskit-ibm-runtime:

pip install "pauli-propagator[qiskit]"

For a development install, use pip install -e ".[qiskit]" in the last step below.

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.4.0

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

Source distribution (sdist)

Source distribution for pauli-propagator 3.4.0
File Size Uploaded Provenance Actions
pauli_propagator-3.4.0.tar.gz 154.5 kB With provenance Details for pauli_propagator-3.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pauli-propagator 3.4.0
File Interpreter ABI Platform Actions
pauli_propagator-3.4.0-py3-none-any.whl Python 3 none any Details for pauli_propagator-3.4.0-py3-none-any.whl

Total release size: 198.6 kB

Release files / pauli_propagator-3.4.0.tar.gz

Download URL pauli_propagator-3.4.0.tar.gz
Size 154.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7d1145dd1582b770e74b8c924b3ee385d8f112880dee7ff5b22b2ade4e87d9d1
BLAKE2b-256 checksum
How to use checksums
758efa7a1225af330c963584bbc7e8c3ea0e92fddd6a0ea331eb8794f7bc0d10
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 26, 2026.

Transparency log

Release files / pauli_propagator-3.4.0-py3-none-any.whl

Download URL pauli_propagator-3.4.0-py3-none-any.whl
Size 44.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c896874f33017ae505232c052c0ce27ffddabcbf5133e1e9f3ecf2b0a9c72eb
BLAKE2b-256 checksum
How to use checksums
798abd0626bb893bac47e8ae2af2827e73feb3924302b041c2763c17abc17a08
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 26, 2026.

Transparency log

Security for pauli-propagator 3.4.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.

Select from 2 files

Attestation for pauli_propagator-3.4.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 26, 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.

Release history Release notifications | RSS feed

This release

3.4.0 This release

2 release files Full provenance

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