helper.cvx_kron
¶
Kronecker product for CVXPY objects.
Module Contents¶
Functions¶
|
Compute Kronecker product between CVXPY objects. |
- helper.cvx_kron.cvx_kron(expr_1, expr_2)¶
Compute Kronecker product between CVXPY objects.
By default, CVXPY does not support taking the Kronecker product when the argument on the left is equal to a CVXPY object and the object on the right is equal to a numpy object.
At most one of
expr_1
andb
may be CVXPY Variable objects.Kudos to Riley J. Murray for this function [1]
References
[1]Riley J Murray. PR: have kron support non-constant expressions in either argument from CXPY: a python-embedded modeling language for convex optimization problems. https://github.com/cvxpy/cvxpy/issues/457#issue-309891424.
- Parameters:
expr_1 (numpy.ndarray | cvxpy.expressions.expression.Expression) – 2D numpy ndarray, or a CVXPY Variable with expr_1.ndim == 2
expr_2 (numpy.ndarray | cvxpy.expressions.expression.Expression) – 2D numpy ndarray, or a CVXPY Variable with expr_2.ndim == 2
- Returns:
The tensor product of two CVXPY expressions.
- Return type:
cvxpy.expressions.expression.Expression