composite gates do not have definition when qasm()'d
See original GitHub issueInformation
- Qiskit Terra version: master
- Python version: 3.7
What is the current behavior?
from qiskit import QuantumCircuit, QuantumRegister
rinv_q = QuantumRegister(1, name='q')
rinv_gate = QuantumCircuit(rinv_q, name='rinv')
rinv_gate.sdg(rinv_q)
rinv_gate.h(rinv_q)
rinv_gate.sdg(rinv_q)
rinv_gate.h(rinv_q)
rinv = rinv_gate.to_instruction()
qr = QuantumRegister(1, name='qr')
circuit = QuantumCircuit(qr, name='circuit')
circuit.append(rinv, [qr[0]])
print(circuit.qasm())
OPENQASM 2.0;
include "qelib1.inc";
qreg qr[1];
rinv qr[0];
What is the expected behavior?
OPENQASM 2.0;
include "qelib1.inc";
gate rinv q {sdg q; h q; sdg q; h q; } # <--- the definition of rinv
qreg qr[1];
rinv qr[0];
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Source code for qiskit.circuit.quantumcircuit
Raises: CircuitError: if the circuit name, if given, is not valid. ... The custom pulse definition of a given gate is of the...
Read more >Compiler Passes — OpenQL documentation
A compiler pass is not something defined in OpenQL. ... The circuit generated might also have different angles, though not different gates, and...
Read more >oitg.circuits API - Oxford Ion Trap Quantum Computing group
Composite pulse implementations for replacing gates with sequences that are logically equivalent, but have different behaviour under imperfections.
Read more >Construct circuits in the SDK - Amazon Braket
Quantum gates and circuits are defined in the braket.circuits class of the ... From the SDK, you can instantiate a new circuit object...
Read more >Yao.jl: Extensible, Efficient Framework for Quantum Algo - arXiv
ing [8, 9] have had small scale demonstrations in ... nents are typically, but not limited to, neural ... representation of quantum gates...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The QASM specification does not allow classical bits as arguments. I think. Check out if you can parse them back.
Great! We can wait until then… no worries.
A related issue that has been open for a year: https://github.com/Qiskit/qiskit-terra/issues/1566
It is the inverse of this issue. Seems there is an open PR for it but does fully work.