I'm trying to create and run parallel execution using the instruction here. However, when I implement it, it tells me that I shouldn't be using compile
anymore since
DeprecationWarning: qiskit.compile() is deprecated and will be removed in Qiskit Terra 0.9. Please use qiskit.compiler.transpile() to transform circuits and qiskit.compiler.assemble() to produce a runnable qobj. DeprecationWarning)
So how do I go about doing this using the new modules? Thank you!
Here's the code in the link for creating parallel executions:
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
from qiskit import Aer, compile
from qiskit.backends.jobstatus import JOB_FINAL_STATES
n_qubits = 5
qc_list = []
for i in range(n_qubits):
qr = QuantumRegister(n_qubits)
cr = ClassicalRegister(n_qubits)
qc = QuantumCircuit(qr, cr)
qc.x(qr[i])
qc.measure(qr, cr)
qc_list.append(qc)
backend = Aer.get_backend('qasm_simulator')
qobj_list = [compile(qc, backend) for qc in qc_list]
job_list = [backend.run(qobj) for qobj in qobj_list]
while job_list:
for job in job_list:
if job.status() in JOB_FINAL_STATES:
job_list.remove(job)
print(job.result().get_counts())