Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update scipy_milp_optimizer.py
Browse files Browse the repository at this point in the history
Dran-Z committed Dec 6, 2022
1 parent 7fcf2ea commit d9bb223
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qiskit_optimization/algorithms/scipy_milp_optimizer.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d9bb223

Please sign in to comment.