Mixed nearest neighbour and next nearest neighbour TEBD

I am fairly new to tensor network methods and have just started using ITensors. I apologize if this is a repeat of a previous question.

The Hamiltonian I want to use for time evolution is,

H=-J \sum_j \sigma^z_j \sigma^z_{j+1}+\kappa \sum_j \sigma^z_j \sigma^z_{j+2}-B\sum_j \sigma^x_j

For this I need three types of gates. From the previous discussions in this forum I have combined

-J \sum_j \sigma^z_j \sigma^z_{j+1}-B\sum_j \sigma^x_j

as

hj =       J*op("Sz",s1) * op("Sz",s2) +
           B*op("Sx",s1) * op("Id",s2) 

to create a gate, and then pushed another gate of \kappa \sum_j \sigma^z_j \sigma^z_{j+2} after that. Hence the code looks like, for a ferromagnetic spin up initial state,

using ITensors

let
  N = 10
  cutoff = 1E-16
  tau = 0.01
  ttotal = 20
  B=-0.5 *2
  k=0.4 *4
  J=-1. *4

  # Compute the number of steps to do
  Nsteps = Int(ttotal/tau)

  # Make an array of 'site' indices
  s = siteinds("S=1/2",N;conserve_qns=false)

  # Make gates (1,2),(2,3),(3,4),...
  gates = ITensor[]
  for j=1:N-2
    s1 = s[j]
    s2 = s[j+1]
    s3=s[j+2]
    hj =       J*op("Sz",s1) * op("Sz",s2) +
           B*op("Sx",s1) * op("Id",s2) 
    Gj = exp(-1.0im * tau/2 * hj)
    push!(gates,Gj)
    hj2 =       k*op("Sz",s1) * op("Sz",s3) 
    Gj2 = exp(-1.0im * tau/2 * hj2)
    push!(gates,Gj2)
  end
  ssecond=s[N-1]
  slast=s[N]
  hsecondlast= J*op("Sz",ssecond) * op("Sz",slast) +
  B*op("Sx",ssecond) * op("Id",slast)
  Gsecondlast=exp(-1.0im * tau/2 * hsecondlast)
  push!(gates,Gsecondlast)
  hlast=B*op("Sx",slast)
  Glast=exp(-1.0im * tau/2 * hlast)
  push!(gates,Glast)
  # Include gates in reverse order too
  # (N,N-1),(N-1,N-2),...
  append!(gates,reverse(gates))

  # Function that measures <Sz> on site n
  function measure_Sz(psi,n)
    psi = orthogonalize(psi,n)
    sn = siteind(psi,n)
    Sz = scalar(dag(prime(psi[n],"Site"))*op("Sz",sn)*psi[n])
    return real(Sz)
  end

  # Initialize psi to be a product state (alternating up and down)
  psi = productMPS(s, "Up")

  c = 4

  # Compute and print initial <Sz> value
  t = 0.0
  Sz = measure_Sz(psi,c)
  println("$t $Sz")

  # Do the time evolution by applying the gates
  # for Nsteps steps
  for step=1:Nsteps
    psi = apply(gates, psi; cutoff=cutoff)
  #  @show linkdims(psi)
    t += tau
    orthogonalize!(psi,c)
    rho=prime(psi[c],s[c])*dag(psi[c])
    print("$t $rho") #one- site rdm which is what I need
#    Sz = measure_Sz(psi,c)
  #  println("$t $Sz")
  end
  return
end

I have chosen low cutoffs and dt to try and match with ED. In doing it like this while initially the agreement with ED is good, by t=10 errors are of the order 10^{-2} which seems too large for considering the parameters I have taken. I then also tried using 3-site gates,

 gates = ITensor[]
  for j=1:N-2
    s1 = s[j]
    s2 = s[j+1]
    s3=s[j+2]
    hj =       op("Sz",s1) * op("Sz",s2)*op("Id",s3) +op("Sz",s1) * op("Id",s2)*op("Sz",s3)
           +1.0*op("Sx",s1) * op("Id",s2)*op("Id",s3)
    Gj = exp(-1.0im * tau/2 * hj)
    push!(gates,Gj)
  end

But that actually gives no evolution!
I was wondering what I am doing wrong in either case and what is the best way to code this Hamiltonian.

Hi,

I think t=10 is maybe too long a time-period for 2nd order TEBD to work efficiently (that is, without accumulating a large error), especially in this case mainly due to the second-nearest-neighbour term (but in general TEBD2 accrues errors fast and is not recommended to use for long time evolution or for more complicated Hamiltonians). You might wanna try 4th order TEBD or TDVP if you really need to access time evolution over large times. The former requires some care in the order of the collection of the gates as has been discussed elsewhere in this forum, but the latter already has a built-in function available.

I am surprised the second approach of using 3-site gates is yielding no evolution at all !

Thanks for the heads up. I read a bit of TDVP in Itensor. I find that it has problems for small bond dimension. So would you say a correct approach can be evolving using TEBD for say till t=0.5 to allow the bond dimensions to develop and then going to TDVP?

Okay I did try TDVP, but the error while smaller still is quite significant it seems. I guess I cannot expect better results from tensor network approach specially when the system has no conservation laws, but I don’t know what tweaks I should try to get the best result out. Any ideas?

Hi, sorry for the late reply. I think T=10 is simply too long for most algorithms (given your H with second-nearest-neighbour interactions which very quickly increases entanglement) whose validity/efficacy is bounded by entanglement growth in some appropriate sense (these things are of course dependent on the actual H and the parameter regimes/phases etc). Simulation and probing of long-time dynamics is overall an open-ended issue in physics anyway, save for a few special cases. I guess until about T=4 or so your errors are well controlled and acceptable ?

Also, with TDVP, do ensure that you’re using the 2-site version (by including in kwargs the argument nsite=2) which allows TDVP to adapt the bond dimensions, and also might wanna experiment with increasing the specified maxdim (operationally proportional to the max entanglement allowed) which comes at the cost of increasing memory and time usage, but will/should help in keeping the errors lower for a bit longer perhaps.

Thanks for replying, no worries about the late reply. I shall try this but my worry is why for L=10 there should be a discrepancy when I am defining cutoffs to be machine precision and taking trotter down to 0.005, I would expect the error to be at most of the order of trotter value but its much larger. I should be able to span the full Hilbert space for L=10, shouldn’t I by ITensor? Or am I missing something findamental?

Nevermind your solution worked, for L=10 things match with exact. turns out the site I was looking at in exact vs TDVP were not the same but neighbours. But it only worked after I used the 2-site version of TDVP, so thanks.

1 Like