LinearEqualityToPenalty.encode¶
- LinearEqualityToPenalty.encode(op, penalty_factor=100000.0, name=None)[source]¶
Convert a problem with equality constraints into an unconstrained problem.
- Parameters
op (
QuadraticProgram
) – The problem to be solved, that does not contain inequality constraints.penalty_factor (
float
) – Penalty terms in the objective function is multiplied with this factor.name (
Optional
[str
]) – The name of the converted problem.
- Return type
- Returns
The converted problem, that is an unconstrained problem.
- Raises
QiskitOptimizationError – If an inequality constraint exists.