Expectation value of an operator

How do I use this algorithm? What does that parameter do?
Post Reply
srivatsa91
Posts: 1
Joined: 21 Aug 2023, 17:07

Expectation value of an operator

Post by srivatsa91 »

Hi,

I am a relatively new entrant into TeNPy. I am interested in calculating an expectation value of an operator with a single conservation law (such as total magnetization being conserved) ,

\(<\psi|O(t)|\psi>\) where \(|\psi>\) is a simple product state and my operator \(O(t)\) is obtained after a Heisenberg evolution of some initial operator, say \(O(0)\).

I am able to get \(O(t)\) using my TEBD code and I also have a code written up for the simple MPS \(|\psi>\). I now just need to compute the expectation value \(<\psi|O(t)|\psi>\) ( I would like to keep the time evolution on the operator only)..

Is there an inbuilt function in Tenpy that takes inputs as (\(O,|\psi>\)) and returns for me the expectation value ?

Thank you very much !
User avatar
Johannes
Site Admin
Posts: 428
Joined: 21 Jul 2018, 12:52
Location: TU Munich

Re: Expectation value of an operator

Post by Johannes »

Ho did you get O(t)? Currently, I don't think there is TEBD code to Heisenberg-Evolve an operator - did you write that yourself?
I presume you have O in the form of an MPO then?
For a TeNPy MPO, it's simply expectation_value, e.g. E = H.expectation_value(psi), or for finite systems MPOEnvironment(H, psi).full_contraction().
Note that a TeNPy MPO requires the IdL/IdR indices at least on the very left/right ends, to define how to terminate the open indices of the MPO in the contraction of <psi|O|psi>.
Post Reply