Matrix Properties
MatrixAlgebraKit.jl provides a number of methods to check various properties of matrices.
MatrixAlgebraKit.isisometric — Function
isisometric(A; side=:left, isapprox_kwargs...) -> BoolTest whether a linear map is an isometry, where the type of isometry is controlled by kind:
side = :left:A' * A ≈ I.side = :right:A * A' ≈ I.
The isapprox_kwargs are passed on to isapprox to control the tolerances.
New specializations should overload MatrixAlgebraKit.is_left_isometric and MatrixAlgebraKit.is_right_isometric.
See also isunitary.
MatrixAlgebraKit.isunitary — Function
isunitary(A; isapprox_kwargs...)Test whether a linear map is unitary, i.e. A * A' ≈ I ≈ A' * A. The isapprox_kwargs are passed on to isapprox to control the tolerances.
See also isisometric.
MatrixAlgebraKit.ishermitian — Function
ishermitian(A; isapprox_kwargs...)Test whether a linear map is Hermitian, i.e. A = A'. The isapprox_kwargs can be used to control the tolerances of the equality.
MatrixAlgebraKit.isantihermitian — Function
isantihermitian(A; isapprox_kwargs...)Test whether a linear map is anti-Hermitian, i.e. A = -A'. The isapprox_kwargs can be used to control the tolerances of the equality.
Furthermore, there are also methods to project a matrix onto the nearest matrix (in 2-norm distance) with a given property.
MatrixAlgebraKit.project_isometric — Function
project_isometric(A; kwargs...)
project_isometric(A, alg)
project_isometric!(A, [W]; kwargs...)
project_isometric!(A, [W], alg)Compute the projection of A onto the manifold of isometric matrices, i.e. matrices satisfying A' * A ≈ I. This projection is computed via the polar decomposition, i.e. W corresponds to the first return value of left_polar!, but avoids computing the positive definite factor explicitly.
MatrixAlgebraKit.project_hermitian — Function
project_hermitian(A; kwargs...)
project_hermitian(A, alg)
project_hermitian!(A, [Aₕ]; kwargs...)
project_hermitian!(A, [Aₕ], alg)Compute the hermitian part of a (square) matrix A, defined as (A + A') / 2. For real matrices this corresponds to the symmetric part of A. In the bang method, the output storage can be provided via the optional argument Aₕ; by default it is equal to A and so the input matrix A is replaced by its hermitian projection.
See also project_antihermitian.
MatrixAlgebraKit.project_antihermitian — Function
project_antihermitian(A; kwargs...)
project_antihermitian(A, alg)
project_antihermitian!(A, [Aₐ]; kwargs...)
project_antihermitian!(A, [Aₐ], alg)Compute the anti-hermitian part of a (square) matrix A, defined as (A - A') / 2. For real matrices this corresponds to the antisymmetric part of A. In the bang method, the output storage can be provided via the optional argument Aₐ; by default it is equal toAand so the input matrixA` is replaced by its antihermitian projection.
See also project_hermitian.