# QASM Files on Jupyter Notebook

Is it possible to run qasm files on jupyter notebook (like with the qasm_simulator)? I downloaded one code file and I would like to play around with it on jupyter notebook.

• This is perhaps a more apt question for the Qiskit communitry github.com/qiskit-community Oct 28 '21 at 15:24

You can use QuantumCircuit.from_qasm_str() like this:

from qiskit import QuantumCircuit

qasm_str = """
OPENQASM 2.0;
include "qelib1.inc";
qreg q[2];
creg c[2];
h q[0];
cx q[0],q[1];
measure q[0] -> c[0];
measure q[1] -> c[1];
"""

circ = QuantumCircuit.from_qasm_str(qasm_str)
circ.draw('mpl')

• Thank you very much Nov 11 '21 at 8:39