Quadratic constraint types.
- class picos.constraints.con_quadratic.ConicQuadraticConstraint(lhs, relation, rhs)¶
Bound on a nearly convex quadratic expression.
Nearly convex means that the bilinear form representing the quadratic part of the expression that the constraint poses to be at most zero has exactly one negative eigenvalue. More precisely, if the constraint is of the form , then Q - R needs to have exactly one negative eigenvalue for the constraint to be nearly convex. Such constraints can be posed as conic constraints under an additional assumption that some affine term is nonnegative.
At this point, this class may only be used for nonconvex constraints of the form with representable as a squared norm. In this case, the additional assumptions required for a conic reformulation are and .
>>> from picos import Options, RealVariable >>> x, y, z = RealVariable("x"), RealVariable("y"), RealVariable("z") >>> C = x**2 + 1 <= y*z; C <Conic Quadratic Constraint: x² + 1 ≤ y·z> >>> P = C.__class__.Conversion.convert(C, Options(assume_conic=True)) >>> list(P.constraints.values()) <4×1 RSOC Constraint: ‖fullroot(x² + 1)‖² ≤ y·z ∧ y, z ≥ 0> >>> Q = C.__class__.Conversion.convert(C, Options(assume_conic=False)) >>> list(Q.constraints.values()) <Nonconvex Quadratic Constraint: x² + 1 ≤ y·z>
Solver implementations must not support this constraint type so that the user’s choice for the assume_conic option is respected.
- class Conversion¶
Nearly convex quadratic to (rotated) second order cone conversion.
- class picos.constraints.con_quadratic.ConvexQuadraticConstraint(lhs, relation, rhs)¶
Bound on a convex quadratic expression.
- class ConicConversion¶
Convex quadratic to (rotated) second order cone conversion.
- class picos.constraints.con_quadratic.NonconvexQuadraticConstraint(lhs, relation, rhs)¶
Bound on a nonconvex quadratic expression.
- __init__(lhs, relation, rhs)¶
- property greater¶
Greater-or-equal side of the constraint.
- property le0¶
Quadratic expression constrained to be at most zero.
- property smaller¶
Smaller-or-equal side of the constraint.