1
$\begingroup$

I'm working with a program, which needs iterations of quantum computation like this

def quantum(n):
    Grover(oracle).run(QuantumInstance(...))
    #n is input size associated with oracle, 
    #and some other components are omitted.

for n in range(0,10):
    start = time.time()
    quantum(n)
    end = time.time()

Now I have to wait for hours to run this on the 16-qubit quantum computer. So is there any way to pack all computation into one round?

$\endgroup$
2
$\begingroup$

Assuming your quantum() method creates a circuit, you can run lots of circuits in one go by using the execute command. For example execute([grover_1, grover_2, grover_3], backed=my_backend).

| improve this answer | |
$\endgroup$
  • $\begingroup$ Yes, but can I count time for each computation? $\endgroup$ – Zaragoss May 19 at 10:09
  • 1
    $\begingroup$ Yes this is returned as a parameter in the results object :) $\endgroup$ – met927 May 19 at 10:16
  • $\begingroup$ I'm new in using this framework, so sorry, but it seems the algorithm Grover in aqua.algorithms is not a circuit which can be accepted by execute directly, right? Then is there any way to execute some simple methods like Grover, without touching too much circuit work? $\endgroup$ – Zaragoss May 19 at 11:03
  • 1
    $\begingroup$ Instead of doing grover.run() you can do grover.construct_circuit(). This will return a circuit which can then be run by execute $\endgroup$ – met927 May 19 at 12:35
  • $\begingroup$ Update: I have just found results given by the quantum processor contain only an overall time_taken for total time, while simulators provider time counted for each circuit. So is there any way to deal with it? (Maybe this is a little off-topic, I posted another question for this issue.) $\endgroup$ – Zaragoss May 20 at 14:08

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.