Skip to content

[BUG] Incorrect "Duplicate qubit argument" #75

@Sola85

Description

@Sola85

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions