Home > tt2 > exp > tt_qlaplace_dn.m

tt_qlaplace_dn

PURPOSE ^

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

SYNOPSIS ^

function [tt]=tt_qlaplace_dn(d)

DESCRIPTION ^

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

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