How to exponentiate an operator and calculate expectation of multiple operators in ITENSOR julia?

Hi !
I am trying to calculate the quantity given by:
O_{str}=-\langle z_{i}e^{i\frac{\pi}{2}\sum_{k=3}^{L-2}z_{k}}z_{j}\rangle
where z = 1-2c^{\dagger}c here c is the fermionic operator. I have tried a lot but could not develop a suitable julia code. This quantity, widely known as string order parameter, in literature and its calculation is crucial for my work. For your reference you can look at H. Tasaki, Phys. Rev. Lett. 66, 798 (1991).
41 K. Hida, Phys. Rev. B 45, 2207 (1992).
Kindly help

Your z looks awfully like the S_z operator. Can you do e^{i\pi/2 \sum z_k}=\prod_k e^{i \pi/2 z_k} and apply these as one site operators? The form of e^{i \pi/2 z_k} should be able to be derived analytically even. Then you can apply them manually or form a custom MPO.

1 Like

Hey thanks for your response. Could you please share the code to exponentiate z and multiply it and convert it to MPO?

If you don’t want to work it out by hand, you can do something like exp(im*pi/2*op("Sz",sites[1])). Then check out how to apply a list of gates here. This will scale as the distance between i and j.

For making an MPO, you can make a list of operators starting with the identity (O_ops = [op("I",sites[i]) for i=1:L]), modify any of these to be the operators of your O_{str}, then make an MPO via O = MPO(O_ops). This will scale as L however so I’m not sure its the best. There may be a better way to do this though (maybe with correlators?)