TensorToolbox

← Back to package list

If you think that there is an error in how your package is being tested or represented, please file an issue at NewPkgEval.jl, making sure to read the FAQ first.

Results with Julia v1.2.0

Testing was successful. Last evaluation was ago and took 2 minutes, 11 seconds.

Click here to download the log file.

 Resolving package versions...
 Installed TensorToolbox ─ v1.0.1
  Updating `~/.julia/environments/v1.2/Project.toml`
  [9c690861] + TensorToolbox v1.0.1
  Updating `~/.julia/environments/v1.2/Manifest.toml`
  [9c690861] + TensorToolbox v1.0.1
  [2a0f44e3] + Base64 
  [8ba89e20] + Distributed 
  [b77e0a4c] + InteractiveUtils 
  [8f399da3] + Libdl 
  [37e2e46d] + LinearAlgebra 
  [56ddb016] + Logging 
  [d6f4376e] + Markdown 
  [9a3f8284] + Random 
  [9e88b42a] + Serialization 
  [6462fe0b] + Sockets 
  [8dfed614] + Test 
   Testing TensorToolbox
    Status `/tmp/jl_0ktnzL/Manifest.toml`
  [9c690861] TensorToolbox v1.0.1
  [2a0f44e3] Base64  [`@stdlib/Base64`]
  [8ba89e20] Distributed  [`@stdlib/Distributed`]
  [b77e0a4c] InteractiveUtils  [`@stdlib/InteractiveUtils`]
  [8f399da3] Libdl  [`@stdlib/Libdl`]
  [37e2e46d] LinearAlgebra  [`@stdlib/LinearAlgebra`]
  [56ddb016] Logging  [`@stdlib/Logging`]
  [d6f4376e] Markdown  [`@stdlib/Markdown`]
  [9a3f8284] Random  [`@stdlib/Random`]
  [9e88b42a] Serialization  [`@stdlib/Serialization`]
  [6462fe0b] Sockets  [`@stdlib/Sockets`]
  [8dfed614] Test  [`@stdlib/Test`]



**** Testing tensor.jl

**Test tensor X of size: (20, 10, 50, 5)

...Testing functions matten and tenmat (by mode).
Size of 1-mode matricization: [20, 2500]
Check if it folds back correctly: true
Size of 2-mode matricization: [10, 5000]
Check if it folds back correctly: true
Size of 3-mode matricization: [50, 1000]
Check if it folds back correctly: true
Size of 4-mode matricization: [5, 10000]
Check if it folds back correctly: true

...Testing functions matten and tenmat (by rows and columns).
Size of R=[2, 1] and C=[4, 3] matricization: [200, 250]
Check if it folds back correctly: true

...Testing function ttm.
Created 4 matrices with 5 rows and appropriate number of columns.
Size of tensor Y=ttm(X,M): (5, 5, 5, 5)
Multiplication error: 1.0614966277205394e-11

...Testing function ttv.
Multiplying a tensor X by a vector v in mode 2.
Size of tensor Y=ttv(X,v): (3, 2)

...Testing function krontm.
Created two tensors X and Y of order 3 and sizes (5, 4, 3) and (2, 5, 4).
Multiplying tkron(X,Y) by random matrix in mode 3.
Multiplication error: 1.4291399519651272e-14
Multiplying tkron(X,Y) by random matrices in modes [3, 2].
Multiplication error: 1.1463352458670898e-13
Multiplying tkron(X,Y) by random matrices in all modes.
Multiplication error: 6.48036789554587e-13

...Testing function mkrontv.
Multiplying mode-1 matricized tkron(X,Y) by a random vector.
Multiplication error: 3.056159864571351e-14
Multiplication error: 3.394700931633811e-15

...Testing function mttkrp.
Multiplying mode-1 matricized tensor X by Khatri-Rao product of matrices.
Multiplication error: 0.0

...Testing function dropdims.
Tensor X of size :(5, 4, 1, 3, 6, 1) squeezed to size :(5, 4, 3, 6).

...Testing contraction (contract).
Error: 0.0


****Testing ttensor.jl

...Test tensor X of size: (20, 10, 50, 5)

...Testing hosvd.

Creating exact decomposition with rank = size(X):
Results:
Type of output T: ttensor
Core tensor size: (20, 10, 50, 5)
Factor matrices sizes: (20, 20) (10, 10) (50, 50) (5, 5) 

...Testing function full, i.e. n-mode multiplication (ttm): norm(full(T)-X) = 1.9199629166202601e-13

...Testing ttm for ttensor T and array of matrices A : norm(full(ttm(T,A))-ttm(full(T),A)) = 1.8622098354261415e-11

...Testing hosvd with smaller multilinear rank: [5, 5, 5, 5]
Results:
Type of output T: ttensor
Core tensor size: (5, 5, 5, 5)
Factor matrices sizes: (20, 5) (10, 5) (50, 5) (5, 5) 

...Testing size of ttensor T : (20, 10, 50, 5)

...Testing ndims of ttensor T : 4

...Testing nrank of ttensor T for mode 1: 5

...Testing mrank of ttensor T: (5, 5, 5, 5)

...Testing functions matten and tenmat (by mode).


...Testing hosvd for tensor with noise.
For ttensor T, X=full(T) tensor of size (60, 50, 40) and rank [5, 5, 5] , N noise tensor and S=hosvd(X+N,[5, 5, 5]).
Error( norm(T-S) ): 0.014335549136667212. Noise norm: 0.17301045307868618.


...Testing hosvd with eps_abs=1e-5 on function defined tensor X of size (20, 20, 20) and multlinear rank(13, 13, 13)
Results:
Type of output T: ttensor
Core tensor size: (7, 7, 7)
Factor matrices sizes: (20, 7) (20, 7) (20, 7) 

