Skip to content

Commit 2c02e3f

Browse files
committed
fix off-by-one error
1 parent ffe3f91 commit 2c02e3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/states/abstractmps.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,14 @@ function makefullrank!(virtualspaces::PeriodicVector{S}, physicalspaces::Periodi
135135
while haschanged
136136
haschanged = false
137137
for i in 1:length(virtualspaces)
138-
Vmax = fuse(physicalspaces[i - 1], virtualspaces[i - 1])
138+
Vmax = fuse(virtualspaces[i - 1], physicalspaces[i - 1])
139139
if !(virtualspaces[i] Vmax)
140140
virtualspaces[i] = infimum(virtualspaces[i], Vmax)
141141
haschanged = true
142142
end
143143
end
144144
for i in reverse(1:length(virtualspaces))
145-
Vmax = fuse(dual(physicalspaces[i]), virtualspaces[i])
145+
Vmax = fuse(dual(physicalspaces[i - 1]), virtualspaces[i])
146146
if !(virtualspaces[i - 1] Vmax)
147147
virtualspaces[i - 1] = infimum(virtualspaces[i - 1], Vmax)
148148
haschanged = true

0 commit comments

Comments
 (0)