-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix mutable_pauli_string.inplace_after() and inplace_before() #7507
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7507 +/- ##
==========================================
- Coverage 98.68% 98.63% -0.06%
==========================================
Files 1091 1091
Lines 96945 96938 -7
==========================================
- Hits 95671 95612 -59
- Misses 1274 1326 +52 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hey Nour @NoureldinYosri , could you help take a look at this PR? This is the last pr in fixing #6946. |
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.
overall looks good ... but you can use a simpler logic to construct the conjugated
object
flattened_ops = list(op_tree.flatten_to_ops(ops)) | ||
|
||
for op in flattened_ops[::-1]: | ||
conjugated: cirq.DensePauliString = dense_pauli_string.DensePauliString( |
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.
maybe conjugates = self.dense(self.qubits) * dense_pauli_string.DensePauliString('I'*len(self.qubits))
should do the trick? ... no need for the logic below
Similar to the fix for PauliString.after() #7065, this is the fix for MutablePauliString.
Also deleted the culprit _decompose_into_cliffords helper function that was used by PauliString.after() and MutablePauliString.inplace_after().
Issue: #6946.