Home > tt2 > exp > tt_qlaplacez_dd.m

tt_qlaplacez_dd

PURPOSE ^

returns a rank-10 QTT decomposition of

SYNOPSIS ^

function [tt]=tt_qlaplacez_dd(d)

DESCRIPTION ^

 returns a rank-10 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

 January 17, 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_dd(d)
0002 
0003 % returns a rank-10 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 % January 17, 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 P=[0,1;1,0];
0029 E=ones(2);
0030 F=[1,-1;-1,1];
0031 K=[-1,0;0,1];
0032 L=[0,-1;1,0];
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             xi=(2^(kappa-1)+1)/(2^kappa+1);
0045             eta=2^(kappa-2)/(2^kappa+1);
0046             zeta=xi*(2^(kappa-1)+1)/2^(kappa-1);
0047             if (kappa == 1)
0048                 if (k == 1)
0049                     tt{key}=zeros(2,2,6);
0050                     tt{key}(:,:,1)=(E+I)/3;
0051                     tt{key}(:,:,2)=2*E;
0052                     tt{key}(:,:,3)=F/18;
0053                     tt{key}(:,:,4)=2*K/3;
0054                     tt{key}(:,:,5)=-2*L/3;
0055                     tt{key}(:,:,6)=I;    
0056                 elseif (k == D)
0057                     tt{key}=zeros(2,2,2,5);
0058                     tt{key}(:,:,1,1)=I;
0059                     tt{key}(:,:,2,1)=(E+I)/3;
0060                     tt{key}(:,:,2,2)=2*E;
0061                     tt{key}(:,:,2,3)=F/18;
0062                     tt{key}(:,:,2,4)=2*K/3;
0063                     tt{key}(:,:,2,5)=-2*L/3;
0064                 else
0065                     tt{key}=zeros(2,2,2,10);
0066                     tt{key}(:,:,1,1)=(E+I)/3;
0067                     tt{key}(:,:,1,2)=2*E;
0068                     tt{key}(:,:,1,3)=F/18;
0069                     tt{key}(:,:,1,4)=2*K/3;
0070                     tt{key}(:,:,1,5)=-2*L/3;
0071                     tt{key}(:,:,1,6)=I;
0072                     tt{key}(:,:,2,6)=(E+I)/3;
0073                     tt{key}(:,:,2,7)=2*E;
0074                     tt{key}(:,:,2,8)=F/18;
0075                     tt{key}(:,:,2,9)=2*K/3;
0076                     tt{key}(:,:,2,10)=-2*L/3;
0077                 end
0078             elseif (kappa == d(k))
0079                 if (k == D)
0080                     tt{key}=zeros(2,2,5);
0081                     tt{key}(:,:,1)=I;
0082                     tt{key}(:,:,2)=xi*I/4+zeta*P/4;
0083                     tt{key}(:,:,3)=xi*I-zeta*P;
0084                     tt{key}(:,:,4)=-xi*K/2;
0085                     tt{key}(:,:,5)=zeta*L/2;
0086                 elseif (k == 1)
0087                     tt{key}=zeros(2,2,6,2);
0088                     tt{key}(:,:,1,1)=I;
0089                     tt{key}(:,:,2,1)=xi*I/4+zeta*P/4;
0090                     tt{key}(:,:,3,1)=xi*I-zeta*P;
0091                     tt{key}(:,:,4,1)=-xi*K/2;
0092                     tt{key}(:,:,5,1)=zeta*L/2;
0093                     tt{key}(:,:,6,2)=I;
0094                 else
0095                     tt{key}=zeros(2,2,10,2);
0096                     tt{key}(:,:,1,1)=I;
0097                     tt{key}(:,:,2,1)=xi*I/4+zeta*P/4;
0098                     tt{key}(:,:,3,1)=xi*I-zeta*P;
0099                     tt{key}(:,:,4,1)=-xi*K/2;
0100                     tt{key}(:,:,5,1)=zeta*L/2;
0101                     tt{key}(:,:,6,2)=I;
0102                     tt{key}(:,:,7,2)=xi*I/4+zeta*P/4;
0103                     tt{key}(:,:,8,2)=xi*I-zeta*P;
0104                     tt{key}(:,:,9,2)=-xi*K/2;
0105                     tt{key}(:,:,10,2)=zeta*L/2;
0106                 end
0107             else
0108                 if (k == D)
0109                     tt{key}=zeros(2,2,5,5);
0110                     tt{key}(:,:,1,1)=I;
0111                     tt{key}(:,:,2,1)=xi*I/4+zeta*P/4;
0112                     tt{key}(:,:,3,1)=xi*I-zeta*P;
0113                     tt{key}(:,:,4,1)=-xi*K/2;
0114                     tt{key}(:,:,5,1)=zeta*L/2;
0115                     tt{key}(:,:,2,2)=2*E;
0116                     tt{key}(:,:,2,3)=2*eta^2*F;
0117                     tt{key}(:,:,3,3)=2*xi^2*E;
0118                     tt{key}(:,:,4,3)=2*xi*eta*K;
0119                     tt{key}(:,:,5,3)=2*xi*eta*L;
0120                     tt{key}(:,:,2,4)=4*eta*K;
0121                     tt{key}(:,:,4,4)=2*xi*E;
0122                     tt{key}(:,:,2,5)=-4*eta*L;
0123                     tt{key}(:,:,5,5)=2*xi*E;
0124                 elseif (k == 1)
0125                     tt{key}=zeros(2,2,6,6);
0126                     tt{key}(:,:,1,1)=I;
0127                     tt{key}(:,:,2,1)=xi*I/4+zeta*P/4;
0128                     tt{key}(:,:,3,1)=xi*I-zeta*P;
0129                     tt{key}(:,:,4,1)=-xi*K/2;
0130                     tt{key}(:,:,5,1)=zeta*L/2;
0131                     tt{key}(:,:,2,2)=2*E;
0132                     tt{key}(:,:,2,3)=2*eta^2*F;
0133                     tt{key}(:,:,3,3)=2*xi^2*E;
0134                     tt{key}(:,:,4,3)=2*xi*eta*K;
0135                     tt{key}(:,:,5,3)=2*xi*eta*L;
0136                     tt{key}(:,:,2,4)=4*eta*K;
0137                     tt{key}(:,:,4,4)=2*xi*E;
0138                     tt{key}(:,:,2,5)=-4*eta*L;
0139                     tt{key}(:,:,5,5)=2*xi*E;
0140                     tt{key}(:,:,6,6)=I;
0141                 else
0142                     tt{key}=zeros(2,2,10,10);
0143                     tt{key}(:,:,1,1)=I;
0144                     tt{key}(:,:,2,1)=xi*I/4+zeta*P/4;
0145                     tt{key}(:,:,3,1)=xi*I-zeta*P;
0146                     tt{key}(:,:,4,1)=-xi*K/2;
0147                     tt{key}(:,:,5,1)=zeta*L/2;
0148                     tt{key}(:,:,2,2)=2*E;
0149                     tt{key}(:,:,2,3)=2*eta^2*F;
0150                     tt{key}(:,:,3,3)=2*xi^2*E;
0151                     tt{key}(:,:,4,3)=2*xi*eta*K;
0152                     tt{key}(:,:,5,3)=2*xi*eta*L;
0153                     tt{key}(:,:,2,4)=4*eta*K;
0154                     tt{key}(:,:,4,4)=2*xi*E;
0155                     tt{key}(:,:,2,5)=-4*eta*L;
0156                     tt{key}(:,:,5,5)=2*xi*E;
0157                     tt{key}(:,:,6,6)=I;
0158                     tt{key}(:,:,7,6)=xi*I/4+zeta*P/4;
0159                     tt{key}(:,:,8,6)=xi*I-zeta*P;
0160                     tt{key}(:,:,9,6)=-xi*K/2;
0161                     tt{key}(:,:,10,6)=zeta*L/2;
0162                     tt{key}(:,:,7,7)=2*E;
0163                     tt{key}(:,:,7,8)=2*eta^2*F;
0164                     tt{key}(:,:,8,8)=2*xi^2*E;
0165                     tt{key}(:,:,9,8)=2*xi*eta*K;
0166                     tt{key}(:,:,10,8)=2*xi*eta*L;
0167                     tt{key}(:,:,7,9)=4*eta*K;
0168                     tt{key}(:,:,9,9)=2*xi*E;
0169                     tt{key}(:,:,7,10)=-4*eta*L;
0170                     tt{key}(:,:,10,10)=2*xi*E;
0171                 end
0172             end
0173         end
0174     end
0175 end
0176 
0177 tt=tt_matrix(tt); % @Bydlocode
0178 return
0179 end

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