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