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

Allow wire_symbol() to handle multiple named selection registers. #1563

Merged
merged 10 commits into from
Feb 27, 2025

Conversation

dandragona-dev
Copy link
Contributor

@dandragona-dev dandragona-dev commented Feb 24, 2025

  • Selection registers follow the naming pattern "selection", but the wire_symbol() code wasn't matching that pattern.
  • Also fixes this issue in the other instances of wire_symbol.
  • Adds unit tests for possible register name patterns.
  • Fixes Can't get the musical score of QROAMClean #1541.

@dandragona-dev dandragona-dev marked this pull request as ready for review February 24, 2025 22:23
Copy link
Collaborator

@mpharrigan mpharrigan left a comment

Choose a reason for hiding this comment

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

Can you add a small test that would have caught the bug?

selection registers which follow the naming pattern "selection<number>".
selection registers which follow the naming pattern "selection<number>".
@@ -124,6 +165,7 @@ def test_qroam_clean_classical_sim():
assert bloq_inv.call_classically(
selection0=x, selection1=y, target0_=vals[2], junk_target0_=vals[3]
) == (x, y)
print(bloq_inv)
Copy link
Collaborator

Choose a reason for hiding this comment

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

extraneous print

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed. I think it must have just been a bad push by me as I learn how to use Git.

@dandragona-dev dandragona-dev changed the title Allow wire_symbol() to handle multiple named selection registers which follow the naming pattern "selection<number>". Allow wire_symbol() to handle multiple named selection registers. Feb 26, 2025
@mpharrigan mpharrigan enabled auto-merge (squash) February 27, 2025 19:40
auto-merge was automatically disabled February 27, 2025 21:17

Head branch was pushed to by a user without write access

@mpharrigan mpharrigan merged commit 42c5b6c into quantumlib:main Feb 27, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't get the musical score of QROAMClean
2 participants