computing correlation function and expectation value

How do I use this algorithm? What does that parameter do?
Post Reply
amankumar
Posts: 30
Joined: 17 Apr 2020, 11:14

computing correlation function and expectation value

Post by amankumar »

I am computing two quantities which I expect should give me the same answer but they are not in the fermi Hubbard model.

Code: Select all

cc_ij = psi.correlation_function("Cdu", "Cu")+psi.correlation_function("Cdd", "Cd")


print(cc_ij[1][2])
print(psi.expectation_value_term([('Cdu', 1), ('Cu', 2)])+psi.expectation_value_term([('Cdd', 1), ('Cd', 2)]))
I expect that correlation function and expectation value should give the same answer. Is there any issue of projection being taken care in any one of them. Please let me know.
User avatar
Johannes
Site Admin
Posts: 463
Joined: 21 Jul 2018, 12:52
Location: TU Munich

Re: computing correlation function and expectation value

Post by Johannes »

This should really give the same. It's been a while since you wrote this - has this been resolved by now?
I quickly tried to reproduce this for a random MPS, but it seemed to work as expected. If you still find differences, it would be great if you can open an issue on github and provide a (minimal working example) or example MPS where this fails.
Post Reply