I am trying to calculate a dynamical spin structure factor S(k, w) of a spin chain (e.g., 1d Heisenberg Model, in order to check if I can see the spin wave dispersion).

An implementation that I am thinking of is;

(Step 1) get the groundstate |psi_0> by DMRG for a given Hamiltonian (I can already do this easily)

(Step 2) calculate the time-dependent correlation function,

C^a(r,t)=,

where the superscript a={x, y, z} is a spin component, and the subscript r is a site index, and t is time.

Simplifying the above expression by using the interaction picture,

C^a(r, t)=<psi*0| S^z*r(0) exp(-i(H-E*0)t) S^z*0(0) |psi*0> ,
where E*0 is the groundstate energy, which I already calculated in step(1)

(Step 3) then Fourier transforming,

C^a(r,t) ---> S^a(k, w)

I want to know an efficient way of doing Step 2. It would be great if you can provide a sample code (for me, looking at a sample working code is the best way to learn).

Also if you have any practical tips (e.g., how to choose the interval of time-evolutions to get the most accurate S(k,w) etc ), please make some comments as well.

Thanks,

Soshi

(The most naive implementation I can think of for Step2 is;

for each r & t,

(Step2.1) define three MPOs,

A=S^z*r(0), B=exp(-i(H*E*0) t), C=S^z*0(0)

(Step2.2) calculate the total MPO by multiplying the three MPOs,

X=A*B*C

(Step2.3) calculate the overlap,

C(r,t)=<psi*0|M|psi*0>

I am not sure if this implementation works, and even if it does, I believe it is computationally super inefficient. )