SymmetricKronecker¶
-
class
probnum.linalg.linops.
SymmetricKronecker
(A, B=None, dtype=None)[source]¶ Bases:
probnum.linalg.linops.LinearOperator
Symmetric Kronecker product of two linear operators.
The symmetric Kronecker product [1] \(A \otimes_{s} B\) of two square linear operators \(A\) and \(B\) maps a symmetric linear operator \(X\) to \(\mathbb{R}^{\frac{1}{2}n (n+1)}\). It is given by
\[(A \otimes_{s} B)\operatorname{svec}(X) = \frac{1}{2} \operatorname{svec}(AXB^{\top} + BXA^{\top})\]where \(\operatorname{svec}(X) = (X_{11}, \sqrt{2} X_{12}, \dots, X_{1n}, X_{22}, \sqrt{2} X_{23}, \dots, \sqrt{2}X_{2n}, \dots X_{nn})^{\top}\) is the (row-wise, normalized) symmetric stacking operator. The implementation is based on the relationship \(Q^\top \operatorname{svec}(X) = \operatorname{vec}(X)\) with an orthonormal matrix \(Q\) [2].
Note
The symmetric Kronecker product has a symmetric matrix representation if both \(A\) and \(B\) are symmetric.
References
[1] Van Loan, C. F., The ubiquitous Kronecker product, Journal of Computational and Applied Mathematics, 2000, 123, 85-100 [2] De Klerk, E., Aspects of Semidefinite Programming, Kluwer Academic Publishers, 2002 See also
Kronecker
- The Kronecker product of two linear operators.
Attributes Summary
H
Hermitian adjoint. T
Transpose this linear operator. ndim
Methods Summary
__call__
(x)Call self as a function. adjoint
()Hermitian adjoint. cond
([p])Compute the condition number of the linear operator. det
()Determinant of the linear operator. dot
(x)Matrix-matrix or matrix-vector multiplication. eigvals
()Eigenvalue spectrum of the linear operator. inv
()Inverse of the linear operator. logabsdet
()Log absolute determinant of the linear operator. matmat
(X)Matrix-matrix multiplication. matvec
(x)Matrix-vector multiplication. rank
()Rank of the linear operator. rmatmat
(X)Adjoint matrix-matrix multiplication. rmatvec
(x)Adjoint matrix-vector multiplication. todense
()Dense representation of the symmetric Kronecker product trace
()Trace of the linear operator. transpose
()Transpose this linear operator. Attributes Documentation
-
H
¶ Hermitian adjoint.
Returns the Hermitian adjoint of self, aka the Hermitian conjugate or Hermitian transpose. For a complex matrix, the Hermitian adjoint is equal to the conjugate transpose.
Can be abbreviated self.H instead of self.adjoint().
Returns: A_H – Hermitian adjoint of self. Return type: LinearOperator
-
T
¶ Transpose this linear operator.
Can be abbreviated self.T instead of self.transpose().
-
ndim
= 2¶
Methods Documentation
-
__call__
(x)¶ Call self as a function.
-
adjoint
()¶ Hermitian adjoint.
Returns the Hermitian adjoint of self, aka the Hermitian conjugate or Hermitian transpose. For a complex matrix, the Hermitian adjoint is equal to the conjugate transpose.
Can be abbreviated self.H instead of self.adjoint().
Returns: A_H – Hermitian adjoint of self. Return type: LinearOperator
-
cond
(p=None)¶ Compute the condition number of the linear operator.
The condition number of the linear operator with respect to the
p
norm. It measures how much the solution \(x\) of the linear system \(Ax=b\) changes with respect to small changes in \(b\).Parameters: p ({None, 1, , 2, , inf, 'fro'}, optional) – Order of the norm:
p norm for matrices None 2-norm, computed directly via singular value decomposition ’fro’ Frobenius norm np.inf max(sum(abs(x), axis=1)) 1 max(sum(abs(x), axis=0)) 2 2-norm (largest sing. value) Returns: cond – The condition number of the linear operator. May be infinite. Return type: {float, inf}
-
det
()¶ Determinant of the linear operator.
-
dot
(x)¶ Matrix-matrix or matrix-vector multiplication.
Parameters: x (array_like) – 1-d or 2-d array, representing a vector or matrix. Returns: Ax – 1-d or 2-d array (depending on the shape of x) that represents the result of applying this linear operator on x. Return type: array
-
eigvals
()¶ Eigenvalue spectrum of the linear operator.
-
logabsdet
()¶ Log absolute determinant of the linear operator.
-
matmat
(X)¶ Matrix-matrix multiplication.
Performs the operation y=A*X where A is an MxN linear operator and X dense N*K matrix or ndarray.
Parameters: X ({matrix, ndarray}) – An array with shape (N,K). Returns: Y – A matrix or ndarray with shape (M,K) depending on the type of the X argument. Return type: {matrix, ndarray} Notes
This matmat wraps any user-specified matmat routine or overridden _matmat method to ensure that y has the correct type.
-
matvec
(x)¶ Matrix-vector multiplication. Performs the operation y=A*x where A is an MxN linear operator and x is a 1-d array or random variable.
Parameters: x ({matrix, ndarray, RandomVariable}) – An array or RandomVariable with shape (N,) or (N,1). Returns: y – A matrix or ndarray or RandomVariable with shape (M,) or (M,1) depending on the type and shape of the x argument. Return type: {matrix, ndarray} Notes
This matvec wraps the user-specified matvec routine or overridden _matvec method to ensure that y has the correct shape and type.
-
rank
()¶ Rank of the linear operator.
-
rmatmat
(X)¶ Adjoint matrix-matrix multiplication.
Performs the operation y = A^H * x where A is an MxN linear operator and x is a column vector or 1-d array, or 2-d array. The default implementation defers to the adjoint.
Parameters: X ({matrix, ndarray}) – A matrix or 2D array. Returns: Y – A matrix or 2D array depending on the type of the input. Return type: {matrix, ndarray} Notes
This rmatmat wraps the user-specified rmatmat routine.
-
rmatvec
(x)¶ Adjoint matrix-vector multiplication.
Performs the operation y = A^H * x where A is an MxN linear operator and x is a column vector or 1-d array.
Parameters: x ({matrix, ndarray}) – An array with shape (M,) or (M,1). Returns: y – A matrix or ndarray with shape (N,) or (N,1) depending on the type and shape of the x argument. Return type: {matrix, ndarray} Notes
This rmatvec wraps the user-specified rmatvec routine or overridden _rmatvec method to ensure that y has the correct shape and type.
-
trace
()¶ Trace of the linear operator.
Computes the trace of a square linear operator \(\text{tr}(A) = \sum_{i-1}^n A_ii\).
Returns: trace – Trace of the linear operator. Return type: float Raises: ValueError : If trace()
is called on a non-square matrix.
-
transpose
()¶ Transpose this linear operator.
Can be abbreviated self.T instead of self.transpose().