6
$\begingroup$

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.

$\endgroup$
1
  • $\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$ Commented Nov 1, 2019 at 10:30

1 Answer 1

6
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ The current tutorial appears to be here: github.com/Qiskit/qiskit-tutorials/blob/master/tutorials/… But it makes no mention of parallelizing quantum circuits. There's also no documented transpiler pass that attempts it: qiskit.org/documentation/apidoc/transpiler_passes.html It looks like they don't currently try to parallelize, unless they do so after a job is submitted? I notice .draw function shows gates in parallel even when the openqasm circuit is clearly not in parallel, which suggests maybe they do parallelize. $\endgroup$
    – Max
    Commented Sep 28, 2022 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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