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

reject incomplete registers in pytket to qasm conv #1656

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

cqc-melf
Copy link
Contributor

@cqc-melf cqc-melf commented Nov 5, 2024

Description

Solves #1457

Related issues

Please mention any github issues addressed by this PR.

Checklist

  • I have performed a self-review of my code.
  • I have commented hard-to-understand parts of my code.
  • I have made corresponding changes to the public API documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have updated the changelog with any user-facing changes.

@cqc-melf cqc-melf marked this pull request as ready for review November 5, 2024 12:16
@cqc-melf cqc-melf requested a review from cqc-alec November 5, 2024 12:16
cqc-alec
cqc-alec previously approved these changes Nov 5, 2024
pytket/pytket/qasm/qasm.py Outdated Show resolved Hide resolved
Comment on lines 1146 to 1149
for b in set([b.reg_name for b in circ.bits]):
if b not in set_circ_register:
raise QASMUnsupportedError(
f"Circuit contains a invalid classical register {b}."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
for b in set([b.reg_name for b in circ.bits]):
if b not in set_circ_register:
raise QASMUnsupportedError(
f"Circuit contains a invalid classical register {b}."
for b in circ.bits:
if b.reg_name not in set_circ_register:
raise QASMUnsupportedError(
f"Circuit contains a invalid classical register {b.reg_name}."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in 56ad98d

Co-authored-by: Alec Edgington <54802828+cqc-alec@users.noreply.github.com>
@cqc-melf cqc-melf requested a review from cqc-alec November 5, 2024 15:07
@cqc-melf cqc-melf merged commit e46c00a into main Nov 5, 2024
30 checks passed
@cqc-melf cqc-melf deleted the melf/reject-qasm-incompete-clreg branch November 5, 2024 15:35
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.

2 participants