Hey Miles, hope you remember me. Well I have been trying for many days to get code to find the expectation value of this order parameter given by:
B_i B_j where B_i = c_i^{\dagger}c_{i+1} +h.c. Here i , j are sites. Basically, I need to calculate the quantity given below:
However, I tried a lot but could not come up with a working code.
Hey Miles, I hope you were able to go through my problem, I guess I figured it out, however it takes lot of time to run, anyway can you once go through my code
expec = 0
k = pi
os2 = OpSum()
for i in 1:L-1
for j in 1:L-1
os2 = OpSum()
os2 += exp(1im*k*abs(i-j)),"Cdagdn",i,"Cdn",i+1,"Cdagdn",j,"Cdn",j+1
os2 += exp(1im*k*abs(i-j)),"Cdagdn",i,"Cdn",i+1,"Cdagdn",j+1,"Cdn",j
os2 += exp(1im*k*abs(i-j)),"Cdagdn",i+1,"Cdn",i,"Cdagdn",j,"Cdn",j+1
os2 += exp(1im*k*abs(i-j)),"Cdn",i+1,"Cup",i,"Cdn",j+1,"Cup",j
O = MPO(os2,sites)
expec = expec + inner(psi',O,psi)
end
end
Hi Aditya,
Please don’t title posts as “Urgent!”, because we try our best to reply in a timely manner, and we also are quite busy with our own research and other duties (and developing ITensor).
Your solution looks like a good one for the case of a specific value of k, as I understand it, where you have used our OpSum system to make an MPO that is the operator S_{BO}(k). Yes, this could take a long time to run because of the double sum over i and j which has an L^2 complexity, so becomes costly for large L.
The only way to code this into an MPO efficiently would be to use a sort of “hand built” MPO construction, where you code the individual tensors to make this operator. It’s beyond the scope of this forum to describe how to do that in detail, but here are some resources that could help you to learn about this technique:
https://arxiv.org/abs/0804.2509
https://arxiv.org/abs/0708.1221
https://arxiv.org/abs/1407.1832
Thank you so much for your kind guidance Miles. Your help is appreciated.
Glad it’s helpful. Computing properties of 4-site operators is challenging with MPS, and techniques to do it well are still being developed. I hope you find a good way that works for you!
For those interested, we are working on a package here: GitHub - ITensor/ITensorCorrelators.jl for computing general higher order correlators with MPS, though it is unregistered and undocumented so caveat emptor. There is an example showing how to use it here: ITensorCorrelators.jl/4-point-correlator.jl at main · ITensor/ITensorCorrelators.jl · GitHub.