Home > tt2 > exp > tt_qlaplace_dd.m

tt_qlaplace_dd

PURPOSE ^

returns a rank-3,4...4 QTT decomposition of

SYNOPSIS ^

function [tt]=tt_qlaplace_dd(d)

DESCRIPTION ^

 returns a rank-3,4...4 QTT decomposition of
 Delta_{1} \otimes \Id_{2} \ otimes \ldots \otimes \Id_{D} + \ldots +
  + \Id_{1} \ otimes \ldots \otimes \Id_{D-1} \otimes Delta_{D},
 Delta_{k} being a discretization of Laplace operator on 2^d(k) points
 uniform grid,
 Dirichlet-Dirichlet boundary conditions being imposed

 D=size(d,2) must be >= 1

 September 3, 2010
 Vladimir Kazeev
 vladimir.kazeev@gmail.com
 INM RAS
 Moscow, Russia

 Look for details in the Preprint No. 75, 2010 of
 Max-Planck Institute for Mathematics in the Sciences
 Vladimir A. Kazeev and Boris N. Khoromskij
 On explicit QTT representation of Laplace operator and its inverse
 http://www.mis.mpg.de/publications/preprints/2010/prepr2010-75.html

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [tt]=tt_qlaplace_dd(d)
0002 % returns a rank-3,4...4 QTT decomposition of
0003 % Delta_{1} \otimes \Id_{2} \ otimes \ldots \otimes \Id_{D} + \ldots +
0004 %  + \Id_{1} \ otimes \ldots \otimes \Id_{D-1} \otimes Delta_{D},
0005 % Delta_{k} being a discretization of Laplace operator on 2^d(k) points
0006 % uniform grid,
0007 % Dirichlet-Dirichlet boundary conditions being imposed
0008 %
0009 % D=size(d,2) must be >= 1
0010 %
0011 % September 3, 2010
0012 % Vladimir Kazeev
0013 % vladimir.kazeev@gmail.com
0014 % INM RAS
0015 % Moscow, Russia
0016 %
0017 % Look for details in the Preprint No. 75, 2010 of
0018 % Max-Planck Institute for Mathematics in the Sciences
0019 % Vladimir A. Kazeev and Boris N. Khoromskij
0020 % On explicit QTT representation of Laplace operator and its inverse
0021 % http://www.mis.mpg.de/publications/preprints/2010/prepr2010-75.html
0022 
0023 d=fliplr(d);
0024 D=size(d,2);
0025 tt=cell(sum(d),1);
0026 I=eye(2);
0027 J=zeros(2);
0028 J(1,2)=1;
0029 
0030 if (D == 1)
0031     for key=1 : d
0032         if (key == 1)
0033             tt{key}=zeros(2,2,3);
0034             tt{key}(:,:,1)=2*I-J-J';
0035             tt{key}(:,:,2)=-J;
0036             tt{key}(:,:,3)=-J';
0037         elseif (key == d)
0038             tt{key}=zeros(2,2,3);
0039             tt{key}(:,:,1)=I;
0040             tt{key}(:,:,2)=J';
0041             tt{key}(:,:,3)=J;
0042         else
0043             tt{key}=zeros(2,2,3,3);
0044             tt{key}(:,:,1,1)=I;
0045             tt{key}(:,:,2,2)=J;
0046             tt{key}(:,:,3,3)=J';
0047             tt{key}(:,:,2,1)=J';
0048             tt{key}(:,:,3,1)=J;
0049         end
0050     end
0051 else
0052 
0053     key=0;
0054     for k=1 : D
0055         for kappa=1 : d(k)
0056             key=key+1;
0057             if (kappa == 1)
0058                 if (k == 1)
0059                     tt{key}=zeros(2,2,4);
0060                     tt{key}(:,:,1)=2*I-J-J';
0061                     tt{key}(:,:,2)=-J;
0062                     tt{key}(:,:,3)=-J';
0063                     tt{key}(:,:,4)=I;
0064                 elseif (k == D)
0065                     tt{key}=zeros(2,2,2,3);
0066                     tt{key}(:,:,1,1)=2*I-J-J';
0067                     tt{key}(:,:,1,2)=-J;
0068                     tt{key}(:,:,1,3)=-J';
0069                     tt{key}(:,:,2,1)=I;
0070                 else
0071                     tt{key}=zeros(2,2,2,4);
0072                     tt{key}(:,:,1,1)=2*I-J-J';
0073                     tt{key}(:,:,1,2)=-J;
0074                     tt{key}(:,:,1,3)=-J';
0075                     tt{key}(:,:,1,4)=I;
0076                     tt{key}(:,:,2,1)=I;
0077                 end
0078             elseif (kappa == d(k))
0079                 if (k == D)
0080                     tt{key}=zeros(2,2,3);
0081                     tt{key}(:,:,1)=I;
0082                     tt{key}(:,:,2)=J';
0083                     tt{key}(:,:,3)=J;
0084                 else
0085                     tt{key}=zeros(2,2,4,2);
0086                     tt{key}(:,:,4,1)=I;
0087                     tt{key}(:,:,1,2)=I;
0088                     tt{key}(:,:,2,2)=J';
0089                     tt{key}(:,:,3,2)=J;
0090                 end
0091             else
0092                 if (k == D)
0093                     tt{key}=zeros(2,2,3,3);
0094                     tt{key}(:,:,1,1)=I;
0095                     tt{key}(:,:,2,2)=J;
0096                     tt{key}(:,:,3,3)=J';
0097                     tt{key}(:,:,2,1)=J';
0098                     tt{key}(:,:,3,1)=J;
0099                 else
0100                     tt{key}=zeros(2,2,4,4);
0101                     tt{key}(:,:,1,1)=I;
0102                     tt{key}(:,:,2,2)=J;
0103                     tt{key}(:,:,3,3)=J';
0104                     tt{key}(:,:,2,1)=J';
0105                     tt{key}(:,:,3,1)=J;
0106                     tt{key}(:,:,4,4)=I;
0107                 end
0108             end
0109         end
0110     end
0111 end
0112 tt=tt_matrix(tt); % @Bydlocode
0113 return
0114 end

Generated on Wed 08-Feb-2012 18:20:24 by m2html © 2005