0
$\begingroup$

I want to do a circuit with more than 1 million shots. How do I change the number of max_shots of Aer qasm_simulator in Qiskit? When I run it, it said Number of shots specified: 1000001 exceeds max_shots property of the backend: 1000000.'. Can someone help me? Thanks!

$\endgroup$
2
$\begingroup$

backend._configuration.max_shots= ...

Will do what you want.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Now I see why you guy put a limit to that. It takes all my RAM lol. $\endgroup$ – Kim Dong May 13 at 3:15
2
$\begingroup$

I don't think that this parameter can be altered, I can't see a situation where you should need this many shots. You can pass more than one circuit to the execute function, so if you do execute([qc, qc], shots=100) each circuit will be run for 100 shots, giving you a total of 200 shots. You could use a method like this to get up to a larger number of shots if you needed.

| improve this answer | |
$\endgroup$
  • $\begingroup$ This workaround will do, but I hope some developer here can point me out on how to customize this. $\endgroup$ – Kim Dong May 12 at 13:26
  • 1
    $\begingroup$ I am a developer, you can probably update this parameter by locating this file (github.com/Qiskit/qiskit-aer/blob/…) on your system and updating max_shots. However, as I previously said, you should not need to run things for this many shots to get an accurate idea of the probability distribution. $\endgroup$ – met927 May 12 at 13:30
  • 1
    $\begingroup$ Oh damn, I don't mean to disrespect. Thank you, guess I'll just do the workaround, in case I break something. $\endgroup$ – Kim Dong May 12 at 13:32
1
$\begingroup$

This limit is set in the configuration of the device. There is no way to edit this property as far as I know.

| improve this answer | |
$\endgroup$
  • $\begingroup$ No I mean the Aer.qasm_simulator on my computer. $\endgroup$ – Kim Dong May 12 at 13:21

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.