MaximizeToMinimize#

class MaximizeToMinimize[source]#

Bases: _FlipProblemSense

Convert a maximization problem to a minimization problem only if it is a maximization problem, otherwise problem's sense is unchanged.

Methods

convert(problem)#

Flip the sense of a problem.

প্যারামিটার:

problem (QuadraticProgram) -- The problem to be flipped.

রিটার্নস:

A converted problem, that has the flipped sense.

রিটার্ন টাইপ:

QuadraticProgram

interpret(x)#

Convert the result of the converted problem back to that of the original problem.

প্যারামিটার:

x (ndarray | List[float]) -- The result of the converted problem or the given result in case of FAILURE.

রিটার্নস:

The result of the original problem.

রেইজেস:

QiskitOptimizationError -- if the number of variables in the result differs from that of the original problem.

রিটার্ন টাইপ:

ndarray