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.
1 Answer
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')