Home > manopt > manifolds > ttfixedrank > TTeMPS_1.1 > examples > example.m

example

TTeMPS Toolbox.

SYNOPSIS

This is a script file.

DESCRIPTION

```   TTeMPS Toolbox.
Michael Steinlechner, 2013-2016
Questions and contact: michael.steinlechner@epfl.ch

CROSS-REFERENCE INFORMATION

This function calls:
• disp DISP Display TT/MPS tensor.
• innerprod INNERPROD Inner product between two TT/MPS tensors.
• orthogonalize ORTHOGONALIZE Orthogonalize tensor.
• round ROUND Approximate TTeMPS tensor within a prescribed tolerance.
• truncate TRUNCATE Truncate TTeMPS tensor to prescribed rank.
• disp DISP Display TT/MPS block-mu tensor.
• innerprod INNERPROD Inner product between two TT/MPS tensors.
• orthogonalize ORTHOGONALIZE Orthogonalize TT/MPS Block-mu tensor.
• round ROUND Approximate TTeMPS tensor within a prescribed tolerance.
• truncate ROUND Approximate TTeMPS tensor within a prescribed tolerance.
• disp DISP Display TT/MPS operator.
• round ROUND Approximate TTeMPS operator within a prescribed tolerance.
• disp DISP Display TT/MPS operator.
• TTeMPS_rand TTEMPS_RAND Create random TTeMPS tensor
• orthogonalize Orthonormalizes a basis of tangent vectors in the Manopt framework.
This function is called by:

SOURCE CODE

```0001 %   TTeMPS Toolbox.
0002 %   Michael Steinlechner, 2013-2016
0003 %   Questions and contact: michael.steinlechner@epfl.ch
0005
0006 rng(11);
0007
0008 disp('Number of dimensions:')
0009 d = 5
0010
0011 disp('Define tensor size:')
0012 n = [7 8 9 10 11]
0013
0014 disp('Define rank vector (note that in the TT/MPS format, both the first and last rank are 1):')
0015 r = [1 4 5 6 7 1]
0016
0017 disp('Create two random TT/MPS tensors:')
0018 X = TTeMPS_rand( r, n )
0019 Y = TTeMPS_rand( r, n )
0020
0021 disp('Calculate inner product between them:')
0022 ip = innerprod( X, Y )
0023
0024 disp('Left-orthogonalize X:')
0025 X = orthogonalize( X, 1 )
0026
0027 disp('Right-orthogonalize Y:')
0028 Y = orthogonalize( Y, Y.order )
0029