function L=laplacian(n)
L=zeros(n,n);
for i=1:n
    L(i,i)=2;
end
for i=1:n-1
    L(i+1,i)=-1;
    L(i,i+1)=-1;
end
