6

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.

Sanchayan Dutta
  • 17,945
  • 8
  • 50
  • 112
wei zi
  • 325
  • 2
  • 9

1 Answers1

6

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.

met927
  • 3,251
  • 1
  • 10
  • 22