0
$\begingroup$

One question, codes as follows:

backend = Aer.get_backend('qasm_simulator')
counts = execute(qc, backend=backend, shots=102400).result().get_counts()

when my number of shots is 102400, is my time complexity 102400? That means i need Multiply 102400 by the time complexity of the relevant algorithm. Thanks

$\endgroup$

1 Answer 1

0
$\begingroup$

It depends on the simulation mode (regular, stabilizer, MPS, etc.) and structure of the circuit. Roughly, if your circuit doesn't have noise or mid-circuit measurements then it's simulated only once, then measurement outcomes are sampled.

$\endgroup$
5
  • $\begingroup$ Hello, thanks for your help, and now could i tell you the next question?you said it's simulated only once. can i think it's only one the circuit needs run, and i can get 102400 results from it? Can you explain why i can get so many results only from one circuit running? Thank you $\endgroup$
    – qin guang
    May 12, 2023 at 13:55
  • $\begingroup$ You sample the final state vector $\endgroup$ May 14, 2023 at 5:25
  • $\begingroup$ But does 102400 shots mean running the circuit 102400 times? $\endgroup$
    – qin guang
    May 15, 2023 at 4:43
  • $\begingroup$ No, the simulators runs the circuit once, obtains the final state vector, and samples. $\endgroup$ May 15, 2023 at 9:47
  • $\begingroup$ but in qiskit source code:shots (int): Number of repetitions of each circuit, for sampling. Default: 1024 Is it mean run the circuit many times? $\endgroup$
    – qin guang
    May 23, 2023 at 13:23

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.