Home > manopt > manifolds > ttfixedrank > TTeMPS_1.1 > @TTeMPS_op > disp.m

# disp

## PURPOSE

DISP Display TT/MPS operator.

## SYNOPSIS

function disp( x, name )

## DESCRIPTION

```DISP Display TT/MPS operator.
disp(X) displays the TT/MPS operator X as a tensor network.```

## CROSS-REFERENCE INFORMATION

This function calls:
• disp DISP Display TT/MPS tensor.
• disp DISP Display TT/MPS block-mu tensor.
• disp DISP Display TT/MPS operator.
• disp DISP Display TT/MPS operator.
This function is called by:

## SOURCE CODE

```0001 function disp( x, name )
0002     %DISP Display TT/MPS operator.
0003     %   disp(X) displays the TT/MPS operator X as a tensor network.
0004
0005     %   TTeMPS Toolbox.
0006     %   Michael Steinlechner, 2013-2016
0007     %   Questions and contact: michael.steinlechner@epfl.ch
0009
0010     if (nargin < 2 || ~ischar(name))
0011       name = inputname(1);
0012     end
0013
0014
0015     disp([name, ' is a TT/MPS operator of order ', num2str(x.order), ...
0016                 ' with column sizes (', num2str(x.size_col), '),']);
0017     disp(['row sizes (', num2str(x.size_row), ...
0018                         '), and ranks (', num2str(x.rank), ')']);
0019     disp(' ');
0020     disp('');
0021
0022     row0 = '';
0023     row1 = '';
0024     row2 = '';
0025     row3 = '';
0026     row4 = '';
0027
0028     for i=1:x.order
0029         row0 = [row0, sprintf('     %3i    ', x.size_col(i))];
0030         row1 = [row1, '       |    '];
0031         row2 = [row2, sprintf('%3i--(U%2i)--', x.rank(i), i)];
0032         row3 = [row3, '       |    '];
0033         row4 = [row4, sprintf('     %3i    ', x.size_row(i))];
0034     end
0035     row2 = [row2, sprintf( '%3i', x.rank(end) )];
0036     disp(row0)
0037     disp(row1)
0038     disp(row2)
0039     disp(row3)
0040     disp(row4)
0041
0042 end```

Generated on Fri 30-Sep-2022 13:18:25 by m2html © 2005