1
$\begingroup$

I have created a very simple circuit on qiskit to produce a Bell state:

bell = QuantumCircuit(2)
bell.h(0)
bell.cx(0, 1)
bell.measure_all()

And I then run it on a real IBM quantum computer (27-qubits: ibm_canberra):

with Session(service=service, backend="ibm_canberra"):
sampler = Sampler()
job = sampler.run(circuits=bell)
print(job.result())

Looking at jobs, QR usage (Qiskit Runtime usage) indicate 24s (so $40). Of course, given the small circuit, I could run it on a free and smaller IBM quantum computer (let's say 5 qubits). But here, would like to understand how 27-qubits IBM computers work. Do you know why it takes 24s to run this program? Is the speed normal?

$\endgroup$

3 Answers 3

1
$\begingroup$

I think the time is not purely about running the circuit. Cause 24s is way larger than the coherence time of qubits(around only 400 microseconds?). This time may contains other parts for preparing the running. I'm looking forward that someone could explain the detailed precedures for those preparations.

$\endgroup$
2
  • $\begingroup$ What is also surprising is that if I use a simulator such as ibmq_qasm_simulator instead of a real computer, it takes a couple of seconds... $\endgroup$
    – Stéphane
    Jun 28, 2023 at 14:29
  • $\begingroup$ Yes, that's true. $\endgroup$ Jun 28, 2023 at 19:06
1
$\begingroup$

I think I found the answer in a previous post: Time execution on real quantum backend higher than classical kmeans

I post a part of the reply here:

- Running experiments on real quantum devices, especially today, can include quite some overhead (e.g. submission of jobs to the hardware, waveform generation, qubit resets, ...).

- The clock speed of classical computers is of the order of GHz while qubit operations are typically much slower (and depend a lot on what types of qubits).

- If a quantum algorithm has an advantage over classical ones, this speedup is mostly asymptotic and only shows for large problems

$\endgroup$
2
  • $\begingroup$ Thanks, I think more detailed and reliable information should be found. $\endgroup$ Jun 30, 2023 at 5:12
  • $\begingroup$ I agree. I will try to find that! $\endgroup$
    – Stéphane
    Jun 30, 2023 at 7:34
1
$\begingroup$

24 seconds is indeed longer than it really needs to be to run this small circuit. The reason it is taking 24 seconds is because you are using a construct called Qiskit primitives; specifically you are using the sampler primitive. The reason this detail is important is because by default these primitives will use some parameter choices to compute, in this case, quasi probability distributions. So, unless you specifically set the number of shots, the program will set some number of shots (likely in the thousands, but I do not know the exact number). Additionally, by default some type of classical error mitigation post processing will be applied (by default it is a measurement error mitigation procedure), which will consume more quantum compute time.

To answer your question, given you are using a sampler primitive, I think this amount of compute time is expected. The 27 qubit devices do use more compute time, usually, than the smaller devices, but if you run the sampler primitive on the smaller qubit devices you will still get roughly the same QPU time usage.

Here is a code snippet to run on an IBM quantum backend directly, with no Qiskit runtime primitives (this will give you a lower level of control to adjust the number of shots, and therefore compute time):

from qiskit_ibm_provider import IBMProvider
provider = IBMProvider()
hgp = f"{hub}/{group}/{project}"
backend = provider.get_backend("ibm_hanoi", instance=hgp)
job = backend.run(circuit, shots=100)
print(job.job_id())
$\endgroup$

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.