# How to calculate dynamical spin structure factor S(k,w) of a spin chain?

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)=<psi0| S^zr(0) exp(-i(H-E0)t) S^z0(0) |psi0> ,
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^zr(0), B=exp(-i(HE0) t), C=S^z0(0)
(Step2.2) calculate the total MPO by multiplying the three MPOs,
X=ABC
(Step2.3) calculate the overlap,
C(r,t)=<psi0|M|psi0>
I am not sure if this implementation works, and even if it does, I believe it is computationally super inefficient. )

Hi, so it's a good question about the best way to do these things. However, it's a very complicated question to answer with many different aspects that are too detailed to get into here. So I think the best thing I can do is to point you to the relevant literature, which is pretty extensive. A good paper about obtaining exactly the quantity you are asking about is this one:
https://journals.aps.org/prb/abstract/10.1103/PhysRevB.77.134437

Another paper with some helpful information is the review article by Schollwock (see near page 156):
http://www.sciencedirect.com/science/article/pii/S0003491610001752

Typically for step (2), if the Hamiltonian is sufficiently short ranged, the nicest approach for doing the time evolution is just to use a Trotter decomposition of exp(-i t H) and apply the resulting unitary 'gates' to an MPS (after acting on the MPS with the Sz operator, say).

Based on your question, I just added a "Code Formula" about how to set up Trotter gate time evolution with ITensor:
http://itensor.org/docs.cgi?page=formulas/tevol_trotter
I hope you find it useful. Please also see the closely related one about time evolution with an MPO, which is an alternative techniques with some advantages and disadvantages.

Best regards,
Miles