Reference
TensorAlgebra.eigen
— Methodeigen(A::AbstractArray, labels_A, labels_codomain, labels_domain; kwargs...) -> D, V
eigen(A::AbstractArray, biperm::AbstractBlockPermutation{2}; kwargs...) -> D, V
Compute the eigenvalue decomposition of a generic N-dimensional array, by interpreting it as a linear map from the domain to the codomain indices. These can be specified either via their labels, or directly through a biperm
.
Keyword arguments
ishermitian::Bool
: specify if the matrix is Hermitian, which can be used to speed up the computation. Iffalse
, the outputeltype
will always be<:Complex
.trunc
: Truncation keywords foreig(h)_trunc
.- Other keywords are passed on directly to MatrixAlgebraKit.
See also MatrixAlgebraKit.eig_full!
, MatrixAlgebraKit.eig_trunc!
, MatrixAlgebraKit.eig_vals!
, MatrixAlgebraKit.eigh_full!
, MatrixAlgebraKit.eigh_trunc!
, and MatrixAlgebraKit.eigh_vals!
.
TensorAlgebra.eigvals
— Methodeigvals(A::AbstractArray, labels_A, labels_codomain, labels_domain; kwargs...) -> D
eigvals(A::AbstractArray, biperm::AbstractBlockPermutation{2}; kwargs...) -> D
Compute the eigenvalues of a generic N-dimensional array, by interpreting it as a linear map from the domain to the codomain indices. These can be specified either via their labels, or directly through a biperm
. The output is a vector of eigenvalues.
Keyword arguments
ishermitian::Bool
: specify if the matrix is Hermitian, which can be used to speed up the computation. Iffalse
, the outputeltype
will always be<:Complex
.- Other keywords are passed on directly to MatrixAlgebraKit.
See also MatrixAlgebraKit.eig_vals!
and MatrixAlgebraKit.eigh_vals!
.
TensorAlgebra.factorize
— Functionfactorize(A::AbstractArray, labels_A, labels_codomain, labels_domain; kwargs...) -> X, Y
factorize(A::AbstractArray, biperm::AbstractBlockPermutation{2}; kwargs...) -> X, Y
Compute the decomposition of a generic N-dimensional array, by interpreting it as a linear map from the domain to the codomain indices. These can be specified either via their labels, or directly through a biperm
.
Keyword arguments
orth::Symbol=:left
: specify the orthogonality of the decomposition. Currently only:left
and:right
are supported.- Other keywords are passed on directly to MatrixAlgebraKit.
TensorAlgebra.left_null
— Methodleft_null(A::AbstractArray, labels_A, labels_codomain, labels_domain; kwargs...) -> N
left_null(A::AbstractArray, biperm::AbstractBlockPermutation{2}; kwargs...) -> N
Compute the left nullspace of a generic N-dimensional array, by interpreting it as a linear map from the domain to the codomain indices. These can be specified either via their labels, or directly through a biperm
. The output satisfies N' * A ≈ 0
and N' * N ≈ I
.
Keyword arguments
atol::Real=0
: absolute tolerance for the nullspace computation.rtol::Real=0
: relative tolerance for the nullspace computation.kind::Symbol
: specify the kind of decomposition used to compute the nullspace. The options are:qr
,:qrpos
and:svd
. The former two require0 == atol == rtol
. The default is:qrpos
ifatol == rtol == 0
, and:svd
otherwise.
TensorAlgebra.left_orth
— Functionleft_orth(A::AbstractArray, labels_A, labels_codomain, labels_domain; kwargs...) -> V, C
left_orth(A::AbstractArray, biperm::AbstractBlockPermutation{2}; kwargs...) -> V, C
Compute the left orthogonal decomposition of a generic N-dimensional array, by interpreting it as a linear map from the domain to the codomain indices. These can be specified either via their labels, or directly through a biperm
.
Keyword arguments
- Keyword arguments are passed on directly to MatrixAlgebraKit.
See also MatrixAlgebraKit.left_orth!
.
TensorAlgebra.left_polar
— Functionleft_polar(A::AbstractArray, labels_A, labels_codomain, labels_domain; kwargs...) -> W, P
left_polar(A::AbstractArray, biperm::AbstractBlockPermutation{2}; kwargs...) -> W, P
Compute the left polar decomposition of a generic N-dimensional array, by interpreting it as a linear map from the domain to the codomain indices. These can be specified either via their labels, or directly through a biperm
.
Keyword arguments
- Keyword arguments are passed on directly to MatrixAlgebraKit.
See also MatrixAlgebraKit.left_polar!
.
TensorAlgebra.lq
— Functionlq(A::AbstractArray, labels_A, labels_codomain, labels_domain; kwargs...) -> L, Q
lq(A::AbstractArray, biperm::AbstractBlockPermutation{2}; kwargs...) -> L, Q
Compute the LQ decomposition of a generic N-dimensional array, by interpreting it as a linear map from the domain to the codomain indices. These can be specified either via their labels, or directly through a biperm
.
Keyword arguments
full::Bool=false
: select between a "full" or a "compact" decomposition, whereQ
is unitary orL
is square, respectively.positive::Bool=false
: specify if the diagonal ofL
should be positive, leading to a unique decomposition.- Other keywords are passed on directly to MatrixAlgebraKit.
See also MatrixAlgebraKit.lq_full!
and MatrixAlgebraKit.lq_compact!
.
TensorAlgebra.qr
— Functionqr(A::AbstractArray, labels_A, labels_codomain, labels_domain; kwargs...) -> Q, R
qr(A::AbstractArray, biperm::AbstractBlockPermutation{2}; kwargs...) -> Q, R
Compute the QR decomposition of a generic N-dimensional array, by interpreting it as a linear map from the domain to the codomain indices. These can be specified either via their labels, or directly through a biperm
.
Keyword arguments
full::Bool=false
: select between a "full" or a "compact" decomposition, whereQ
is unitary orR
is square, respectively.positive::Bool=false
: specify if the diagonal ofR
should be positive, leading to a unique decomposition.- Other keywords are passed on directly to MatrixAlgebraKit.
See also MatrixAlgebraKit.qr_full!
and MatrixAlgebraKit.qr_compact!
.
TensorAlgebra.right_null
— Methodright_null(A::AbstractArray, labels_A, labels_codomain, labels_domain; kwargs...) -> Nᴴ
right_null(A::AbstractArray, biperm::AbstractBlockPermutation{2}; kwargs...) -> Nᴴ
Compute the right nullspace of a generic N-dimensional array, by interpreting it as a linear map from the domain to the codomain indices. These can be specified either via their labels, or directly through a biperm
. The output satisfies A * Nᴴ' ≈ 0
and Nᴴ * Nᴴ' ≈ I
.
Keyword arguments
atol::Real=0
: absolute tolerance for the nullspace computation.rtol::Real=0
: relative tolerance for the nullspace computation.kind::Symbol
: specify the kind of decomposition used to compute the nullspace. The options are:lq
,:lqpos
and:svd
. The former two require0 == atol == rtol
. The default is:lqpos
ifatol == rtol == 0
, and:svd
otherwise.
TensorAlgebra.right_orth
— Functionright_orth(A::AbstractArray, labels_A, labels_codomain, labels_domain; kwargs...) -> C, V
right_orth(A::AbstractArray, biperm::AbstractBlockPermutation{2}; kwargs...) -> C, V
Compute the right orthogonal decomposition of a generic N-dimensional array, by interpreting it as a linear map from the domain to the codomain indices. These can be specified either via their labels, or directly through a biperm
.
Keyword arguments
- Keyword arguments are passed on directly to MatrixAlgebraKit.
See also MatrixAlgebraKit.right_orth!
.
TensorAlgebra.right_polar
— Functionright_polar(A::AbstractArray, labels_A, labels_codomain, labels_domain; kwargs...) -> P, W
right_polar(A::AbstractArray, biperm::AbstractBlockPermutation{2}; kwargs...) -> P, W
Compute the right polar decomposition of a generic N-dimensional array, by interpreting it as a linear map from the domain to the codomain indices. These can be specified either via their labels, or directly through a biperm
.
Keyword arguments
- Keyword arguments are passed on directly to MatrixAlgebraKit.
See also MatrixAlgebraKit.right_polar!
.
TensorAlgebra.svd
— Methodsvd(A::AbstractArray, labels_A, labels_codomain, labels_domain; kwargs...) -> U, S, Vᴴ
svd(A::AbstractArray, biperm::AbstractBlockPermutation{2}; kwargs...) -> U, S, Vᴴ
Compute the SVD decomposition of a generic N-dimensional array, by interpreting it as a linear map from the domain to the codomain indices. These can be specified either via their labels, or directly through a biperm
.
Keyword arguments
full::Bool=false
: select between a "thick" or a "thin" decomposition, where bothU
andVᴴ
are unitary or isometric.trunc
: Truncation keywords forsvd_trunc
. Not compatible withfull=true
.- Other keywords are passed on directly to MatrixAlgebraKit.
See also MatrixAlgebraKit.svd_full!
, MatrixAlgebraKit.svd_compact!
, and MatrixAlgebraKit.svd_trunc!
.
TensorAlgebra.svdvals
— Methodsvdvals(A::AbstractArray, labels_A, labels_codomain, labels_domain) -> S
svdvals(A::AbstractArray, biperm::AbstractBlockPermutation{2}) -> S
Compute the singular values of a generic N-dimensional array, by interpreting it as a linear map from the domain to the codomain indices. These can be specified either via their labels, or directly through a biperm
. The output is a vector of singular values.
See also MatrixAlgebraKit.svd_vals!
.
TensorAlgebra.MatrixAlgebra.truncdegen
— Methodtruncdegen(trunc::TruncationStrategy; atol::Real=0, rtol::Real=0)
Modify a truncation strategy so that if the truncation falls within a degenerate subspace, the entire subspace gets truncated as well. A value val
is considered degenerate if norm(val - truncval) ≤ max(atol, rtol * norm(truncval))
where truncval
is the largest value truncated by the original truncation strategy trunc
.
For now, this truncation strategy assumes the spectrum being truncated has already been reverse sorted and the strategy being wrapped outputs a contiguous subset of values including the largest one. It also only truncates for now, so may not respect if a minimum dimension was requested in the strategy being wrapped. These restrictions may be lifted in the future or provided through a different truncation strategy.
TensorAlgebra.MatrixAlgebra.truncerr
— Methodtruncerr(; atol::Real=0, rtol::Real=0, p::Int=2)
Create a truncation strategy for truncating such that the error in the factorization is smaller than max(atol, rtol * norm)
, where the error is determined using the p
-norm.