Is there a way to output a circuit from Qiskit to the IBM Q Experience circuit composer?

I can't seem to find anything, but this seems like something that should be possible.

You can convert a qiskit circuit to QASM using circuit.qasm(). You can copy this and then there's an "Import OpenQASM" button on the initial circuit composer page:

and you can paste the QASM into a tab of the composer itself:

• I am a little bit confused. I think that the question was on code in Qiskit, not QASM. – Martin Vesely Dec 3 '19 at 6:19
• IBM Q Experience circuit composer takes OpenQASM code, not Qiskit code. – Junye Huang Dec 3 '19 at 11:33
• Thank you, this is exactly what I was looking for! For anyone trying it, you have to do print(circuit.qasm()) if you want to be able to copy paste into the circuit editor. – ejw_art Dec 3 '19 at 19:16

Let's say, you've the Qiskit code for the circuit that you want to implement in Circuit Composer as shown below.

qr = QuantumRegister(3, name="q")
crz, crx = ClassicalRegister(1, name="crz"), ClassicalRegister(1, name="crx")
qc = QuantumCircuit(qr, crz, crx)

qc.h(1) # Put qubit a into state |+>
qc.cx(1,2) # CNOT with a as control and b as target



Then use print(qc.qasm()) to get the circuit equivalent, which is as follows

OPENQASM 2.0;
include "qelib1.inc";

qreg q[3];
creg crz[1];
creg crx[1];

h q[1];
cx q[1],q[2];


You can run this code in QASM / Circuit Composer.