0 votes
asked by (210 points)

I would like to perform TEBD with the Hamiltonian,
$$
H=\sum^{N-1}{i} (XX + YY) + \sum{i=1}^{N} V(i)Z
$$
Where V(i) is just some function that depends on the site. I want this written as a gate but when I compare numerics to small system size ED they do not match. Here is the code for creating my gates. Help is much appreciated

function Gates(N::Int, dt::Float64, J, λ, q, phi, sindex)
gates = ITensor[]
for j=1:N-1
    s1 = sindex[j]
    s2 = sindex[j+1]
    if j != (N-1)
        Wj = 2*λ*cos(2*pi*q*j + phi)
        hj = J[j]*0.5*(op("S+", s1)*op("S-", s2) + op("S-", s1)*op("S+", s2)) + Wj*op("Sz", s1)*op("Id", s2)
        Gj = exp(-1.0im*0.5*dt*hj)
    elseif j==(N-1)
        WjN = 2*λ*cos(2*pi*q*N + phi)
        Wj = 2*λ*cos(2*pi*q*j + phi)
        hj = J[j]*0.5*(op("S+", s1)*op("S-", s2) + op("S-", s1)*op("S+", s2)) + WjN*op("Id", s1)*op("Sz", s2) + Wj*op("Sz", s1)*op("Id", s2)
        Gj = exp(-1.0im*0.5*dt*hj)
    end
    push!(gates, Gj)
end
append!(gates, reverse(gates))

end

1 Answer

0 votes
answered by (70.1k points)

Just a reminder this forum is now closed, and we are leaving it here mainly so that people can search it for previous answers.

Thanks for realizing this, clanglett, and posting on the new forum.

You can see my response here:
https://itensor.discourse.group/t/adding-a-field-to-hamiltonian-for-tebd-gates/364/2

Welcome to ITensor Support Q&A, where you can ask questions and receive answers from other members of the community.

Formatting Tips:
  • To format code, indent by four spaces
  • To format inline LaTeX, surround it by @@ on both sides
  • To format LaTeX on its own line, surround it by $$ above and below
  • For LaTeX, it may be necessary to backslash-escape underscore characters to obtain proper formatting. So for example writing \sum\_i to represent a sum over i.
If you cannot register due to firewall issues (e.g. you cannot see the capcha box) please email Miles Stoudenmire to ask for an account.

To report ITensor bugs, please use the issue tracker.

Categories

...