-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Equivalent Measurements with equivalent invert masks should evaluate … #6339
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6339 +/- ##
==========================================
- Coverage 97.81% 97.80% -0.01%
==========================================
Files 1111 1111
Lines 97054 97068 +14
==========================================
+ Hits 94931 94937 +6
- Misses 2123 2131 +8 ☔ View full report in Codecov by Sentry. |
|
||
def right_trim_mask(invert_mask): | ||
if invert_mask is None or len(invert_mask) == 0: | ||
return invert_mask |
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 assumes that invert_mask
can be None
which it's not
invert_mask: Tuple[bool, ...] = (), |
@@ -91,6 +91,19 @@ def __init__( | |||
self._invert_mask = invert_mask or () | |||
if self.invert_mask is not None and len(self.invert_mask) > self.num_qubits(): | |||
raise ValueError('len(invert_mask) > num_qubits') | |||
|
|||
def right_trim_mask(invert_mask): |
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.
add type hint
def right_trim_mask(invert_mask: Tuple[bool, ...]) -> Tuple[bool, ...]:
…equal
Fix for the issue #6093 (equivalent measurements evaluate as unequal)