Skip to content

Sync _has_stabilizer_effect_ implementations and use that for Clifford checks #3656

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

Merged
merged 6 commits into from
Feb 1, 2021

Conversation

smitsanghavi
Copy link
Collaborator

Brings has_stabilizer_effect protocol in line with actual implementations so that it can be used in all Clifford eligibility checks instead of a patchwork of custom conditions.

#2423

@smitsanghavi smitsanghavi requested review from cduck, vtomole and a team as code owners January 9, 2021 20:49
@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Jan 9, 2021
Copy link
Collaborator

@95-martin-orion 95-martin-orion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for cleaning this up. One point to confirm, but otherwise I think this is good to go.

@@ -217,6 +217,9 @@ def _from_json_dict_(cls, num_qubits, key, invert_mask, qid_shape=None, **kwargs
qid_shape=None if qid_shape is None else tuple(qid_shape),
)

def _has_stabilizer_effect_(self) -> Optional[bool]:
return True
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? I had a vague impression that measurements, being non-unitary, could not be stabilizers, but it's possible I'm thinking of a different property.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that would be the Clifford group. Stabilizer = Clifford+measurement
Reference: https://www.scottaaronson.com/papers/chp6.pdf Fig 1 and the paragraph below it. Was initially just following the StabilizerState paper but this one seems to have a more succinct definition.

@95-martin-orion 95-martin-orion added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Feb 1, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Feb 1, 2021
@CirqBot CirqBot merged commit 97e9a91 into quantumlib:master Feb 1, 2021
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants