I am trying to implement the following circuit enter image description here

and my code is

The above circuit has size 5 and depth 3. My question is, how can I run the circuit parallelly. I mean, the gate circuit.cx(qr[0], qr[1]) and gate circuit.cx(qr[2], qr[3]) will be run at the same time and the total running time is dominated by the depth.

I found a related question in Creating and running parallel circuits in Qiskit. However, in that question, the author tries to run several independent experiments rather than run the gates in a circuit parallelly.

  • $\begingroup$ The ability to run the gates in parallel is up to the device. There could be technical reasons as to why this could be bad, eg noise in simultaneous gates. That said, all IBM Quantum devices run in parallel when possible. $\endgroup$ Nov 1 '19 at 10:30

Qiskit implements a transpiler which optimizes the circuits that you provide. This means it modifies the circuit so that it can be run on the backend and also optimizes it so that anything that can possibly be run in parallel is done so. To run with the maximum level of optimization you can run execute(circuit, optimization_level=3). There is more information about the transpiler here.

If you would like even finer control of when things are executed you can create a Pulse Schedule. There is more information about this here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.