...Testing hosvd with eps_rel=1e-5 on function defined tensor X of size (20, 20, 20)
Results:
Type of output T: ttensor
Core tensor size: (6, 6, 6)
Factor matrices sizes: (20, 6) (20, 6) (20, 6) 

...Testing if factor matrices of ttensor T are orthogonal: true


...Recompress Tucker tensor T to smaller rank: [3, 3, 3]
Results:
Type of output T: ttensor
Core tensor size: (3, 3, 3)
Factor matrices sizes: (20, 3) (20, 3) (20, 3) 

...Testing orthogonal flag and reorthogonalization for random ttensor S of size (4, 5, 2).
Has orthogonal factor matrices: false
After reorthogonalization: true


...Testing norm of ttensor T.
|norm(T) - norm(full(T))| = 0.0


...Testing scalar multiplication 3*T.
norm(full(3*T) - 3*full(T)) = 2.762916642284124e-14


...Creating two random ttensors X and Y of size (6, 8, 2, 5, 4).

...Testing addition.
norm(full(X+Y) - (full(X)+full(Y))) = 1.2030301882854682e-13


...Testing inner product.
|innerprod(X,Y) - innerprod(full(X),full(Y))| = 4.547473508864641e-13


...Testing Hadamard product.
norm(full(ewprod(X,Y)) - full(X).*full(Y)) = 7.788617354608023e-13


...Testing singular values of matricizations of Tucker Tensor.

Singular values of matricizations of random Tucker tensor of size (10, 9, 8), rank [3, 3, 3] and norm 95.56446250783841.
Mode-1 singular values error: 3.332740845837229e-14
Mode-2 singular values error: 3.256115871121665e-14
Mode-3 singular values error: 4.3366397107056194e-14

Singular values of matricizations of random Tucker tensor of size (20, 20, 20, 20), rank [5, 5, 5, 5] and norm 9140.088731326556.
Mode-1 singular values error: 5.8810279171564445e-12
Mode-2 singular values error: 3.183231456205249e-12
Mode-3 singular values error: 3.83176928752453e-12
Mode-4 singular values error: 2.2737367544323206e-12

...Testing function mhadtv.


...Creating two random ttensors X and Y of size (5, 4, 3).
Multiplying mode-1 matricized ewprod(X,Y) by a random vector.
Multiplication error: 7.03065769189946e-15
Multiplication error: 1.0400858617096978e-14
Multiplication error: 1.078814721512637e-12

...Testing function mttkrp.
Multiplying mode-1 matricized tensor X by Khatri-Rao product of matrices.
Multiplication error: 2.148324584118883e-15

...Testing cp_als on ttensor.
Test rank-1 ttensor T of size: (5, 4, 3)
norm(full(Tcp)-T) = 3.208599566768793e-16


****Testing ktensor.jl

**Test rank-1 tensor X of size: (5, 4, 3)
...Testing cp_als.
norm(full(Xcp)-X) = 6.226787440222654e-16

**Test ktensors X and Y of size: (4, 3, 2)

...Testing function ndims.
X is of order: 3
...Testing function ttensor and full.
...Testing scalar multiplication.
norm(full(3*X) - 3*full(X)) = 1.3797236336603623e-15
...Testing functions plus and minus.
norm(full(Z)-(full(X)+full(Y))) = 2.891945847262976e-16
norm(full(Z)-(full(X)-full(Y))) = 9.490824173852923e-16
...Testing function innerprod.
norm(innerprod(X,Y)-innerprod(full(X),full(Y))) = 1.3322676295501878e-15
...Testing function norm.
...Testing functions arrange and arrange!.
norm(full(X)-full(Z)) = 5.261019068567312e-16
...Testing functions normalize and normalize!.
norm(full(X)-full(Z)) = 5.567057530901541e-16
...Testing functions redistribute and redistribute!.
norm(full(X)-full(Z)) = 5.161361836466869e-16
...Testing functions fixsigns, fixsigns! and isequal.
norm(full(X)-full(Z)) = 0.0
...Testing functions ttm and ttv.

...Testing function tocell.
Is the output MatrixCell: true

...Testing function tenmat by mode 2.

...Testing function mttkrp.
Multiplying mode-1 matricized tensor X by Khatri-Rao product of matrices.
Multiplication error: 1.3229106320778743e-15


****Testing dimtree.jl

...Testing creating a dimtree.
...Testing function non (number-of-nodes).

...Created two dimtrees for tensor of order 5, with 9 nodes.

...Testing functions:
 - height
 - children
 - sibling
 - parent
 - is_leaf
 - is_left
 - is_right
 - count_leaves
 - dims
 - lvl
 - nodes_on_lvl
 - node2ind
 - subnodes
 - left_child_length


Testing truncation of tensor X of size (2, 2, 2, 2, 2) to htensor.
norm(full(H)-X) = 9.642055270146469e-14
norm(full(H)-X) = 9.324974611567615e-14


...Testing size of htensor H : (5, 4, 3, 2, 4, 2)

...Testing ndims of htensor H : 6

...Testing ttm for ttensor H and array of matrices A : norm(full(ttm(H,A))-ttm(full(H),A)) = 2.4814352024564893e-13


...Testing norm of htensor H.
|norm(H) - norm(full(H))| = 1.0658141036401503e-14


...Testing scalar multiplication 3*H.
norm(full(3*H) - 3*full(H)) = 2.0587825671115578e-14


Testing functions plus and minus for htensors H1 and H2.
norm(full(H1+H2) - (full(H1)+full(H2))) = 9.542429867210369e-16
norm(full(H1+H2) - (full(H1)+full(H2))) = 7.723163476444606e-16


