-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area/transformerskind/feature-requestDescribes new functionalityDescribes new functionalitytriage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked onA consensus emerged that this bug report, feature request, or other action should be worked on
Description
Is your feature request related to a use case or problem? Please describe.
There is currently no transformer that optimizes a circuit like
import cirq
qubits = cirq.LineQubit.range(2)
c = cirq.Circuit(cirq.Z(qubits[0]), cirq.CZ(qubits[0], qubits[1]),
cirq.measure(qubits[1]))Which should come out to be the identity
Describe the solution you'd like
import cirq
qubits = cirq.LineQubit.range(2)
c = cirq.Circuit(cirq.Z(qubits[0]), cirq.CZ(qubits[0], qubits[1]),
cirq.Z(qubits[1]), cirq.measure(qubits[0]),
cirq.measure(qubits[1]))
print(c)
print('-'* 100)
cirq.EjectZ().optimize_circuit(c)
print(c)outputs
0: ───Z───@───M───────
│
1: ───────@───Z───M───
--------------------------------------------------------------
0: ──────────M───────
1: ──────────────M───
[optional] Describe alternatives/workarounds you've considered
Looking the the circuit and seeing that the CZ gates doesn't do anything and manually removing them.
What is the urgency from your perspective for this issue? Is it blocking important work?
P3 - I'm not really blocked by it, it is an idea I'd like to discuss / suggestion based on principle
Metadata
Metadata
Assignees
Labels
area/transformerskind/feature-requestDescribes new functionalityDescribes new functionalitytriage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked onA consensus emerged that this bug report, feature request, or other action should be worked on
Type
Projects
Status
No status