diff --git a/examples/vumps/vumps_2d_heisenberg.jl b/examples/vumps/vumps_2d_heisenberg.jl index 968606d..35118d1 100644 --- a/examples/vumps/vumps_2d_heisenberg.jl +++ b/examples/vumps/vumps_2d_heisenberg.jl @@ -34,9 +34,9 @@ function ITensorInfiniteMPS.unit_cell_terms(::Model"heisenberg2D"; width) opsum = OpSum() for i in 1:width # Vertical - opsum += -0.5, "S+", i, "S-", mod(i + 1, width) - opsum += -0.5, "S-", i, "S+", mod(i + 1, width) - opsum += "Sz", i, "Sz", mod(i + 1, width) + opsum += -0.5, "S+", i, "S-", mod(i, width) + 1 + opsum += -0.5, "S-", i, "S+", mod(i, width) + 1 + opsum += "Sz", i, "Sz", mod(i, width) + 1 # Horizontal opsum += -0.5, "S+", i, "S-", i + width opsum += -0.5, "S-", i, "S+", i + width diff --git a/src/models/models.jl b/src/models/models.jl index 206defd..ac0b3a2 100644 --- a/src/models/models.jl +++ b/src/models/models.jl @@ -245,6 +245,12 @@ function infinite_terms(opsum::OpSum; kwargs...) # stores all terms starting on site `i`. opsum_cell_dict = groupreduce(minimum ∘ ITensors.sites, +, opsum) nsites = maximum(keys(opsum_cell_dict)) + # check that we don't have terms we will ignore + dropped = filter(x -> x <= 0, keys(opsum_cell_dict)) + if length(dropped) > 0 + @warn "The input unit cell terms include terms that are being ignored on sites: $([d for d in dropped])" + end + # Assumes each site in the unit cell has a term for j in 1:nsites if !haskey(opsum_cell_dict, j)