...Testing inner product.
|innerprod(H1,H2) - innerprod(full(H1),full(H2))| = 7.105427357601002e-15


Testing function dropdims for squeezed tensor X and squeezed htensor Y.
norm(full(Y)-dropdims(X,dims=1)) = 4.9696627478973456e-15
norm(full(Y)-dropdims(X,dims=2)) = 6.329610183504276e-15
norm(full(Y)-dropdims(X,dims=3)) = 5.093587695826778e-15
norm(full(Y)-dropdims(X,dims=4)) = 4.558214466076628e-15
norm(full(Y)-dropdims(X,dims=5)) = 3.725704666073741e-15


...Testing reorthogonalization for random htensor H of size (4, 5, 2).
Has orthogonal factor matrices: false
After reorthogonalization: true
Testing hrank: [1, 2, 2, 2, 2]


****Testing TTtensor.jl

...Test core tensors G of sizes: 
(1, 4, 3)
(3, 6, 4)
(4, 3, 1)

...Test size of TTtensor T: (4, 6, 3)

...Test ndims of TTtensor T: 3

...Test TTsvd of TTtensor T: (3, 4)

...Test addition: 

...Test dot product: 

...Test tensor X of size: (5, 4, 3, 2)

...Testing TTsvd.
Results:
Type of output T: TTtensor

...Testing function full, i.e. contracted product (conprod): norm(full(T)-X) = 4.543062356583449e-15

...Testing TTsvd with requested rank.
Created tensor x of size (6, 5, 6, 5), with TTrank = (4, 4, 4).
T1=TTsvd(X,reqrank=[4, 4, 4])
norm(X-full(T1)) = 8.129410518171415e-14

...Testing recompression.
S=TTsvd(T): norm(full(S)-X) = 6.062061714602967e-14

...Testing reorthogonalization - function reorth.
Test TT-tensor T of size: (6, 5, 4, 3) with flags T.lorth = false and T.rorth = false.

Performing (default) left orthogonalization: Tl=reorth(T).
Flags: Tl.lorth = true, Tl.rorth = false.

