Unable to calculate Charge Charge correlation/ Structure factor

Hey hope you are doing good. I want to calculate charge density wave structure factor which is defined as


I want to calculate this quantity for k = \pi. However I am unable to get correct results. I have attached my code to calculate the parameter below: Note that V1V2_model is the name of my hamiltonian which returns the energy and wavefunction using DMRG. In my code I have two potentials V1 and V2, I keep V1 fixed and vary V2 in a range to calculate the charge density wave structure factor. The results don’t match with exact diagonalization and are not as expected. Is there some other alternative to calculate this quantity in ITENSOR. (The energy values do match with exact diagonalization however the structure factor values don’t)

@time begin
L = 80
t = 1
V1 =3.5
V2 =collect(2.5:0.2:3.6)
S =[]

k_ = pi
for v in V2
    expec = 0    
    E,psi = V1V2_model(L,t,V1,v,1) 
    corr = correlation_matrix(psi,"N","N")
    for i in 1:L
        for j in 1:L
            expec = expec+ exp(1im*k_*abs(i-j))*(corr[i,j]-expect(psi,"N",sites = i)*expect(psi,"N",sites = j))/L^2  
            
    
        end 
            
    end  
    append!(S,expec)    
        
end
end

Hi Aditya,
The correlation_matrix function is the way to go here, as you did. It’s the best way to compute quantities like \langle n_i n_j \rangle. So if your wavefunction is converged to the correct state, then you can be sure that correlation_matrix is giving you the right result. There is not another function to compute this quantity in ITensor.

Therefore, if the results aren’t matching your ED results, please just consider other sources of error:

  • perhaps your ED results are computed incorrectly
  • perhaps the code that processes \langle n_i n_j \rangle into the structure factor has a bug in it
  • your state may not be converged enough
    and so on.

In general, while we welcome questions about the correct usage of ITensor features and conceptual questions, please do not expect us to read through code and catch bugs or other sources of error for you. Please do use some of the general strategies I listed above to look for and detect possible sources of error in your code or calculations. Thanks for understanding –

1 Like