-
Notifications
You must be signed in to change notification settings - Fork 62
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
New backend specialised for Hamming-weight-preserving circuits #1565
base: master
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
@BrunoLiegiBastonLiegi could you help me out with setting the correct engine from the name of the platform? I didn't understand what you did for the Clifford backend. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
This was closed by mistake, so I'm reopening it. |
for more information, see https://pre-commit.ci
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1565 +/- ##
==========================================
- Coverage 99.58% 97.19% -2.39%
==========================================
Files 76 78 +2
Lines 11322 11625 +303
==========================================
+ Hits 11275 11299 +24
- Misses 47 326 +279
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
and not gate.__class__.__name__ == "M" | ||
and not gate.__class__.__name__ == "Unitary" |
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.
and not gate.__class__.__name__ == "M" | |
and not gate.__class__.__name__ == "Unitary" | |
and not isinstance(gate, (gates.M, gates.Unitary)) |
@@ -74,6 +74,11 @@ def clifford(self): | |||
"""Return boolean value representing if a Gate is Clifford or not.""" | |||
return False | |||
|
|||
@property | |||
def hamming_weight(self): | |||
"""Return boolean value representing if a Gate is Hamming weight preserving or not.""" |
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.
"""Return boolean value representing if a Gate is Hamming weight preserving or not.""" | |
"""Return boolean value representing if a Gate is Hamming-weight-preserving or not.""" |
@@ -2545,6 +2698,10 @@ def __init__( | |||
self.init_args = [qubits_in, qubits_out] | |||
self.init_kwargs = {"theta": theta, "phi": phi, "trainable": trainable} | |||
|
|||
@property | |||
def hamming_weight(self): | |||
return len(self.init_args[0]) == len(self.init_args[1]) |
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.
Nice
Checklist: