diff --git a/qiskit_experiments/library/tomography/fitters/cvxpy_utils.py b/qiskit_experiments/library/tomography/fitters/cvxpy_utils.py index af2bc3c0c3..0f544e4b14 100644 --- a/qiskit_experiments/library/tomography/fitters/cvxpy_utils.py +++ b/qiskit_experiments/library/tomography/fitters/cvxpy_utils.py @@ -64,7 +64,9 @@ def decorated_func(*args, **kwargs): return decorated_func -def solve_iteratively(problem: Problem, initial_iters: int, scale: int = 2, **solve_kwargs) -> None: +def solve_iteratively( + problem: Problem, initial_iters: int, scale: int = 2, solver: str = "SCS", **solve_kwargs +) -> None: """Solve a CVXPY problem increasing iterations if solution is inaccurate. If the problem is not solved with the ``initial_iters`` value of @@ -79,6 +81,7 @@ def solve_iteratively(problem: Problem, initial_iters: int, scale: int = 2, **so when solving the problem scale: Scale factor for increasing the initial_iters up to max_iters at each step (Default: 2). + solver: The solver to use. Defaults to the Splitting Conic Solver. solve_kwargs: kwargs for problem.solve method. Raises: @@ -90,7 +93,7 @@ def solve_iteratively(problem: Problem, initial_iters: int, scale: int = 2, **so problem_solved = False while not problem_solved: solve_kwargs["max_iters"] = current_max_iters - problem.solve(**solve_kwargs) + problem.solve(solver=solver, **solve_kwargs) if problem.status in ["optimal_inaccurate", "optimal"]: problem_solved = True elif problem.status == "unbounded_inaccurate": diff --git a/test/library/calibration/test_drag.py b/test/library/calibration/test_drag.py index 89354a8602..b66e735f3b 100644 --- a/test/library/calibration/test_drag.py +++ b/test/library/calibration/test_drag.py @@ -74,6 +74,7 @@ def test_end_to_end(self, freq, betas, p0_opt): self.assertExperimentDone(expdata) result = expdata.analysis_results(1) + # pylint: disable=no-member self.assertTrue(abs(result.value.n - backend.experiment_helper.ideal_beta) < self.test_tol) self.assertEqual(result.quality, "good") self.assertEqual(expdata.metadata["meas_level"], MeasLevel.CLASSIFIED)