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

[BUG] Incorrect "Duplicate qubit argument" #75

Open
Sola85 opened this issue Nov 11, 2024 · 0 comments
Open

[BUG] Incorrect "Duplicate qubit argument" #75

Sola85 opened this issue Nov 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Sola85
Copy link
Contributor

Sola85 commented Nov 11, 2024

Environment

  • PyQASM version: main as of today
  • Python version: 3.11.5
  • Operating system: Linux 1be07c5250d0 5.15.153.1-microsoft-standard-WSL2 # 1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 GNU/Linux

What happened?

Currently, broadcasting of multi-qubit gates works like e.g. cx a, b, c, d; -> cx a, b; cx c, d;.

This means that cx q[0], q[1], q[1], q[2]; should be fine in principle as this should simply translate to cx q[0], q[1]; cx q[1], q[2];.

But instead compiling this results in
pyqasm.exceptions.ValidationError: Duplicate qubit q[1] argument

Suggestions (Optional)

To fix this, the check for duplicate arguments should only happen after the broadcast qubits have been unrolled.

But this issue is probably not of high priority since I don't know how many people actually use qubit broadcasting on multi-qubit gates.

@Sola85 Sola85 added the bug Something isn't working label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant