Skip to content

Commit 1383693

Browse files
authored
Switch to GMRES-based gradient solver to stabilize simple update into AD optimization test (#279)
* Switch gradient algorithm to `LinSolver` to stabilize SU->AD test * Update changelog [skip ci]
1 parent 64d09ff commit 1383693

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
- Add unit normalization of the half and full infinite environments before the projector
1515
computation, fixing an issue with the gradient accuracy.
16+
- Fix sporadic test timeouts when running variational optimization after simple
17+
update for the Heisenberg model by switching to a `GMRES`-based gradient solver.
1618

1719
### Changed
1820

test/examples/heisenberg.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ end
5353
Vspace =^Dbond
5454
Espace =^χenv
5555
ctmrg_tol = 1.0e-8
56+
ctmrg_maxiter = 200
5657
peps = InfinitePEPS(rand, Float64, Pspace, Vspace; unitcell = (N1, N2))
5758
wts = SUWeight(peps)
5859
normalize!.(peps.A, Inf)
@@ -76,7 +77,7 @@ end
7677

7778
# measure physical quantities with CTMRG
7879
normalize!.(peps.A, Inf)
79-
env, = leading_boundary(CTMRGEnv(rand, Float64, peps, Espace), peps; tol = ctmrg_tol)
80+
env, = leading_boundary(CTMRGEnv(rand, Float64, peps, Espace), peps; tol = ctmrg_tol, maxiter = ctmrg_maxiter)
8081
e_site = cost_function(peps, env, ham) / (N1 * N2)
8182
@info "Simple update energy = $e_site"
8283
# benchmark data from Phys. Rev. B 94, 035133 (2016)
@@ -88,7 +89,8 @@ end
8889
peps,
8990
env;
9091
optimizer_alg = (; tol = gradtol, maxiter = 25),
91-
boundary_alg = (; maxiter = 150, svd_alg = (; rrule_alg = (; alg = :full, tol = 1.0e-5))),
92+
boundary_alg = (; maxiter = ctmrg_maxiter),
93+
gradient_alg = (; alg = :linsolver, solver_alg = (; alg = :gmres)),
9294
) # sensitivity warnings and degeneracies due to SU(2)?
9395
ξ_h, ξ_v, = correlation_length(peps_final, env_final)
9496
e_site2 = E_final / (N1 * N2)

0 commit comments

Comments
 (0)