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!
3 Answers
backend._configuration.max_shots= ...
Will do what you want.
-
$\begingroup$ Now I see why you guy put a limit to that. It takes all my RAM lol. $\endgroup$ May 13, 2020 at 3:15
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.
-
$\begingroup$ This workaround will do, but I hope some developer here can point me out on how to customize this. $\endgroup$ May 12, 2020 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$– met927May 12, 2020 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$ May 12, 2020 at 13:32
This limit is set in the configuration of the device. There is no way to edit this property as far as I know.
-
$\begingroup$ No I mean the Aer.qasm_simulator on my computer. $\endgroup$ May 12, 2020 at 13:21