0001 classdef TTeMPS
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 properties( SetAccess = public, GetAccess = public )
0014
0015 U
0016
0017 end
0018
0019
0020 properties( Dependent = true, SetAccess = private, GetAccess = public )
0021
0022 rank
0023 order
0024 size
0025
0026 end
0027
0028
0029 methods
0030
0031 function rank_ = get.rank(x)
0032 rank_ = cellfun( @(x) size(x,1), x.U);
0033 rank_ = [rank_, size(x.U{end},3)];
0034 end
0035
0036 function size_ = get.size(x)
0037 size_ = cellfun( @(y) size(y,2), x.U);
0038 end
0039
0040 function order_ = get.order(x)
0041 order_ = length( x.U );
0042 end
0043 end
0044
0045
0046 methods( Access = public )
0047
0048 function x = TTeMPS(varargin)
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058 if (nargin == 0)
0059 x = TTeMPS( {0 0 0} );
0060 return;
0061 elseif (nargin == 1)
0062 x.U = varargin{1};
0063 return;
0064 else
0065 error('Invalid number of arguments.')
0066 end
0067 end
0068
0069
0070 y = full( x );
0071 [x, r] = orth_at( x, pos, dir, apply );
0072 x = orthogonalize( x, pos );
0073 res = innerprod( x, y, dir, upto, storeParts );
0074 res = norm( x, safe );
0075 res = contract( x, y, idx );
0076 x = truncate( x, r );
0077 x = uminus( x );
0078 x = uplus( x );
0079 z = plus( x, y );
0080 z = minus( x, y );
0081 x = mtimes( a, x );
0082 z = hadamard( x, y, idx );
0083 y = mergecores( x, idx );
0084 y = splitcore( x, idx, nL, nR, tol );
0085 z = hadamard_division( x, y, idx );
0086 z = TTeMPS_to_TT( x );
0087 z = cat( mu, x, y );
0088 [xl,xr,g] = gauge_matrices( x );
0089 disp( x, name );
0090 display( x );
0091
0092 end
0093
0094 methods( Static, Access = public )
0095 x = from_array( A, opts );
0096 end
0097
0098 methods( Static, Access = private )
0099
0100 x = subsref_mex( r, n, ind , C);
0101
0102 end
0103 end