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

Fix QasmWriter.add_multi_bit() for non-register-aligned arguments #1572

Merged
merged 5 commits into from
Sep 12, 2024

Conversation

cqc-alec
Copy link
Collaborator

@cqc-alec cqc-alec commented Sep 11, 2024

Description

Don't assume the arguments in add_multibit_op() are register-aligned.

With this change, if the arguments aren't all whole registers we write out the operation as individual bit operations.

Related issues

Fixes #1327 .

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-alec cqc-alec changed the title Ae/multibitop Fix QasmWriter.add_multi_bit() for non-register-aligned arguments Sep 11, 2024
@cqc-alec cqc-alec marked this pull request as ready for review September 11, 2024 15:10
Copy link
Contributor

@yao-cqc yao-cqc left a comment

Choose a reason for hiding this comment

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

Thanks, it seems that this has also fixed #1509 :)

@cqc-alec
Copy link
Collaborator Author

Thanks, it seems that this has also fixed #1509 :)

Cool! Will let you close that one if it is fixed after merging this.

@cqc-alec cqc-alec merged commit cafe46d into main Sep 12, 2024
30 checks passed
@cqc-alec cqc-alec deleted the ae/multibitop branch September 12, 2024 14:09
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.

Incorrect QASM conversion of circuit containing non-register-aligned MultiBitOp
2 participants