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

Tuple unpacking bug fix in cut finder. #591

Merged
merged 2 commits into from
May 15, 2024
Merged

Conversation

ibrahim-shehzad
Copy link
Collaborator

There was a tuple unpacking error that arose when theCutBothWires action was invoked as part of the rest of the cut finding workflow. This bug was not noticed at first because the although existing tests called that line, its output was not used in any part of the rest of the workflow. This bug was noticed in the work leading up to #586 which will also add more comprehensive tests for the CutBothWires action. The goal of this PR is just to fix this bug and edit the corresponding tests and type hints accordingly.

@ibrahim-shehzad ibrahim-shehzad added bug Something isn't working stable backport potential Suitable to be backported to most recent stable branch by Mergify cut finder Related to the automatic cut finder labels May 15, 2024
@ibrahim-shehzad ibrahim-shehzad added this to the 0.7.2 milestone May 15, 2024
@ibrahim-shehzad ibrahim-shehzad self-assigned this May 15, 2024
@@ -430,12 +430,12 @@ def add_action(
self,
action_obj: DisjointSearchAction,
gate_spec: GateSpec,
args: tuple | None = None,
*args: tuple | None,
Copy link
Member

Choose a reason for hiding this comment

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

I suspect that | None is not actually needed. See e.g. https://stackoverflow.com/a/37032111/1558890

Copy link
Collaborator Author

@ibrahim-shehzad ibrahim-shehzad May 15, 2024

Choose a reason for hiding this comment

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

I wasn't able to look into this carefully but since mypy didn't complain, I went ahead and made the change you suggested (e44b4be).

caleb-johnson
caleb-johnson previously approved these changes May 15, 2024
Copy link
Collaborator

@caleb-johnson caleb-johnson left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@coveralls
Copy link

Pull Request Test Coverage Report for Build 9099874576

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 2 files are covered.
  • 21 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 95.472%

Files with Coverage Reduction New Missed Lines %
circuit_knitting/cutting/cutqc/wire_cutting_evaluation.py 21 84.18%
Totals Coverage Status
Change from base Build 9084779766: -0.03%
Covered Lines: 3500
Relevant Lines: 3666

💛 - Coveralls

@ibrahim-shehzad ibrahim-shehzad merged commit 9d789f7 into main May 15, 2024
11 checks passed
@ibrahim-shehzad ibrahim-shehzad deleted the double-wire-cut-bug-fix branch May 15, 2024 17:24
mergify bot pushed a commit that referenced this pull request May 15, 2024
* tuple unpacking bug fix, edit tests and type hints accordingly.

* remove extraneous type hint

(cherry picked from commit 9d789f7)
garrison pushed a commit that referenced this pull request May 15, 2024
* tuple unpacking bug fix, edit tests and type hints accordingly.

* remove extraneous type hint

(cherry picked from commit 9d789f7)

Co-authored-by: Ibrahim Shehzad <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cut finder Related to the automatic cut finder stable backport potential Suitable to be backported to most recent stable branch by Mergify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants