pprop.propagator.evolve module¶
This module handles the core evolution of Pauli words through a list of gates via the Heisenberg picture.
- pprop.propagator.evolve.heisenberg(gates, paulidict, k1, k2, opt=False, debug=False)[source]¶
Evolve a
PauliDictbackwards through a list of gates (Heisenberg picture).Each gate is applied in reverse order so that the observable is propagated from the measurement end of the circuit back to the input. After all gates have been applied,
to_expectation()extracts the symbolic expectation value expression as aCoeffTermslist.- Parameters:
gates (list[pprop.gates.Gate]) – Ordered list of gates as they appear in the circuit (will be iterated in reverse).
paulidict (PauliDict) – Initial observable represented as a mapping of
PauliOp -> CoeffTerms.k1 (int or None) – Pauli weight cutoff. Evolved terms whose Pauli weight exceeds
k1are discarded.Nonedisables this truncation.k2 (int or None) – Frequency cutoff. Evolved terms whose total trigonometric frequency exceeds
k2are discarded.Nonedisables this truncation.opt (bool, optional) – If
True, use optimized pruning strategy. Defaults toFalse.debug (bool, optional) – If
True, print the gate, pre-evolution, and post-evolution state at each step. Defaults toFalse.
- Returns:
paulidict (PauliDict) – The fully evolved observable after all gates have been applied.
expectation (CoeffTerms) – Flat list of
CoeffTermtuples encoding the symbolic expectation value \(\langle 0 | U^\dagger O U | 0 \rangle\).
- Return type:
Tuple[PauliDict, list[tuple[float, list[int], list[int]]]]
- pprop.propagator.evolve.to_expectation(paulidict)[source]¶
Extract the expectation value expression from a propagated
PauliDict.In the \(|0\rangle^{\otimes n}\) computational basis state, only Pauli words composed entirely of \(Z\) and \(I\) operators have non-zero expectation:
\[\langle 0 | I | 0 \rangle = 1, \quad \langle 0 | Z | 0 \rangle = 1, \quad \langle 0 | X | 0 \rangle = 0, \quad \langle 0 | Y | 0 \rangle = 0\]This function iterates over all Pauli words in
paulidict, keeps only those that satisfy the zero-bracket condition (i.e. only \(Z\)/\(I\) on every qubit), and concatenates theirCoeffTermsinto a single flat list representing the full expectation value expression.- Parameters:
paulidict (PauliDict) – Mapping of
PauliOp -> CoeffTermsafter Heisenberg evolution.- Returns:
Flat list of
CoeffTermtuples whose sum gives the expectation value \(\langle 0 | O | 0 \rangle\).- Return type:
CoeffTerms