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

Duplicate declaration for gate 'r' #10059

Closed
ArfatSalman opened this issue May 2, 2023 · 1 comment
Closed

Duplicate declaration for gate 'r' #10059

ArfatSalman opened this issue May 2, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@ArfatSalman
Copy link
Contributor

Environment

  • Qiskit Terra version: {'qiskit-terra': '0.23.3', 'qiskit-aer': '0.12.0', 'qiskit-ignis': None, 'qiskit-ibmq-provider': '0.20.2', 'qiskit': '0.42.1', 'qiskit-nature': None, 'qiskit-finance': None, 'qiskit-optimization': None, 'qiskit-machine-learning': None}

  • Python version: Python 3.11.2

  • Operating system: Apple MacOS Ventura 13.3.1

What is happening?

The RGate is being duplicated when it is exported as QASM in an inverted sub-circuit.

How can we reproduce the issue?

from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit.circuit.library.standard_gates import *

qr = QuantumRegister(6, name='qr')
cr = ClassicalRegister(6, name='cr')
qc = QuantumCircuit(qr, cr, name='qc')

qc.append(CSGate(), qargs=[qr[4], qr[0]], cargs=[])

subcircuit = QuantumCircuit(qr, cr, name='subcircuit')

subcircuit.append(RGate(1.0099433123573884, 3.399529081072497), qargs=[qr[5]], cargs=[])

qc.append(subcircuit, qargs=qr, cargs=cr)
qc.append(subcircuit.inverse(), qargs=qr, cargs=cr)

qc.append(U1Gate(3.6101582139068564), qargs=[qr[2]], cargs=[])

qc = QuantumCircuit.from_qasm_str(qc.qasm())
# qiskit.qasm.exceptions.QasmError: Duplicate declaration for gate 'r'

What should happen?

The definition of RGate should not be duplicated.

Any suggestions?

No response

@ArfatSalman ArfatSalman added the bug Something isn't working label May 2, 2023
@1ucian0
Copy link
Member

1ucian0 commented May 4, 2023

Same as in #10060

This is duplicated with #8402
The fix is #9953 which is going tot be released in 0.24 (to be released today).

@1ucian0 1ucian0 closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 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

No branches or pull requests

2 participants