Skip to content

Fix 3-site SU dt and reduce artificial C4v breaking #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 16, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
19 changes: 10 additions & 9 deletions src/algorithms/time_evolution/evoltools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,27 +181,28 @@
c c+1
```
"""
function _get_gatempo_se(gate::LocalOperator, row::Int, col::Int)
Nr, Nc = size(gate.lattice)
function _get_gatempo_se(ham::LocalOperator, dt::Number, row::Int, col::Int)
Nr, Nc = size(ham.lattice)

Check warning on line 185 in src/algorithms/time_evolution/evoltools.jl

View check run for this annotation

Codecov / codecov/patch

src/algorithms/time_evolution/evoltools.jl#L184-L185

Added lines #L184 - L185 were not covered by tests
@assert 1 <= row <= Nr && 1 <= col <= Nc
unit = id(space(gate.terms[1].second, 1))
unit = id(space(ham.terms[1].second, 1))

Check warning on line 187 in src/algorithms/time_evolution/evoltools.jl

View check run for this annotation

Codecov / codecov/patch

src/algorithms/time_evolution/evoltools.jl#L187

Added line #L187 was not covered by tests
sites = (
CartesianIndex(row, col),
CartesianIndex(row, col + 1),
CartesianIndex(row - 1, col + 1),
)
nb1x = get_gateterm(gate, (sites[1], sites[2]))
nb1y = get_gateterm(gate, (sites[2], sites[3]))
nb2 = get_gateterm(gate, (sites[1], sites[3]))
nb1x = get_gateterm(ham, (sites[1], sites[2]))
nb1y = get_gateterm(ham, (sites[2], sites[3]))
nb2 = get_gateterm(ham, (sites[1], sites[3]))

Check warning on line 195 in src/algorithms/time_evolution/evoltools.jl

View check run for this annotation

Codecov / codecov/patch

src/algorithms/time_evolution/evoltools.jl#L193-L195

Added lines #L193 - L195 were not covered by tests
op = (1 / 2) * (nb1x ⊗ unit + unit ⊗ nb1y) + permute(nb2 ⊗ unit, ((1, 3, 2), (4, 6, 5)))
op = exp(-dt * op)

Check warning on line 197 in src/algorithms/time_evolution/evoltools.jl

View check run for this annotation

Codecov / codecov/patch

src/algorithms/time_evolution/evoltools.jl#L197

Added line #L197 was not covered by tests
return gate_to_mpo3(op)
end

"""
Construct the 3-site gate MPOs on the southeast cluster
for 3-site simple update on square lattice.
"""
function _get_gatempos_se(gate::LocalOperator)
Nr, Nc = size(gate.lattice)
return collect(_get_gatempo_se(gate, r, c) for r in 1:Nr, c in 1:Nc)
function _get_gatempos_se(ham::LocalOperator, dt::Number)
Nr, Nc = size(ham.lattice)
return collect(_get_gatempo_se(ham, dt, r, c) for r in 1:Nr, c in 1:Nc)

Check warning on line 207 in src/algorithms/time_evolution/evoltools.jl

View check run for this annotation

Codecov / codecov/patch

src/algorithms/time_evolution/evoltools.jl#L205-L207

Added lines #L205 - L207 were not covered by tests
end
16 changes: 11 additions & 5 deletions src/algorithms/time_evolution/simpleupdate3site.jl
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,13 @@
),
)
peps2 = deepcopy(peps)
for i in 1:2
for i in 1:4

Check warning on line 417 in src/algorithms/time_evolution/simpleupdate3site.jl

View check run for this annotation

Codecov / codecov/patch

src/algorithms/time_evolution/simpleupdate3site.jl#L417

Added line #L417 was not covered by tests
for site in CartesianIndices(peps2.vertices)
r, c = site[1], site[2]
gs = gatempos[i][r, c]
_su3site_se!(r, c, gs, peps2, alg)
end
peps2 = (i == 1) ? rotl90(peps2) : rotr90(peps2)
peps2 = rotl90(peps2)

Check warning on line 423 in src/algorithms/time_evolution/simpleupdate3site.jl

View check run for this annotation

Codecov / codecov/patch

src/algorithms/time_evolution/simpleupdate3site.jl#L423

Added line #L423 was not covered by tests
end
return peps2
end
Expand All @@ -432,9 +432,15 @@
peps::InfiniteWeightPEPS, ham::LocalOperator, alg::SimpleUpdate; check_interval::Int=500
)
time_start = time()
gate = get_expham(alg.dt, ham)
# convert gates to 3-site MPOs
gatempos = [_get_gatempos_se(gate), _get_gatempos_se(rotl90(gate))]
# Convert Hamiltonian to 3-site exponentiated gate MPOs.
# Since each bond is updated 4 times,
# `dt` for each MPO should be divided by 4
gatempos = [

Check warning on line 438 in src/algorithms/time_evolution/simpleupdate3site.jl

View check run for this annotation

Codecov / codecov/patch

src/algorithms/time_evolution/simpleupdate3site.jl#L438

Added line #L438 was not covered by tests
_get_gatempos_se(ham, alg.dt / 4),
_get_gatempos_se(rotl90(ham), alg.dt / 4),
_get_gatempos_se(rot180(ham), alg.dt / 4),
_get_gatempos_se(rotr90(ham), alg.dt / 4),
]
wtdiff = 1.0
wts0 = deepcopy(peps.weights)
for count in 1:(alg.maxiter)
Expand Down