Regarding Two point correlation function in TenPy

How do I use this algorithm? What does that parameter do?
Post Reply
Sourav Nandy
Posts: 5
Joined: 03 Aug 2022, 11:30

Regarding Two point correlation function in TenPy

Post by Sourav Nandy »

Hi,

I am a new user to TenPy. I have the following question. I am doing TEBD time evolution in the spin system. I wish to compute unequal time correlation function i.e < \psi_{in} | S_{z}^{i}(t) S_z^{j}(0) | \psi_{in} >, where \psi_{in} is the initial state and i,j are two points in the lattice. Could you please let me know how to compute such quantity in python ?
User avatar
Johannes
Site Admin
Posts: 413
Joined: 21 Jul 2018, 12:52
Location: TU Munich

Re: Regarding Two point correlation function in TenPy

Post by Johannes »

In general, you should probably do this for one j in the center of your chain only and write this as
\[C(t) = \langle \psi_0 | e^{i H t} S^z_i e^{-iHt} S^z_j | \psi_0 \rangle = \langle \psi(t) | S^z_i | \phi(t) \rangle, \quad \text{where} \quad |\psi(t) \rangle = e^{-iHt} |\psi_0 \rangle \text{~and~} |\phi(t) \rangle = e^{-iHt} S^z_j|\psi_0 \rangle \]

In TeNPy, this amounts roughly to something like this (untested, just written down here quickly...)

Code: Select all

assert psi.bc == 'finite'
phi = psi.copy()
phi.apply_local_op(phi.L//2, 'Sz')
eng_psi = TEBDEngine(psi, model, tebd_params)
eng_phi = TEBDEngine(phi, model, tebd_params)
C_i_t = []
times = []
for i in range(max_steps):
    eng_psi.run()
    eng_phi.run()
    assert abs(eng_psi.evolved_time - eng_phi.evolved_time) < 1.e-8
    times.append(eng_psi.evolved_time)
    C_i =  MPSEnvironment(psi, phi).expectation_value('Sz')
    C_i_t.append(C_i)
If \(|\psi_0\rangle\) is actually an eigenstate of H (typically the ground state), you could replace the evolution by a multiplication with a global phase. Sometimes, you get better results, though, if you evolve both, since then errors from psi_0 not being an exact eigenstate (e.g. due to too much truncation for low-bond-dimension MPS) can cancel out to some degree.
Sourav Nandy
Posts: 5
Joined: 03 Aug 2022, 11:30

Re: Regarding Two point correlation function in TenPy

Post by Sourav Nandy »

Thanks a lot :-)
Post Reply