- class InequalityToEquality¶
Convert inequality constraints into equality constraints by introducing slack variables.
>>> from qiskit.optimization.problems import QuadraticProgram >>> from qiskit.optimization.converters import InequalityToEquality >>> problem = QuadraticProgram() >>> # define a problem >>> conv = InequalityToEquality() >>> problem2 = conv.encode(problem)
Convert a result of a converted problem into that of the original problem.
InequalityToEquality.encode(op[, name, mode])
Convert a problem with inequality constraints into one with only equality constraints.