LAPLACE Construct a simple d-dimensional Laplace operator and return TTeMPS_op_laplace object.
0001 %LAPLACE Construct a simple d-dimensional Laplace operator and return TTeMPS_op_laplace object. 0002 0003 % TTeMPS Toolbox. 0004 % Michael Steinlechner, 2013-2016 0005 % Questions and contact: michael.steinlechner@epfl.ch 0006 % BSD 2-clause license, see LICENSE.txt 0007 0008 function L = laplace( I, n, d ); 0009 0010 one = ones(n,1); 0011 q = linspace( I(1), I(2), n)'; 0012 h = abs(q(2) - q(1)); 0013 L0 = -spdiags( [one, -2*one, one], [-1 0 1], n, n) / (h^2); 0014 0015 L = TTeMPS_op_laplace( L0, d ); 0016 end