Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Commit

Permalink
Update syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jofrevalles committed Feb 16, 2024
1 parent fa4bfbb commit 656e4d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Ansatz/Chain.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ end

leftsite(tn::Chain, site::Site) = leftsite(boundary(tn), tn, site)
function leftsite(::Open, tn::Chain, site::Site)
(site.id > length(sites(tn)) || site.id <= 1) && throw(ArgumentError("Invalid site $site"))
site.id range(2, length(sites(tn))) && throw(ArgumentError("Invalid site $site"))
Site(site.id - 1)
end
leftsite(::Periodic, tn::Chain, site::Site) = Site(mod1(site.id - 1, length(sites(tn))))

rightsite(tn::Chain, site::Site) = rightsite(boundary(tn), tn, site)
function rightsite(::Open, tn::Chain, site::Site)
(site.id > length(sites(tn))-1 || site.id < 1) && throw(ArgumentError("Invalid site $site"))
site.id range(1, length(sites(tn))-1) && throw(ArgumentError("Invalid site $site"))
Site(site.id + 1)
end
rightsite(::Periodic, tn::Chain, site::Site) = Site(mod1(site.id + 1, length(sites(tn))))
Expand Down

0 comments on commit 656e4d5

Please sign in to comment.