tensorA (version 0.36.1)

svd.tensor: Singular value decomposition of tensors

Description

A tensor can be seen as a linear mapping of a tensor to a tensor. This function computes the singular value decomposition of this mapping

Usage

svd.tensor(X,i,j=NULL,...,name="lambda",by=NULL)

Arguments

X

The tensor to be decomposed

i

The image dimensions of the linear mapping

j

The coimage dimensions of the linear mapping

name

The name of the eigenspace dimension. This is the dimension created by the decompositions, in which the eigenvectors are \(e_i\)

further arguments for generic use

by

the operation is done in parallel for these dimensions

Value

a tensor or in case of svd a list u,d,v, of tensors like in svd.

Details

A tensor can be seen as a linear mapping of a tensor to a tensor. Let denote \(R_i\) the space of real tensors with dimensions \(i_1...i_d\).

  • svd.tensorComputes a singular value decomposition \(u_{i_1...i_d\lambda{}}\),\(d_\lambda{}\), \(v_{j_1...j_l}\lambda{}\) such that u and v correspond to orthogonal mappings from \(R_\lambda{}\) to \(R_i\) or \(R_j\) respectively.

See Also

to.tensor, to.matrix.tensor, inv.tensor, solve.tensor

Examples

Run this code
# NOT RUN {
# SVD
A <- to.tensor(rnorm(120),c(a=2,b=2,c=5,d=3,e=2))

SVD <- svd.tensor(A,c("a","d"),c("b","c"),by="e")
dim(SVD$v)
# Property of decomposition
einstein.tensor(SVD$v,diag=SVD$d,SVD$u,by="e") # A
# Property of orthogonality
SVD$v %e% SVD$v[[lambda=~"lambda'"]]         # 2*delta.tensor(c(lambda=6))
SVD$u %e% SVD$u[[lambda=~"lambda'"]]         # 2*delta.tensor(c(lambda=6)))
SVD$u %e% mark(SVD$u,"'",c("a","d"))  # 2*delta.tensor(c(a=2,d=3)))



# }

Run the code above in your browser using DataLab