# Simulating Anderson model, have problem with momentum representation (MATLAB)

I want to change from real-space representation to momentum-space representation I have a Hamilton-operator (Anderson-model), and I calculated some kind of entropy of its eigenstates (this is working, I see what I want). Next I want to change to momentum repr. using FFT and now my eigenstates in momentum space are not normalized. E.g. if I calculate the sum of the square of the eigenstates, it has to be 1, but it does not work.

I tried to sum the square of the eigenstates and normalized with them, but It does not work (I show the code without any failed trying).

N=100; %dim of matrix
Nx=15; %number of points
%because of log scale
xmin = -3.0;
xmax =  3.0;
dx = (xmax - xmin)/(Nx-1);
x = zeros(1,Nx); %x axis pre
ss = zeros(1,Nx); %entropy pre
spp=zeros(1,Nx); %entropy in Fourier space pre
eps=1.0e-6;

for ix=1:Nx
%log scale
x(ix) = xmin + (ix-1)*dx;
xx = 10.0^x(ix);

average_s=0;
average_spp=0;
%anderson modell
W=xx;
r=rand(1,N)*W-(W/2);
A=diag(ones(1,N-1),1)+diag(ones(1,N-1),-1)+diag(r);
%diagonalization
[V,D]=eig(A);
%PROBLEM HERE:
%Fourier transformation
P=fft(V)/(sqrt(2*pi)*N);
P=abs(P);
for j=1:N
four_sum=0; square_sum=0; entropy=0;
four_sum_p=0; square_sum_p=0; entropyp=0;
for i=1:N
%Fou
probp=(P(i,j)).^2;
square_sum_p=square_sum_p+probp;
if probp>eps
entropyp=entropyp-probp*log(probp);
end;
four_sum_p=four_sum_p+probp.^2;

%Real
prob=V(i,j).^2;
square_sum=square_sum+prob;
if prob>eps
entropy=entropy-prob*log(prob);
end;
four_sum=four_sum+prob.^2;
end
qp=square_sum_p.^2/(four_sum_p);
average_spp=average_spp+entropyp-log(qp);

q=square_sum.^2/(four_sum);
average_s=average_s+entropy-log(q);
end
ss(ix)=average_s/N;
spp(ix)=average_spp/N;
end
plot(x,ss,x,spp);


The structural entropy in real space (ss vector) has the correct form, but in momentum space (spp) after FFT is not look like what I want, and it is not normalized.

• It would be useful if you explain what you want, and don't rely that much in specialized terms. – nicoguaro Jun 2 at 17:52
• Regarding the FFT, it is not normalized. In MATLAB it will scale with the number of samples, you need to keep that in mind when using it. You better check the documentation to see their definition. – nicoguaro Jun 2 at 17:53