diff --git a/qiskit_optimization/algorithms/scipy_milp_optimizer.py b/qiskit_optimization/algorithms/scipy_milp_optimizer.py index 12eb0a5dc..0b675149b 100644 --- a/qiskit_optimization/algorithms/scipy_milp_optimizer.py +++ b/qiskit_optimization/algorithms/scipy_milp_optimizer.py @@ -17,6 +17,7 @@ from ..problems.quadratic_program import QuadraticProgram from .optimization_algorithm import OptimizationAlgorithm, OptimizationResult + @_optionals.HAS_SCIPY_MILP.require_in_instance class ScipyMilpOptimizer(OptimizationAlgorithm): """The MILP optimizer from Scipy wrapped as an Qiskit :class:`OptimizationAlgorithm`. @@ -79,6 +80,7 @@ def _generate_problem(self, problem: QuadraticProgram): from scipy.optimize import LinearConstraint, Bounds from scipy.sparse import csc_matrix + ## Obtain sense of objective function (+1 for minimization and -1 for maximization) sense = problem.objective.sense.value