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

QASM3 dupliacte qubit arguments #1793

Closed
rviktor85 opened this issue Apr 25, 2023 · 1 comment · Fixed by #1846
Closed

QASM3 dupliacte qubit arguments #1793

rviktor85 opened this issue Apr 25, 2023 · 1 comment · Fixed by #1846
Labels
bug Something isn't working
Milestone

Comments

@rviktor85
Copy link

Environment

  • Qiskit Terra version: 0.23.3
  • Python version: 3.10
  • Operating system: osx

What is happening?

I am trying to make convert and use QuantumCircuit from OpenQASM3 file. After obtaining the circuit (an instance of QuantumCircuit class), I added save_statevector() instruction and CircuitError: 'duplicate qubit arguments' error is thrown.

How can we reproduce the issue?

from qiskit.qasm3 import dumps, loads

circ = QuantumCircuit(2)
circ.x(0)
circ.cx(0, 1)

qasm_str = dumps(circ)
print(qasm_str)

new_circ = loads(qasm_str)
new_circ.save_statevector()

What should happen?

There shouldn't be any error thrown.

Any suggestions?

No response

@rviktor85 rviktor85 added the bug Something isn't working label Apr 25, 2023
@rviktor85 rviktor85 changed the title QASM3 QASM3 dupliacte qubit arguments Apr 25, 2023
@jakelishman
Copy link
Member

Thanks for the report - this is actually a bug in Aer (which is what defines the save_statevector method) that's calculating the qubits in a circuit slightly incorrectly if there's overlapping registers. I'll transfer this issue over there so we can fix it.

@jakelishman jakelishman transferred this issue from Qiskit/qiskit Apr 25, 2023
@hhorii hhorii added this to the Aer 0.12.1 milestone Jun 13, 2023
@hhorii hhorii modified the milestones: Aer 0.12.1, Aer 0.12.2 Jun 15, 2023
@mergify mergify bot closed this as completed in #1846 Jul 10, 2023
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

Successfully merging a pull request may close this issue.

3 participants