Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove BasicAer shot limit - QAMP #7801

Merged
merged 11 commits into from
May 3, 2022
2 changes: 1 addition & 1 deletion qiskit/providers/basicaer/qasm_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class QasmSimulatorPy(BackendV1):
"conditional": True,
"open_pulse": False,
"memory": True,
"max_shots": 65536,
"max_shots": 0,
"coupling_map": None,
"description": "A python simulator for qasm experiments",
"basis_gates": ["u1", "u2", "u3", "rz", "sx", "x", "cx", "id", "unitary"],
Expand Down
2 changes: 1 addition & 1 deletion qiskit/providers/basicaer/statevector_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class StatevectorSimulatorPy(QasmSimulatorPy):
"conditional": True,
"open_pulse": False,
"memory": True,
"max_shots": 65536,
"max_shots": 0,
"coupling_map": None,
"description": "A Python statevector simulator for qobj files",
"basis_gates": ["u1", "u2", "u3", "rz", "sx", "x", "cx", "id", "unitary"],
Expand Down
2 changes: 1 addition & 1 deletion qiskit/providers/basicaer/unitary_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class UnitarySimulatorPy(BackendV1):
"conditional": False,
"open_pulse": False,
"memory": False,
"max_shots": 65536,
"max_shots": 0,
"coupling_map": None,
"description": "A python simulator for unitary matrix corresponding to a circuit",
"basis_gates": ["u1", "u2", "u3", "rz", "sx", "x", "cx", "id", "unitary"],
Expand Down
7 changes: 7 additions & 0 deletions test/python/basicaer/test_qasm_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ def test_qasm_simulator_single_shot(self):
result = self.backend.run(self.qobj).result()
self.assertEqual(result.success, True)

def test_qasm_simulator_max_shots(self):
"""Test there is no limit for the number of shots."""
shots = int(2e6)
self.qobj.config.shots = shots
result = self.backend.run(self.qobj).result()
self.assertEqual(result.success, True)

def test_measure_sampler_repeated_qubits(self):
"""Test measure sampler if qubits measured more than once."""
shots = 100
Expand Down