-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Treat classically controlled ops as non-Clifford in dynamical_decoupling
#7621
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
base: main
Are you sure you want to change the base?
Conversation
Classically controlled operations were passing `_is_clifford_op`, which led `dynamical_decoupling` to synthesize/invert through them and crash. Mark them non-Clifford for DD so they act as boundaries. Add regression test `test_classically_controlled_no_update_succeeds`. Fixes quantumlib#7617
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7621 +/- ##
==========================================
- Coverage 99.56% 99.37% -0.20%
==========================================
Files 1088 1078 -10
Lines 96083 96060 -23
==========================================
- Hits 95667 95456 -211
- Misses 416 604 +188 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
add_dynamical_decoupling( | ||
cirq.Circuit( | ||
cirq.Moment(measure(a, key="a")), cirq.Moment(I(a).with_classical_controls("a")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you validate the transformed circuit:
cirq.testing.assert_same_circuits(input_circuit, output_circuit)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! Clifford op indeed should be checked with the additional condition.
Classically controlled operations were passing
_is_clifford_op
, which leddynamical_decoupling
to synthesize/invert through them and crash. Mark them non-Clifford for DD so they act as boundaries. Add regression testtest_classically_controlled_no_update_succeeds
.Fixes #7617