Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions examples/vumps/vumps_2d_heisenberg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ conserve_qns = true
solver_tol = (x -> x / 10)
outer_iters = 10 # Number of times to increase the bond dimension
width = 4
yperiodic = false # OBC vs cylinder

##############################################################################
# CODE BELOW HERE DOES NOT NEED TO BE MODIFIED
Expand All @@ -30,7 +31,7 @@ initstate(n) = isodd(n) ? "↑" : "↓"
s = infsiteinds("S=1/2", N; conserve_qns, initstate)
ψ = InfMPS(s, initstate)

function ITensorInfiniteMPS.unit_cell_terms(::Model"heisenberg2D"; width)
function ITensorInfiniteMPS.unit_cell_terms(::Model"heisenberg2D"; width, yperiodic)
opsum = OpSum()
for i in 1:width
# Vertical
Expand All @@ -42,12 +43,17 @@ function ITensorInfiniteMPS.unit_cell_terms(::Model"heisenberg2D"; width)
opsum += -0.5, "S-", i, "S+", i + width
opsum += "Sz", i, "Sz", i + width
end
if yperiodic
opsum += -0.5, "S+", 1, "S-", width
opsum += -0.5, "S-", 1, "S+", width
opsum += "Sz", 1, "Sz", width
end
return opsum
end
model = Model("heisenberg2D")

# Form the Hamiltonian
H = InfiniteSum{MPO}(model, s; width)
H = InfiniteSum{MPO}(model, s; width, yperiodic)

# Check translational invariance
# println("\nCheck translation invariance of the initial VUMPS state")
Expand Down
Loading