Skip to content

Commit

Permalink
Update backend logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nayan2167 committed Oct 23, 2023
1 parent 5d863f8 commit cff4ad7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions qiskit_experiments/framework/base_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,9 @@ def _max_circuits(self, backend: Backend = None):
if self.backend is None:
raise QiskitError("A backend must be provided.")
backend = self.backend
self.backend = backend
# Get max circuits for job splitting
max_circuits_option = getattr(self.experiment_options, "max_circuits", None)
max_circuits_backend = self._backend_data.max_circuits
max_circuits_backend = BackendData(backend).max_circuits

if max_circuits_option and max_circuits_backend:
return min(max_circuits_option, max_circuits_backend)
Expand Down
2 changes: 1 addition & 1 deletion test/framework/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def error_message(self):
self.assertEqual(len(res), 0)
self.assertEqual(expdata.analysis_status(), AnalysisStatus.CANCELLED)

@ddt.data(1, 10, 100)
@ddt.data(None, 1, 10, 100)
def test_max_circuits(self, max_experiments):
"""Test running experiment with max_circuits"""

Expand Down

0 comments on commit cff4ad7

Please sign in to comment.