-
Notifications
You must be signed in to change notification settings - Fork 1.2k
(1/2) Combine Pauli measurements and postselection #7746
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
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.
This PR doesn't actually apply the postselection, correct? If so, we should raise a NotImplementedError if the user tries to use postselection symmetries.
Done! |
eliottrosenberg
left a comment
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.
One small nit, otherwise LGTM. Thanks!
|
|
||
| circuit: circuits.FrozenCircuit | ||
| pauli_strings: list[list[ops.PauliString]] | ||
| postselection_symmetries: list[tuple[ops.PauliString | ops.PauliSum, int]] |
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.
Can we have this default to an empty list? That way users don't need to enter anything for postselection_symmetries if they don't want to postselect.
NoureldinYosri
left a comment
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%nits
| """ | ||
|
|
||
| circuit: circuits.FrozenCircuit | ||
| pauli_strings: list[list[ops.PauliString]] |
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.
since this is a frozen class, use tuple instead
| all_qubits: list[ops.Qid] | frozenset[ops.Qid], | ||
| ) -> bool: | ||
| """Checks if a Pauli sum and a Pauli string are Qubit-Wise Commuting.""" | ||
| for pauli_sum_term in pauli_sum: |
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.
reuse the _are_two_pauli_strings_qubit_wise_commuting method
I split this #7492 giant PR into smaller pieces for easier review.
This PR: