Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nishitkshah
Copy link

…equal

Fix for the issue #6093 (equivalent measurements evaluate as unequal)

Copy link

codecov bot commented Nov 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.80%. Comparing base (d33b1a7) to head (487cbec).
Report is 105 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.


def right_trim_mask(invert_mask):
if invert_mask is None or len(invert_mask) == 0:
return invert_mask
Copy link
Collaborator

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):
Copy link
Collaborator

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, ...]:

@CirqBot CirqBot added the size: S 10< lines changed <50 label Feb 1, 2024
@github-actions github-actions bot added Stale and removed Stale labels Mar 3, 2024
@github-actions github-actions bot added Stale and removed Stale labels Apr 5, 2024
@github-actions github-actions bot added the Stale label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: S 10< lines changed <50 Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants