cirq.eject_phased_paulis
Transformer pass to push X, Y, PhasedX & (certain) PhasedXZ gates to the end of the circuit.
cirq.eject_phased_paulis(
circuit: 'cirq.AbstractCircuit',
*,
context: Optional['cirq.TransformerContext'] = None,
atol: float = 1e-08,
eject_parameterized: bool = False
) -> 'cirq.Circuit'
Used in the notebooks
As the gates get pushed, they may absorb Z gates, cancel against other
X, Y, or PhasedX gates with exponent=1, get merged into measurements (as
output bit flips), and cause phase kickback operations across CZs (which can
then be removed by the cirq.eject_z
transformation).
cirq.PhasedXZGate
with z_exponent=0
(i.e. equivalent to PhasedXPow) or with x_exponent=0
and axis_phase_exponent=0
(i.e. equivalent to ZPowGate) are also supported.
To eject PhasedXZGates
with arbitrary x/z/axis exponents, run
cirq.eject_z(cirq.eject_phased_paulis(cirq.eject_z(circuit)))
.
Args |
circuit
|
Input circuit to transform.
|
context
|
cirq.TransformerContext storing common configurable options for transformers.
|
atol
|
Maximum absolute error tolerance. The optimization is permitted to simply drop
negligible combinations gates with a threshold determined by this tolerance.
|
eject_parameterized
|
If True, the optimization will attempt to eject parameterized gates
as well. This may result in other gates parameterized by symbolic expressions.
|
Returns |
Copy of the transformed input circuit.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-27 UTC."],[],[]]