1
$\begingroup$

qrng code in quantum lab

I am trying to run the above code on Vigo, Santiago and other backends. However, warning message as shown in the image apppears and no result is displayed even after hours of waiting. However, when I reduce the bitstring size to 4 from 512/256/56 the output appears but that too after very long.

Questions:

  1. Can anyone guide how to obtain a longer length bitstring (512, 1024, 2048) for one, two, three qubit measurements for backend options other than simulator?

  2. What is the reason for results not being obtained as I think there is no error in the code?

$\endgroup$
1
  • $\begingroup$ consider copy your code in blockcodes here instead of a screenshot. That makes it easier to debug. $\endgroup$
    – luciano
    Oct 20 '20 at 23:00
2
$\begingroup$

The warning messages just inform you of interface change and has no impact to your code.

You're submitting one job for each bit. The system uses a fair-share algorithm to determine who gets to run next (more details here: https://quantum-computing.ibm.com/docs/manage/backends/queue/). So running hundreds of jobs consecutively would kill your priority very quickly. Which is why it'd take a very long time to finish all the jobs.

You can reduce the number of jobs by using more qubits in each circuit, and more circuits/shots for each job.

$\endgroup$
2
  • $\begingroup$ how do i increase the number of circuits in each job in the above code $\endgroup$
    – parth
    Oct 21 '20 at 6:56
  • $\begingroup$ execute() takes a list of circuits. So you can just pack all your circuits (up to the max as indicated below) into a list and call execute(all_my_circuits, backend, shots=1). $\endgroup$
    – jyu00
    Oct 22 '20 at 12:24
1
$\begingroup$

As the other answer stated, there is nothing wrong. The reason for long time for the job to be completed is coming from the queuing time and not the actual execution time itself.

One way to get around this is to use more qubits. This way you don't have to stuck in queue multiple time. That is, you use the maximum number of qubits a particular machine has along with the maximum_circuits (circuits) it allows you to run on a single job. For instance, Ourense has 5 qubits with maximum_circuits of 75, so this means you have 5*75 = 375 bitstrings that you can extract from a single queue.

One other way to get around this, you can use build a noise_model that mimics Ourense with qasm_simulator. Look at this documentation here on how to do that: Building Noise-Model

$\endgroup$
2
  • $\begingroup$ i can increase the number of qubits. however,how can i know maximum number of circuits in different backends and define the number of circuits to be used so as to ensure that its maximum $\endgroup$
    – parth
    Oct 21 '20 at 6:55
  • 1
    $\begingroup$ backend.configuration().max_experiments will give you the maximum number of circuits. Alternatively, you can use IBMQJobManager which will divide the circuits for you. Doc on job manager: quantum-computing.ibm.com/docs/manage/account/ibmq $\endgroup$
    – jyu00
    Oct 22 '20 at 12:22

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.