Closed NoureldinYosri closed 7 months ago
Thanks, Nour!
the change happens in https://github.com/quantumlib/Cirq/blob/2ef19094f2225b2f2707d169bafe75ecdcdc0537/cirq-core/cirq/transformers/eject_phased_paulis.py#L212
I don't think this is a bug. the function $f(t) = {CZ}^t$ is periodic with period 2. so if we restrict $t$ to $-1 \leq t \leq 1$ then $f(t) = \overline{f(-t)}$.
Even if I restrict $t$ to that range, deciding between 1 and -1 will be ambiguous. and dropping either end (-1 or 1) is not an option
offline update from @eliottrosenberg, it's a bug because in the original example https://github.com/quantumlib/Cirq/issues/6422#issuecomment-1913798978 partial CZs aren't allowed
Description of the issue
cleanup_operations
replaced CZ with CZ-1 where that was unneccassry. in this case the result is still correct since CZ==CZ-1. but it's worth invisigating whether this a side effec of CZ==CZ**-1 or a symptom of a bug.Digging deeper into the method the change happens when it calls
cirq.transformers.eject_phased_paulis
How to reproduce the issue
The input (a CNOT written in CZ gateset)
result
related to https://github.com/quantumlib/Cirq/issues/6422