Home > tt2 > exp > tt_qlaplacez_dn.m

tt_qlaplacez_dn

PURPOSE ^

returns a rank-8 QTT decomposition of

SYNOPSIS ^

function [tt]=tt_qlaplacez_dn(d)

DESCRIPTION ^

 returns a rank-8 QTT decomposition of
 Delta_{1}^{-1} \otimes \Id_{2} \ otimes \ldots \otimes \Id_{D} + \ldots +
  + \Id_{1} \ otimes \ldots \otimes \Id_{D-1} \otimes Delta_{D}^{-1},
 Delta_{k} being a discretization of Laplace operator on 2^{d(k)} points
 uniform grid,
 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_qlaplacez_dn(d)
0002 
0003 % returns a rank-8 QTT decomposition of
0004 % Delta_{1}^{-1} \otimes \Id_{2} \ otimes \ldots \otimes \Id_{D} + \ldots +
0005 %  + \Id_{1} \ otimes \ldots \otimes \Id_{D-1} \otimes Delta_{D}^{-1},
0006 % Delta_{k} being a discretization of Laplace operator on 2^{d(k)} points
0007 % uniform grid,
0008 % Dirichlet 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 E=ones(2);
0033 
0034 if (D == 1)
0035     for key=1 : d
0036         tt{key}=eye(2);
0037     end
0038 else
0039 
0040     key=0;
0041     for k=1 : D
0042         for kappa=1 : d(k)
0043             key=key+1;
0044             if (kappa == 1)
0045                 if (k == 1)
0046                     tt{key}=zeros(2,2,5);
0047                     tt{key}(:,:,1)=I+I2+J+J';
0048                     tt{key}(:,:,2)=2*E;
0049                     tt{key}(:,:,3)=I2+J'+E;
0050                     tt{key}(:,:,4)=I2+J+E;
0051                     tt{key}(:,:,5)=I;    
0052                 elseif (k == D)
0053                     tt{key}=zeros(2,2,2,4);
0054                     tt{key}(:,:,1,1)=I;
0055                     tt{key}(:,:,2,1)=I+I2+J+J';
0056                     tt{key}(:,:,2,2)=2*E;
0057                     tt{key}(:,:,2,3)=I2+J'+E;
0058                     tt{key}(:,:,2,4)=I2+J+E;
0059                 else
0060                     tt{key}=zeros(2,2,2,8);
0061                     tt{key}(:,:,1,1)=I+I2+J+J';
0062                     tt{key}(:,:,1,2)=2*E;
0063                     tt{key}(:,:,1,3)=I2+J'+E;
0064                     tt{key}(:,:,1,4)=I2+J+E;
0065                     tt{key}(:,:,1,5)=I;
0066                     tt{key}(:,:,2,5)=I+I2+J+J';
0067                     tt{key}(:,:,2,6)=2*E;
0068                     tt{key}(:,:,2,7)=I2+J'+E;
0069                     tt{key}(:,:,2,8)=I2+J+E;
0070                 end
0071             elseif (kappa == d(k))
0072                 if (k == D)
0073                     tt{key}=zeros(2,2,4);
0074                     tt{key}(:,:,1)=I;
0075                     tt{key}(:,:,2)=I2;
0076                     tt{key}(:,:,3)=J;
0077                     tt{key}(:,:,4)=J';
0078                 elseif (k == 1)
0079                     tt{key}=zeros(2,2,5,2);
0080                     tt{key}(:,:,1,1)=I;
0081                     tt{key}(:,:,2,1)=I2;
0082                     tt{key}(:,:,3,1)=J;
0083                     tt{key}(:,:,4,1)=J';
0084                     tt{key}(:,:,5,2)=I;
0085                 else
0086                     tt{key}=zeros(2,2,8,2);
0087                     tt{key}(:,:,1,1)=I;
0088                     tt{key}(:,:,2,1)=I2;
0089                     tt{key}(:,:,3,1)=J;
0090                     tt{key}(:,:,4,1)=J';
0091                     tt{key}(:,:,5,2)=I;
0092                     tt{key}(:,:,6,2)=I2;
0093                     tt{key}(:,:,7,2)=J;
0094                     tt{key}(:,:,8,2)=J';
0095                 end
0096             else
0097                 if (k == D)
0098                     tt{key}=zeros(2,2,4,4);
0099                     tt{key}(:,:,1,1)=I;
0100                     tt{key}(:,:,2,2)=2*E;
0101                     tt{key}(:,:,3,3)=E;
0102                     tt{key}(:,:,4,4)=E;
0103                     tt{key}(:,:,2,1)=I2;
0104                     tt{key}(:,:,3,1)=J;
0105                     tt{key}(:,:,4,1)=J';
0106                     tt{key}(:,:,2,3)=I2+J';
0107                     tt{key}(:,:,2,4)=I2+J;
0108                 elseif (k == 1)
0109                     tt{key}=zeros(2,2,5,5);
0110                     tt{key}(:,:,1,1)=I;
0111                     tt{key}(:,:,2,2)=2*E;
0112                     tt{key}(:,:,3,3)=E;
0113                     tt{key}(:,:,4,4)=E;
0114                     tt{key}(:,:,2,1)=I2;
0115                     tt{key}(:,:,3,1)=J;
0116                     tt{key}(:,:,4,1)=J';                
0117                     tt{key}(:,:,2,3)=I2+J';
0118                     tt{key}(:,:,2,4)=I2+J;
0119                     tt{key}(:,:,5,5)=I;
0120                 else
0121                     tt{key}=zeros(2,2,8,8);
0122                     tt{key}(:,:,1,1)=I;
0123                     tt{key}(:,:,2,2)=2*E;
0124                     tt{key}(:,:,3,3)=E;
0125                     tt{key}(:,:,4,4)=E;
0126                     tt{key}(:,:,2,1)=I2;
0127                     tt{key}(:,:,3,1)=J;
0128                     tt{key}(:,:,4,1)=J';
0129                     tt{key}(:,:,2,3)=I2+J';
0130                     tt{key}(:,:,2,4)=I2+J;
0131                     tt{key}(:,:,5,5)=I;
0132                     tt{key}(:,:,6,6)=2*E;
0133                     tt{key}(:,:,7,7)=E;
0134                     tt{key}(:,:,8,8)=E;
0135                     tt{key}(:,:,6,5)=I2;
0136                     tt{key}(:,:,7,5)=J;
0137                     tt{key}(:,:,8,5)=J';
0138                     tt{key}(:,:,6,7)=I2+J';
0139                     tt{key}(:,:,6,8)=I2+J;
0140                 end
0141             end
0142         end
0143     end
0144 end
0145 
0146 tt=tt_matrix(tt); % @Bydlocode
0147 return
0148 end

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