Based on Pauli propagation 1.
pauli_propagation
¶
Estimate single-qubit Pauli expectations with PauliPropagation.jl.
PauliPropagationBackend
¶
Bases: _UnsupportedCircuitMetrics
Propagate one Pauli observable per requested qubit [@rudolph2025pauli].
The program is translated to Qiskit and written as OpenQASM 2 for
PauliPropagation.OpenQASMInterface.readqasm. z_expectations and
x_expectations return the expectation of Z or X on |0...0> after
that circuit. Shot counts are not available.
Attributes:
-
name–"pauli_propagation". Stored on simulation result metadata. -
max_weight–Largest Pauli weight kept during propagation.
infkeeps every weight. -
min_abs_coeff–Smallest coefficient magnitude kept during propagation.
Source code in shadowsim/backends/pauli_propagation.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
__init__
¶
Record the PauliPropagation backend name and truncation settings.
Parameters:
-
max_weight(float, default:_MAX_WEIGHT) –Largest Pauli weight kept during propagation.
infkeeps every weight. -
min_abs_coeff(float, default:_MIN_ABS_COEFF) –Smallest coefficient magnitude kept during propagation.
Raises:
-
TypeError–A setting is not a real number.
-
ValueError–A setting is negative, or
min_abs_coeffis not finite.
Source code in shadowsim/backends/pauli_propagation.py
run_counts
¶
run_counts(
program: Program, *, shots: int, seed: int | None
) -> dict[str, int]
Reject a request for shot counts.
Parameters:
-
program(Program) –Unused. PauliPropagation does not sample a program.
-
shots(int) –Unused.
-
seed(int | None) –Unused.
Raises:
-
NotImplementedError–PauliPropagation does not support shot counts.
Source code in shadowsim/backends/pauli_propagation.py
z_expectations
¶
z_expectations(
program: Program,
qubits: Sequence[int],
*,
shots: int,
seed: int | None,
) -> list[float]
Return ⟨Z⟩ for each qubit in qubits.
Truncation uses max_weight and min_abs_coeff stored on this backend.
Parameters:
-
program(Program) –Program to propagate, without measurements or resets.
-
qubits(Sequence[int]) –0-based indexes in
program. The result follows this order. -
shots(int) –Unused. The value is not estimated from shots.
-
seed(int | None) –Unused.
Returns:
-
list[float]–One expectation per entry of
qubits.
Raises:
-
ValueError–An index is outside
program, the Julia package is missing, or the program cannot be read. -
ImportError–The
pauli_propagationextra is not installed.
Source code in shadowsim/backends/pauli_propagation.py
x_expectations
¶
x_expectations(
program: Program,
qubits: Sequence[int],
*,
shots: int,
seed: int | None,
) -> list[float]
Return ⟨X⟩ for each qubit in qubits.
Truncation uses max_weight and min_abs_coeff stored on this backend.
Parameters:
-
program(Program) –Program to propagate, without measurements or resets.
-
qubits(Sequence[int]) –0-based indexes in
program. The result follows this order. -
shots(int) –Unused. The value is not estimated from shots.
-
seed(int | None) –Unused.
Returns:
-
list[float]–One expectation per entry of
qubits.
Raises:
-
ValueError–An index is outside
program, the Julia package is missing, or the program cannot be read. -
ImportError–The
pauli_propagationextra is not installed.
Source code in shadowsim/backends/pauli_propagation.py
-
Manuel S. Rudolph, Tyson Jones, Yanting Teng, Armando Angrisani, and Zoë Holmes. Pauli propagation: a computational framework for simulating quantum systems. 2025. URL: https://arxiv.org/abs/2505.21606, arXiv:2505.21606. ↩