azure-quantum-python icon indicating copy to clipboard operation
azure-quantum-python copied to clipboard

IonQ simulator max_shots should be set to None

Open guenp opened this issue 3 years ago • 1 comments

max_shots for the IonQ simulator should be set to None. It is currently set to 1 and causes the following error when using qiskit-aqua:

---------------------------------------------------------------------------
AquaError                                 Traceback (most recent call last)
Input In [42], in <module>
----> 1 quantum_instance = QuantumInstance(backend=ionq_backend,
      2                                    shots=8192)

File ~/anaconda3/envs/azurequantum/lib/python3.9/site-packages/qiskit/aqua/quantum_instance.py:149, in QuantumInstance.__init__(self, backend, shots, seed_simulator, max_credits, basis_gates, coupling_map, initial_layout, pass_manager, seed_transpiler, optimization_level, backend_options, noise_model, timeout, wait, skip_qobj_validation, measurement_error_mitigation_cls, cals_matrix_refresh_period, measurement_error_mitigation_shots, job_callback)
    147     max_shots = self._backend.configuration().max_shots
    148     if max_shots is not None and shots > max_shots:
--> 149         raise AquaError('The maximum shots supported by the selected backend is {} '
    150                         'but you specified {}'.format(max_shots, shots))
    152 run_config = RunConfig(shots=shots, max_credits=max_credits)
    153 if seed_simulator is not None:

AquaError: 'The maximum shots supported by the selected backend is 1 but you specified 8192'

guenp avatar Apr 22 '22 00:04 guenp

The same goes for the Quantinuum emulator.

guenp avatar Apr 22 '22 17:04 guenp

This was fixed with #301.

xinyi-joffre avatar Feb 01 '24 16:02 xinyi-joffre