Quantum Computing Asked on June 11, 2021
When using qiskit execute
it is possible to stipulate the number of shots
for each experiment/QuantumCircuit
, however when using IBMJobManager
this is seemingly not possible.
Is this correct and if so how many shots
are executed by default? and if not how can the number of shots
be specified?
You can specify IBMQJobManager.run(shots=my_shots)
. See run_config
in IBMQJobManager.run()
documentation: https://qiskit.org/documentation/stubs/qiskit.providers.ibmq.managed.IBMQJobManager.run.html#qiskit.providers.ibmq.managed.IBMQJobManager.run
The default is 1024 or the maximum allowed by the backend, whichever is smaller.
Correct answer by jyu00 on June 11, 2021
When using execute in qiskit, you can specify how many shots you want done for a circuit in the following way:
#for a defined circuit and backend
job = execute(circuit, backend, shots=___)
where you fill in the blank with some number between 1 and 8192, the min and max shots you can execute on any backend. If you want to run one circuit, I would use execute.
If you want to run many circuits at once, then I would use IBMQJobManager. You first have to put the circuits in a list and transpile them to your backend, then run them using the method IBMQJobManager().run(). You can also specify the number of shots for each job as shown:
#for a defined list of circuits and backend
circuits = transpile(circuit, backend)
job = IBMQJobManager().run(circuits, backend, shots = ___)
where the range for the possible number of shots is the same as that for execute. More information about IBMQJobManager can be found here: https://qiskit.org/documentation/stubs/qiskit.providers.ibmq.managed.IBMQJobManager.html#qiskit.providers.ibmq.managed.IBMQJobManager
Also, the default number of shots on any job run on an IBMQ backend is 1024.
Answered by Winona on June 11, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP