Reference

TensorAlgebra.eigenMethod
eigen(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. If false, the output eltype will always be <:Complex.
  • trunc: Truncation keywords for eig(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!.

source
TensorAlgebra.eigvalsMethod
eigvals(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. If false, the output eltype will always be <:Complex.
  • Other keywords are passed on directly to MatrixAlgebraKit.

See also MatrixAlgebraKit.eig_vals! and MatrixAlgebraKit.eigh_vals!.

source
TensorAlgebra.factorizeFunction
factorize(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.
source
TensorAlgebra.left_nullMethod
left_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 require 0 == atol == rtol. The default is :qrpos if atol == rtol == 0, and :svd otherwise.
source
TensorAlgebra.left_orthFunction
left_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!.

source
TensorAlgebra.left_polarFunction
left_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!.

source
TensorAlgebra.lqFunction
lq(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, where Q is unitary or L is square, respectively.
  • positive::Bool=false: specify if the diagonal of L 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!.

source
TensorAlgebra.qrFunction
qr(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, where Q is unitary or R is square, respectively.
  • positive::Bool=false: specify if the diagonal of R 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!.

source
TensorAlgebra.right_nullMethod
right_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 require 0 == atol == rtol. The default is :lqpos if atol == rtol == 0, and :svd otherwise.
source
TensorAlgebra.right_orthFunction
right_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!.

source
TensorAlgebra.right_polarFunction
right_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!.

source
TensorAlgebra.svdMethod
svd(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 both U and Vᴴ are unitary or isometric.
  • trunc: Truncation keywords for svd_trunc. Not compatible with full=true.
  • Other keywords are passed on directly to MatrixAlgebraKit.

See also MatrixAlgebraKit.svd_full!, MatrixAlgebraKit.svd_compact!, and MatrixAlgebraKit.svd_trunc!.

source
TensorAlgebra.svdvalsMethod
svdvals(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!.

source
TensorAlgebra.MatrixAlgebra.truncdegenMethod
truncdegen(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.

source
TensorAlgebra.MatrixAlgebra.truncerrMethod
truncerr(; 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.

source