Performing right orthogonalization: Tr=reorth(T,"right").
Flags: Tr.lorth = false, Tr.rorth = true.
norm(Diagonal(ones(size(Gn, 1))) - Gn * Gn') = 2.7323095490488697e-16
norm(Diagonal(ones(size(Gn, 1))) - Gn * Gn') = 6.330441298195492e-16

...Testing reorthogonalization with overwriting - function reorth!.

Performing (default) left orthogonalization: reorth!(T)
Flags: T.lorth = true, T.rorth = false.

Performing right orthogonalization: reorth!(T,"right")
Flags: T.lorth = true, T.rorth = true.

...Testing TTsvd on TT-tensors.

Fixed precision problem with ϵ = 1.0e-8.
Created TT-tensor T of size (6, 5, 6, 5), with TTrank = (4, 4, 4), but its actual TT-rank is (2,2,2)
T1=TTsvd(T,ϵ)
TTrank(T1) = (2, 2, 2)
norm(full(T)-full(T1)) = 4.87629365764864e-14

Fixed rank problem with reqrank = [2, 2, 2].
Created TT-tensor T of size (6, 5, 4, 3), with TTrank = (6, 12, 3).
T1=TTsvd(T,reqrank=[2, 2, 2])
TTrank(T1) = (2, 2, 2)

... Testing contraction with vectors - function TTtv.

... Testing transformation of ktensor to TTtensor - function kten2TT.
Test ktensor T of size (5, 4, 3, 2), and k-rank = 3, transofrming to TTtensor Ttt.
norm(full(T)-full(Ttt)) = 0.0

... Testing contraction of full tensor to TTtensor - function contract.

... Testing element-wise product of two TTtensor - function ewprod.



   Testing TensorToolbox tests passed 

Results with Julia v1.3.0

Testing was successful. Last evaluation was ago and took 2 minutes, 29 seconds.

Click here to download the log file.

 Resolving package versions...
 Installed TensorToolbox ─ v1.0.1
  Updating `~/.julia/environments/v1.3/Project.toml`
  [9c690861] + TensorToolbox v1.0.1
  Updating `~/.julia/environments/v1.3/Manifest.toml`
  [9c690861] + TensorToolbox v1.0.1
  [2a0f44e3] + Base64 
  [8ba89e20] + Distributed 
  [b77e0a4c] + InteractiveUtils 
  [8f399da3] + Libdl 
  [37e2e46d] + LinearAlgebra 
  [56ddb016] + Logging 
  [d6f4376e] + Markdown 
  [9a3f8284] + Random 
  [9e88b42a] + Serialization 
  [6462fe0b] + Sockets 
  [8dfed614] + Test 
   Testing TensorToolbox
    Status `/tmp/jl_IASp4H/Manifest.toml`
  [9c690861] TensorToolbox v1.0.1
  [2a0f44e3] Base64  [`@stdlib/Base64`]
  [8ba89e20] Distributed  [`@stdlib/Distributed`]
  [b77e0a4c] InteractiveUtils  [`@stdlib/InteractiveUtils`]
  [8f399da3] Libdl  [`@stdlib/Libdl`]
  [37e2e46d] LinearAlgebra  [`@stdlib/LinearAlgebra`]
  [56ddb016] Logging  [`@stdlib/Logging`]
  [d6f4376e] Markdown  [`@stdlib/Markdown`]
  [9a3f8284] Random  [`@stdlib/Random`]
  [9e88b42a] Serialization  [`@stdlib/Serialization`]
  [6462fe0b] Sockets  [`@stdlib/Sockets`]
  [8dfed614] Test  [`@stdlib/Test`]



**** Testing tensor.jl

**Test tensor X of size: (20, 10, 50, 5)

...Testing functions matten and tenmat (by mode).
Size of 1-mode matricization: [20, 2500]
Check if it folds back correctly: true
Size of 2-mode matricization: [10, 5000]
Check if it folds back correctly: true
Size of 3-mode matricization: [50, 1000]
Check if it folds back correctly: true
Size of 4-mode matricization: [5, 10000]
Check if it folds back correctly: true

...Testing functions matten and tenmat (by rows and columns).
Size of R=[2, 1] and C=[4, 3] matricization: [200, 250]
Check if it folds back correctly: true

...Testing function ttm.
Created 4 matrices with 5 rows and appropriate number of columns.
Size of tensor Y=ttm(X,M): (5, 5, 5, 5)
Multiplication error: 7.500747052839271e-12

...Testing function ttv.
Multiplying a tensor X by a vector v in mode 2.
Size of tensor Y=ttv(X,v): (3, 2)

...Testing function krontm.
Created two tensors X and Y of order 3 and sizes (5, 4, 3) and (2, 5, 4).
Multiplying tkron(X,Y) by random matrix in mode 3.
Multiplication error: 1.2537928466057885e-14
Multiplying tkron(X,Y) by random matrices in modes [3, 2].
Multiplication error: 1.0280257558663545e-13
Multiplying tkron(X,Y) by random matrices in all modes.
Multiplication error: 6.528008669476721e-13

...Testing function mkrontv.
Multiplying mode-1 matricized tkron(X,Y) by a random vector.
Multiplication error: 2.218668981299174e-14
Multiplication error: 1.9641850382783467e-15

...Testing function mttkrp.
Multiplying mode-1 matricized tensor X by Khatri-Rao product of matrices.
Multiplication error: 0.0

...Testing function dropdims.
Tensor X of size :(5, 4, 1, 3, 6, 1) squeezed to size :(5, 4, 3, 6).

...Testing contraction (contract).
Error: 0.0


****Testing ttensor.jl

...Test tensor X of size: (20, 10, 50, 5)

...Testing hosvd.

Creating exact decomposition with rank = size(X):
Results:
Type of output T: ttensor
Core tensor size: (20, 10, 50, 5)
Factor matrices sizes: (20, 20) (10, 10) (50, 50) (5, 5) 

...Testing function full, i.e. n-mode multiplication (ttm): norm(full(T)-X) = 1.849123653746041e-13

...Testing ttm for ttensor T and array of matrices A : norm(full(ttm(T,A))-ttm(full(T),A)) = 1.0982407434979288e-11

...Testing hosvd with smaller multilinear rank: [5, 5, 5, 5]
Results:
Type of output T: ttensor
Core tensor size: (5, 5, 5, 5)
Factor matrices sizes: (20, 5) (10, 5) (50, 5) (5, 5) 

...Testing size of ttensor T : (20, 10, 50, 5)

...Testing ndims of ttensor T : 4

...Testing nrank of ttensor T for mode 1: 5

...Testing mrank of ttensor T: (5, 5, 5, 5)

...Testing functions matten and tenmat (by mode).


...Testing hosvd for tensor with noise.
For ttensor T, X=full(T) tensor of size (60, 50, 40) and rank [5, 5, 5] , N noise tensor and S=hosvd(X+N,[5, 5, 5]).
Error( norm(T-S) ): 0.014065007996964037. Noise norm: 0.17336643891832393.


...Testing hosvd with eps_abs=1e-5 on function defined tensor X of size (20, 20, 20) and multlinear rank(13, 13, 13)
Results:
Type of output T: ttensor
Core tensor size: (7, 7, 7)
Factor matrices sizes: (20, 7) (20, 7) (20, 7) 

...Testing hosvd with eps_rel=1e-5 on function defined tensor X of size (20, 20, 20)
Results:
Type of output T: ttensor
Core tensor size: (6, 6, 6)
Factor matrices sizes: (20, 6) (20, 6) (20, 6) 

...Testing if factor matrices of ttensor T are orthogonal: true


...Recompress Tucker tensor T to smaller rank: [3, 3, 3]
Results:
Type of output T: ttensor
Core tensor size: (3, 3, 3)
Factor matrices sizes: (20, 3) (20, 3) (20, 3) 

...Testing orthogonal flag and reorthogonalization for random ttensor S of size (4, 5, 2).
Has orthogonal factor matrices: false
After reorthogonalization: true


...Testing norm of ttensor T.
|norm(T) - norm(full(T))| = 0.0


...Testing scalar multiplication 3*T.
norm(full(3*T) - 3*full(T)) = 2.762916642284124e-14


...Creating two random ttensors X and Y of size (6, 8, 2, 5, 4).

...Testing addition.
norm(full(X+Y) - (full(X)+full(Y))) = 2.9371417615883824e-13


...Testing inner product.
|innerprod(X,Y) - innerprod(full(X),full(Y))| = 0.0


...Testing Hadamard product.
norm(full(ewprod(X,Y)) - full(X).*full(Y)) = 4.6026466328654125e-12


...Testing singular values of matricizations of Tucker Tensor.

Singular values of matricizations of random Tucker tensor of size (10, 9, 8), rank [3, 3, 3] and norm 155.44992332458497.
Mode-1 singular values error: 5.955433342649105e-14
Mode-2 singular values error: 7.553172887309252e-14
Mode-3 singular values error: 5.1728291973635394e-14

Singular values of matricizations of random Tucker tensor of size (20, 20, 20, 20), rank [5, 5, 5, 5] and norm 10211.191977110153.
Mode-1 singular values error: 4.50176909753812e-12
Mode-2 singular values error: 4.725873098056247e-12
Mode-3 singular values error: 6.6523802335394945e-12
Mode-4 singular values error: 7.458411103860602e-12

...Testing function mhadtv.


...Creating two random ttensors X and Y of size (5, 4, 3).
Multiplying mode-1 matricized ewprod(X,Y) by a random vector.
Multiplication error: 1.2121276483828486e-14
Multiplication error: 1.461072060248201e-14
Multiplication error: 1.844566752377881e-12

...Testing function mttkrp.
Multiplying mode-1 matricized tensor X by Khatri-Rao product of matrices.
Multiplication error: 1.1890203701269815e-14

...Testing cp_als on ttensor.
Test rank-1 ttensor T of size: (5, 4, 3)
norm(full(Tcp)-T) = 4.416364168247873e-17


****Testing ktensor.jl

**Test rank-1 tensor X of size: (5, 4, 3)
...Testing cp_als.
norm(full(Xcp)-X) = 2.4595479356938113e-16

**Test ktensors X and Y of size: (4, 3, 2)

...Testing function ndims.
X is of order: 3
...Testing function ttensor and full.
...Testing scalar multiplication.
norm(full(3*X) - 3*full(X)) = 5.324442579404919e-16
...Testing functions plus and minus.
norm(full(Z)-(full(X)+full(Y))) = 5.889482005950448e-16
norm(full(Z)-(full(X)-full(Y))) = 1.0344538778264393e-15
...Testing function innerprod.
norm(innerprod(X,Y)-innerprod(full(X),full(Y))) = 6.661338147750939e-16
...Testing function norm.
...Testing functions arrange and arrange!.
norm(full(X)-full(Z)) = 4.783309287441108e-16
...Testing functions normalize and normalize!.
norm(full(X)-full(Z)) = 3.764949453935611e-16
...Testing functions redistribute and redistribute!.
norm(full(X)-full(Z)) = 5.043960206559463e-16
...Testing functions fixsigns, fixsigns! and isequal.
norm(full(X)-full(Z)) = 0.0
...Testing functions ttm and ttv.

...Testing function tocell.
Is the output MatrixCell: true

...Testing function tenmat by mode 2.

...Testing function mttkrp.
Multiplying mode-1 matricized tensor X by Khatri-Rao product of matrices.
Multiplication error: 1.160399051051184e-15


****Testing dimtree.jl

...Testing creating a dimtree.
...Testing function non (number-of-nodes).

...Created two dimtrees for tensor of order 5, with 9 nodes.

...Testing functions:
 - height
 - children
 - sibling
 - parent
 - is_leaf
 - is_left
 - is_right
 - count_leaves
 - dims
 - lvl
 - nodes_on_lvl
 - node2ind
 - subnodes
 - left_child_length


Testing truncation of tensor X of size (2, 2, 2, 2, 2) to htensor.
norm(full(H)-X) = 9.642055270146469e-14
norm(full(H)-X) = 9.324974611567615e-14


...Testing size of htensor H : (5, 4, 3, 2, 4, 2)

...Testing ndims of htensor H : 6

...Testing ttm for ttensor H and array of matrices A : norm(full(ttm(H,A))-ttm(full(H),A)) = 8.608619237455852e-13


...Testing norm of htensor H.
|norm(H) - norm(full(H))| = 1.0658141036401503e-14


...Testing scalar multiplication 3*H.
norm(full(3*H) - 3*full(H)) = 2.0492359422928584e-14


Testing functions plus and minus for htensors H1 and H2.
norm(full(H1+H2) - (full(H1)+full(H2))) = 1.1198953432285394e-15
norm(full(H1+H2) - (full(H1)+full(H2))) = 7.15757921555296e-16


...Testing inner product.
|innerprod(H1,H2) - innerprod(full(H1),full(H2))| = 3.552713678800501e-15


Testing function dropdims for squeezed tensor X and squeezed htensor Y.
norm(full(Y)-dropdims(X,dims=1)) = 8.137497409638755e-15
norm(full(Y)-dropdims(X,dims=2)) = 3.5941327070641825e-15
norm(full(Y)-dropdims(X,dims=3)) = 5.095851118916444e-15
norm(full(Y)-dropdims(X,dims=4)) = 3.2669297017709956e-15
norm(full(Y)-dropdims(X,dims=5)) = 3.91167796714721e-15


...Testing reorthogonalization for random htensor H of size (4, 5, 2).
Has orthogonal factor matrices: false
After reorthogonalization: true
Testing hrank: [1, 2, 2, 2, 2]


****Testing TTtensor.jl

...Test core tensors G of sizes: 
(1, 4, 3)
(3, 6, 4)
(4, 3, 1)

...Test size of TTtensor T: (4, 6, 3)

...Test ndims of TTtensor T: 3

...Test TTsvd of TTtensor T: (3, 4)

...Test addition: 

...Test dot product: 

...Test tensor X of size: (5, 4, 3, 2)

...Testing TTsvd.
Results:
Type of output T: TTtensor

...Testing function full, i.e. contracted product (conprod): norm(full(T)-X) = 3.928120341493524e-15

...Testing TTsvd with requested rank.
Created tensor x of size (6, 5, 6, 5), with TTrank = (4, 4, 4).
T1=TTsvd(X,reqrank=[4, 4, 4])
norm(X-full(T1)) = 1.9878151837212397e-13

...Testing recompression.
S=TTsvd(T): norm(full(S)-X) = 1.5131130179940105e-13

...Testing reorthogonalization - function reorth.
Test TT-tensor T of size: (6, 5, 4, 3) with flags T.lorth = false and T.rorth = false.

Performing (default) left orthogonalization: Tl=reorth(T).
Flags: Tl.lorth = true, Tl.rorth = false.

Performing right orthogonalization: Tr=reorth(T,"right").
Flags: Tr.lorth = false, Tr.rorth = true.
norm(Diagonal(ones(size(Gn, 1))) - Gn * Gn') = 5.980282050312834e-16
norm(Diagonal(ones(size(Gn, 1))) - Gn * Gn') = 5.078718441931913e-16

...Testing reorthogonalization with overwriting - function reorth!.

Performing (default) left orthogonalization: reorth!(T)
Flags: T.lorth = true, T.rorth = false.

Performing right orthogonalization: reorth!(T,"right")
Flags: T.lorth = true, T.rorth = true.

...Testing TTsvd on TT-tensors.

Fixed precision problem with ϵ = 1.0e-8.
Created TT-tensor T of size (6, 5, 6, 5), with TTrank = (4, 4, 4), but its actual TT-rank is (2,2,2)
T1=TTsvd(T,ϵ)
TTrank(T1) = (2, 2, 2)
norm(full(T)-full(T1)) = 8.862313134702342e-14

Fixed rank problem with reqrank = [2, 2, 2].
Created TT-tensor T of size (6, 5, 4, 3), with TTrank = (6, 12, 3).
T1=TTsvd(T,reqrank=[2, 2, 2])
TTrank(T1) = (2, 2, 2)

... Testing contraction with vectors - function TTtv.

... Testing transformation of ktensor to TTtensor - function kten2TT.
Test ktensor T of size (5, 4, 3, 2), and k-rank = 3, transofrming to TTtensor Ttt.
norm(full(T)-full(Ttt)) = 0.0

... Testing contraction of full tensor to TTtensor - function contract.

... Testing element-wise product of two TTtensor - function ewprod.



   Testing TensorToolbox tests passed 

Results with Julia v1.3.1-pre-7704df0a5a

Testing was successful. Last evaluation was ago and took 2 minutes, 13 seconds.

Click here to download the log file.

 Resolving package versions...
 Installed TensorToolbox ─ v1.0.1
  Updating `~/.julia/environments/v1.3/Project.toml`
  [9c690861] + TensorToolbox v1.0.1
  Updating `~/.julia/environments/v1.3/Manifest.toml`
  [9c690861] + TensorToolbox v1.0.1
  [2a0f44e3] + Base64 
  [8ba89e20] + Distributed 
  [b77e0a4c] + InteractiveUtils 
  [8f399da3] + Libdl 
  [37e2e46d] + LinearAlgebra 
  [56ddb016] + Logging 
  [d6f4376e] + Markdown 
  [9a3f8284] + Random 
  [9e88b42a] + Serialization 
  [6462fe0b] + Sockets 
  [8dfed614] + Test 
   Testing TensorToolbox
    Status `/tmp/jl_hG05sw/Manifest.toml`
  [9c690861] TensorToolbox v1.0.1
  [2a0f44e3] Base64  [`@stdlib/Base64`]
  [8ba89e20] Distributed  [`@stdlib/Distributed`]
  [b77e0a4c] InteractiveUtils  [`@stdlib/InteractiveUtils`]
  [8f399da3] Libdl  [`@stdlib/Libdl`]
  [37e2e46d] LinearAlgebra  [`@stdlib/LinearAlgebra`]
  [56ddb016] Logging  [`@stdlib/Logging`]
  [d6f4376e] Markdown  [`@stdlib/Markdown`]
  [9a3f8284] Random  [`@stdlib/Random`]
  [9e88b42a] Serialization  [`@stdlib/Serialization`]
  [6462fe0b] Sockets  [`@stdlib/Sockets`]
  [8dfed614] Test  [`@stdlib/Test`]



**** Testing tensor.jl

**Test tensor X of size: (20, 10, 50, 5)

...Testing functions matten and tenmat (by mode).
Size of 1-mode matricization: [20, 2500]
Check if it folds back correctly: true
Size of 2-mode matricization: [10, 5000]
Check if it folds back correctly: true
Size of 3-mode matricization: [50, 1000]
Check if it folds back correctly: true
Size of 4-mode matricization: [5, 10000]
Check if it folds back correctly: true

...Testing functions matten and tenmat (by rows and columns).
Size of R=[2, 1] and C=[4, 3] matricization: [200, 250]
Check if it folds back correctly: true

...Testing function ttm.
Created 4 matrices with 5 rows and appropriate number of columns.
Size of tensor Y=ttm(X,M): (5, 5, 5, 5)
Multiplication error: 7.880556416068144e-12

...Testing function ttv.
Multiplying a tensor X by a vector v in mode 2.
Size of tensor Y=ttv(X,v): (3, 2)

...Testing function krontm.
Created two tensors X and Y of order 3 and sizes (5, 4, 3) and (2, 5, 4).
Multiplying tkron(X,Y) by random matrix in mode 3.
Multiplication error: 1.5430647611029857e-14
Multiplying tkron(X,Y) by random matrices in modes [3, 2].
Multiplication error: 1.2558619865777448e-13
Multiplying tkron(X,Y) by random matrices in all modes.
Multiplication error: 7.049966209938088e-13

...Testing function mkrontv.
Multiplying mode-1 matricized tkron(X,Y) by a random vector.
Multiplication error: 4.7265781317840344e-14
Multiplication error: 2.604295469441609e-15

...Testing function mttkrp.
Multiplying mode-1 matricized tensor X by Khatri-Rao product of matrices.
Multiplication error: 0.0

...Testing function dropdims.
Tensor X of size :(5, 4, 1, 3, 6, 1) squeezed to size :(5, 4, 3, 6).

...Testing contraction (contract).
Error: 0.0


****Testing ttensor.jl

...Test tensor X of size: (20, 10, 50, 5)

...Testing hosvd.

Creating exact decomposition with rank = size(X):
Results:
Type of output T: ttensor
Core tensor size: (20, 10, 50, 5)
Factor matrices sizes: (20, 20) (10, 10) (50, 50) (5, 5) 

...Testing function full, i.e. n-mode multiplication (ttm): norm(full(T)-X) = 1.9338268534390268e-13

...Testing ttm for ttensor T and array of matrices A : norm(full(ttm(T,A))-ttm(full(T),A)) = 7.42628321588659e-12

...Testing hosvd with smaller multilinear rank: [5, 5, 5, 5]
Results:
Type of output T: ttensor
Core tensor size: (5, 5, 5, 5)
Factor matrices sizes: (20, 5) (10, 5) (50, 5) (5, 5) 

...Testing size of ttensor T : (20, 10, 50, 5)

...Testing ndims of ttensor T : 4

...Testing nrank of ttensor T for mode 1: 5

...Testing mrank of ttensor T: (5, 5, 5, 5)

...Testing functions matten and tenmat (by mode).


...Testing hosvd for tensor with noise.
For ttensor T, X=full(T) tensor of size (60, 50, 40) and rank [5, 5, 5] , N noise tensor and S=hosvd(X+N,[5, 5, 5]).
Error( norm(T-S) ): 0.01327926101534265. Noise norm: 0.17334579558792046.


...Testing hosvd with eps_abs=1e-5 on function defined tensor X of size (20, 20, 20) and multlinear rank(13, 13, 13)
Results:
Type of output T: ttensor
Core tensor size: (7, 7, 7)
Factor matrices sizes: (20, 7) (20, 7) (20, 7) 

...Testing hosvd with eps_rel=1e-5 on function defined tensor X of size (20, 20, 20)
Results:
Type of output T: ttensor
Core tensor size: (6, 6, 6)
Factor matrices sizes: (20, 6) (20, 6) (20, 6) 

...Testing if factor matrices of ttensor T are orthogonal: true


...Recompress Tucker tensor T to smaller rank: [3, 3, 3]
Results:
Type of output T: ttensor
Core tensor size: (3, 3, 3)
Factor matrices sizes: (20, 3) (20, 3) (20, 3) 

...Testing orthogonal flag and reorthogonalization for random ttensor S of size (4, 5, 2).
Has orthogonal factor matrices: false
After reorthogonalization: true


...Testing norm of ttensor T.
|norm(T) - norm(full(T))| = 0.0


...Testing scalar multiplication 3*T.
norm(full(3*T) - 3*full(T)) = 2.762916642284124e-14


...Creating two random ttensors X and Y of size (6, 8, 2, 5, 4).

...Testing addition.
norm(full(X+Y) - (full(X)+full(Y))) = 1.6157503885512517e-13


...Testing inner product.
|innerprod(X,Y) - innerprod(full(X),full(Y))| = 5.4569682106375694e-12


...Testing Hadamard product.
norm(full(ewprod(X,Y)) - full(X).*full(Y)) = 1.5130380436287428e-12


...Testing singular values of matricizations of Tucker Tensor.

Singular values of matricizations of random Tucker tensor of size (10, 9, 8), rank [3, 3, 3] and norm 87.68737589430809.
Mode-1 singular values error: 1.5888218580782548e-14
Mode-2 singular values error: 4.5496934130773415e-14
Mode-3 singular values error: 5.728578676879116e-14

Singular values of matricizations of random Tucker tensor of size (20, 20, 20, 20), rank [5, 5, 5, 5] and norm 8928.23388943427.
Mode-1 singular values error: 3.990391809289632e-12
Mode-2 singular values error: 5.1849175410968106e-12
Mode-3 singular values error: 2.651609927327309e-12
Mode-4 singular values error: 2.612324645514504e-12

...Testing function mhadtv.


...Creating two random ttensors X and Y of size (5, 4, 3).
Multiplying mode-1 matricized ewprod(X,Y) by a random vector.
Multiplication error: 2.9893669801409083e-16
Multiplication error: 2.1513704567906022e-15
Multiplication error: 2.871166393568923e-14

...Testing function mttkrp.
Multiplying mode-1 matricized tensor X by Khatri-Rao product of matrices.
Multiplication error: 3.195147797709499e-15

...Testing cp_als on ttensor.
Test rank-1 ttensor T of size: (5, 4, 3)
norm(full(Tcp)-T) = 4.769346574355995e-16


****Testing ktensor.jl

**Test rank-1 tensor X of size: (5, 4, 3)
...Testing cp_als.
norm(full(Xcp)-X) = 3.489856656915694e-16

**Test ktensors X and Y of size: (4, 3, 2)

...Testing function ndims.
X is of order: 3
...Testing function ttensor and full.
...Testing scalar multiplication.
norm(full(3*X) - 3*full(X)) = 9.305364597889227e-16
...Testing functions plus and minus.
norm(full(Z)-(full(X)+full(Y))) = 1.0254548988792393e-15
norm(full(Z)-(full(X)-full(Y))) = 7.97218214573518e-16
...Testing function innerprod.
norm(innerprod(X,Y)-innerprod(full(X),full(Y))) = 4.440892098500626e-16
...Testing function norm.
...Testing functions arrange and arrange!.
norm(full(X)-full(Z)) = 8.719845996599256e-16
...Testing functions normalize and normalize!.
norm(full(X)-full(Z)) = 6.365655192508265e-16
...Testing functions redistribute and redistribute!.
norm(full(X)-full(Z)) = 1.148088173416408e-15
...Testing functions fixsigns, fixsigns! and isequal.
norm(full(X)-full(Z)) = 0.0
...Testing functions ttm and ttv.

...Testing function tocell.
Is the output MatrixCell: true

...Testing function tenmat by mode 2.

...Testing function mttkrp.
Multiplying mode-1 matricized tensor X by Khatri-Rao product of matrices.
Multiplication error: 1.4359319616405837e-15


****Testing dimtree.jl

...Testing creating a dimtree.
...Testing function non (number-of-nodes).

...Created two dimtrees for tensor of order 5, with 9 nodes.

...Testing functions:
 - height
 - children
 - sibling
 - parent
 - is_leaf
 - is_left
 - is_right
 - count_leaves
 - dims
 - lvl
 - nodes_on_lvl
 - node2ind
 - subnodes
 - left_child_length


Testing truncation of tensor X of size (2, 2, 2, 2, 2) to htensor.
norm(full(H)-X) = 9.642055270146469e-14
norm(full(H)-X) = 9.324974611567615e-14


...Testing size of htensor H : (5, 4, 3, 2, 4, 2)

...Testing ndims of htensor H : 6

...Testing ttm for ttensor H and array of matrices A : norm(full(ttm(H,A))-ttm(full(H),A)) = 4.645398146103157e-13


...Testing norm of htensor H.
|norm(H) - norm(full(H))| = 7.105427357601002e-15


...Testing scalar multiplication 3*H.
norm(full(3*H) - 3*full(H)) = 1.997966270471449e-14


Testing functions plus and minus for htensors H1 and H2.
norm(full(H1+H2) - (full(H1)+full(H2))) = 1.1119563949618733e-15
norm(full(H1+H2) - (full(H1)+full(H2))) = 9.586791989626881e-16


...Testing inner product.
|innerprod(H1,H2) - innerprod(full(H1),full(H2))| = 7.105427357601002e-15


Testing function dropdims for squeezed tensor X and squeezed htensor Y.
norm(full(Y)-dropdims(X,dims=1)) = 1.1703970388398494e-14
norm(full(Y)-dropdims(X,dims=2)) = 3.546093878183873e-15
norm(full(Y)-dropdims(X,dims=3)) = 4.281201945101918e-15
norm(full(Y)-dropdims(X,dims=4)) = 5.625881274348526e-15
norm(full(Y)-dropdims(X,dims=5)) = 3.680623755400682e-15


...Testing reorthogonalization for random htensor H of size (4, 5, 2).
Has orthogonal factor matrices: false
After reorthogonalization: true
Testing hrank: [1, 2, 2, 2, 2]


****Testing TTtensor.jl

...Test core tensors G of sizes: 
(1, 4, 3)
(3, 6, 4)
(4, 3, 1)

...Test size of TTtensor T: (4, 6, 3)

...Test ndims of TTtensor T: 3

...Test TTsvd of TTtensor T: (3, 4)

...Test addition: 

...Test dot product: 

...Test tensor X of size: (5, 4, 3, 2)

...Testing TTsvd.
Results:
Type of output T: TTtensor

...Testing function full, i.e. contracted product (conprod): norm(full(T)-X) = 1.5710058178838452e-14

...Testing TTsvd with requested rank.
Created tensor x of size (6, 5, 6, 5), with TTrank = (4, 4, 4).
T1=TTsvd(X,reqrank=[4, 4, 4])
norm(X-full(T1)) = 6.048791334916279e-13

...Testing recompression.
S=TTsvd(T): norm(full(S)-X) = 1.1237166315465522e-12

...Testing reorthogonalization - function reorth.
Test TT-tensor T of size: (6, 5, 4, 3) with flags T.lorth = false and T.rorth = false.

Performing (default) left orthogonalization: Tl=reorth(T).
Flags: Tl.lorth = true, Tl.rorth = false.

Performing right orthogonalization: Tr=reorth(T,"right").
Flags: Tr.lorth = false, Tr.rorth = true.
norm(Diagonal(ones(size(Gn, 1))) - Gn * Gn') = 6.61889713242203e-16
norm(Diagonal(ones(size(Gn, 1))) - Gn * Gn') = 6.893398677371794e-16

...Testing reorthogonalization with overwriting - function reorth!.

Performing (default) left orthogonalization: reorth!(T)
Flags: T.lorth = true, T.rorth = false.

Performing right orthogonalization: reorth!(T,"right")
Flags: T.lorth = true, T.rorth = true.

...Testing TTsvd on TT-tensors.

Fixed precision problem with ϵ = 1.0e-8.
Created TT-tensor T of size (6, 5, 6, 5), with TTrank = (4, 4, 4), but its actual TT-rank is (2,2,2)
T1=TTsvd(T,ϵ)
TTrank(T1) = (2, 2, 2)
norm(full(T)-full(T1)) = 1.2505365073821823e-13

Fixed rank problem with reqrank = [2, 2, 2].
Created TT-tensor T of size (6, 5, 4, 3), with TTrank = (6, 12, 3).
T1=TTsvd(T,reqrank=[2, 2, 2])
TTrank(T1) = (2, 2, 2)

... Testing contraction with vectors - function TTtv.

... Testing transformation of ktensor to TTtensor - function kten2TT.
Test ktensor T of size (5, 4, 3, 2), and k-rank = 3, transofrming to TTtensor Ttt.
norm(full(T)-full(Ttt)) = 0.0

... Testing contraction of full tensor to TTtensor - function contract.

... Testing element-wise product of two TTtensor - function ewprod.



   Testing TensorToolbox tests passed