We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A circuit that contains a C3SX gate can be translated to qasm, but the generated qasm cannot be translated back to a quantum circuit. The error stems from a mismatch in the name of this gate between qelib1.inc ("c3sqrtx"): https://github.com/Qiskit/qiskit-terra/blob/6af71f9d1e249a3747772449f299160df4047b83/qiskit/qasm/libs/qelib1.inc#L242 and qiskit's python code ("c3sx"): https://github.com/Qiskit/qiskit-terra/blob/cf4005ff9fdc672111a827582e6b7d8ae2683be5/qiskit/circuit/library/standard_gates/x.py#L446 https://github.com/Qiskit/qiskit-terra/blob/6af71f9d1e249a3747772449f299160df4047b83/qiskit/circuit/quantumcircuit.py#L1563
import qiskit qc = qiskit.QuantumCircuit(4) gate = qiskit.circuit.library.C3SXGate() qc.append(gate, qargs=qc.qubits) qasm = qc.qasm() qc_from_qasm = qiskit.QuantumCircuit.from_qasm_str(qasm) # fails: # QasmError( # qiskit.qasm.exceptions.QasmError: "Cannot find gate definition for 'c3sx', line 4 file "
I would like the gate names to concur and the qasm to be convertible to a quantum circuit.
(This issue probably relates to #4943.)
The text was updated successfully, but these errors were encountered:
Good catch! I think renaming the qasm definition to c3sx is the way to go so we stay consistent in our naming policy.
Sorry, something went wrong.
Thanks, if this solution is accepted I would like to submit a PR that replaces all the occurrences of c3sqrtx with c3sx - please let me know.
c3sqrtx
c3sx
Yeah please go ahead!
Replace all c3sqrtx occurrences with c3sx
5b6d768
Fixes Qiskit#7148 Use the name defined in `C3SXGate` class
C3SXGate
QasmError: "Cannot find gate definition for 'c3sx'
Cannot find gate definition for 'rcccx'
jond01
Successfully merging a pull request may close this issue.
Information
What is the current behavior?
A circuit that contains a C3SX gate can be translated to qasm, but the generated qasm cannot be translated back to a quantum circuit.
The error stems from a mismatch in the name of this gate between qelib1.inc ("c3sqrtx"):
https://github.com/Qiskit/qiskit-terra/blob/6af71f9d1e249a3747772449f299160df4047b83/qiskit/qasm/libs/qelib1.inc#L242
and qiskit's python code ("c3sx"):
https://github.com/Qiskit/qiskit-terra/blob/cf4005ff9fdc672111a827582e6b7d8ae2683be5/qiskit/circuit/library/standard_gates/x.py#L446
https://github.com/Qiskit/qiskit-terra/blob/6af71f9d1e249a3747772449f299160df4047b83/qiskit/circuit/quantumcircuit.py#L1563
Steps to reproduce the problem
What is the expected behavior?
I would like the gate names to concur and the qasm to be convertible to a quantum circuit.
Suggested solutions
(This issue probably relates to #4943.)
The text was updated successfully, but these errors were encountered: