Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EjectFullW changing circuit function #684

Closed
Strilanc opened this issue Jul 16, 2018 · 0 comments
Closed

Fix EjectFullW changing circuit function #684

Strilanc opened this issue Jul 16, 2018 · 0 comments

Comments

@Strilanc
Copy link
Contributor

import cirq
c = cirq.Circuit(device=cirq.google.Foxtail)
c.append(cirq.CCZ(cirq.GridQubit(0, 0), cirq.GridQubit(0, 1), cirq.GridQubit(1, 1)))
c.device = cirq.UnconstrainedDevice
cirq.google.MergeInteractions().optimize_circuit(c)
cirq.google.MergeRotations().optimize_circuit(c)
cirq.google.EjectFullW().optimize_circuit(c)
d = cirq.allclose_up_to_global_phase(c.to_unitary_matrix(), cirq.CCZ.matrix(), atol=1e-4)
# d is False instead of True
Strilanc added a commit that referenced this issue Jul 17, 2018
- Slipped by because of a silent merge conflict overwriting updated methods with old ones
- The old methods were calling the new "canonicalize_up_to_measurement_phase" with the wrong number of arguments, triggering a type error, triggering a path expecting a type error for a *different reason* (i.e. non-unitary operations in the circuit)
- Removed the non-unitary fallback path and renamed the method to make it clear only measurement-implies-terminal circuits were expected
- Simplified the W-over-partial-W derivation
- Fixed false-positive assertions that were now correctly failing
- Added a test that fails for the old behavior but not for the new behavior

Fixes #684
Strilanc added a commit that referenced this issue Jul 17, 2018
- Slipped by because of a silent merge conflict overwriting updated methods with old ones
- The old methods were calling the new "canonicalize_up_to_measurement_phase" with the wrong number of arguments, triggering a type error, triggering a path expecting a type error for a *different reason* (i.e. non-unitary operations in the circuit)
- Removed the non-unitary fallback path and renamed the method to make it clear only measurement-implies-terminal circuits were expected
- Simplified the W-over-partial-W derivation
- Fixed false-positive assertions that were now correctly failing
- Added a test that fails for the old behavior but not for the new behavior

Fixes #684
Strilanc added a commit that referenced this issue Jul 17, 2018
#691)

- Slipped by because of a silent merge conflict overwriting updated methods with old ones
- The old methods were calling the new "canonicalize_up_to_measurement_phase" with the wrong number of arguments, triggering a type error, triggering a path expecting a type error for a *different reason* (i.e. non-unitary operations in the circuit)
- Removed the non-unitary fallback path and renamed the method to make it clear only measurement-implies-terminal circuits were expected
- Simplified the W-over-partial-W derivation
- Fixed false-positive assertions that were now correctly failing
- Added a test that fails for the old behavior but not for the new behavior

Fixes #684
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant