-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
- Qiskit Terra version: 0.23.1
- Python version: 3.9.15
- Operating system: macOS Ventura
What is happening?
Qiskit supports the CSdgGate
, but raises error when creating a circuit from a qasm file that includes a csdg
gate. Issue may exist for other gates as well, but so far this is the only one I've identified.
How can we reproduce the issue?
import os
from qiskit import QuantumCircuit
workdir = os.path.dirname(__file__)
qasm_file = os.path.join(workdir, "test.qasm")
circuit = QuantumCircuit(2)
circuit.csdg(0, 1)
qasm_str = circuit.qasm()
with open(qasm_file, "w") as f:
f.write(qasm_str)
new_circuit = QuantumCircuit().from_qasm_file(qasm_file)
print(new_circuit)
Traceback (most recent call last):
...
...
File ".../lib/python3.9/site-packages/qiskit/qasm/qasmparser.py", line 138, in verify_as_gate
raise QasmError(
qiskit.qasm.exceptions.QasmError: "Cannot find gate definition for 'csdg', line 4 file line 4 file test.qasm"
What should happen?
Program should print out new circuit without error
Any suggestions?
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working