Incorrect Behavior of Transformer eject_phased_paulis
with Mid-Circuit Measurements
#6507
Labels
kind/bug-report
Something doesn't seem to work.
triage/accepted
there is consensus amongst maintainers that this is a real bug or a reasonable feature to add
Description of the issue
The
eject_phased_paulis
transformer exhibits incorrect behavior when interacting with X or Y gates preceding measurements. Specifically, the transformer erroneously merges these gates into measurements, as demonstrated by the following transformation:Original circuit:
Transformed circuit:
This issue notably affects the measurement outcome of
c_1
, potentially altering the execution results of circuits incorporating mid-circuit measurements. A temporary solution might involve verifying the position of the measurement within the circuit, ensuring it only merges operations when measurements are at the end of the circuit.How to reproduce the issue
Execution result:
Cirq version
1.3.0
The text was updated successfully, but these errors were encountered: