## Outline¶

### Classes¶

 ConicQuadraticConstraint Bound on a nearly convex quadratic expression. ConvexQuadraticConstraint Bound on a convex quadratic expression. NonconvexQuadraticConstraint Bound on a nonconvex quadratic expression.

## Classes¶

class picos.constraints.con_quadratic.ConicQuadraticConstraint(lhs, relation, rhs)[source]

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 .

Whether a constraint of this type is strengthened to a conic constraint or relabeled as a NonconvexQuadraticConstraint depends on the assume_conic option.

Example

>>> 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())[0]
<4×1 RSOC Constraint: ‖fullroot(x² + 1)‖² ≤ y·z ∧ y ≥ 0>
>>> Q = C.__class__.Conversion.convert(C, Options(assume_conic=False))
>>> list(Q.constraints.values())[0]
<Nonconvex Quadratic Constraint: x² + 1 ≤ y·z>


Note

Solver implementations must not support this constraint type so that the user’s choice for the assume_conic option is respected.

class Conversion[source]

Nearly convex quadratic to (rotated) second order cone conversion.

classmethod convert(con, options)[source]

Implement convert.

classmethod predict(subtype, options)[source]

Implement predict.

__init__(lhs, relation, rhs)[source]

Construct a ConicQuadraticConstraint.

See NonconvexQuadraticConstraint.__init__ for more.

class picos.constraints.con_quadratic.ConvexQuadraticConstraint(lhs, relation, rhs)[source]

Bound on a convex quadratic expression.

class ConicConversion[source]

Convex quadratic to (rotated) second order cone conversion.

classmethod convert(con, options)[source]

Implement convert.

classmethod predict(subtype, options)[source]

Implement predict.

__init__(lhs, relation, rhs)[source]

Construct a ConvexQuadraticConstraint.

See NonconvexQuadraticConstraint.__init__ for more.

class picos.constraints.con_quadratic.NonconvexQuadraticConstraint(lhs, relation, rhs)[source]

Bound on a nonconvex quadratic expression.

__init__(lhs, relation, rhs)[source]

Construct a NonconvexQuadraticConstraint.

Parameters
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.