Skip to content
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

Implement simultaneous CTMRG scheme and CTMRG gradients without gauge-fix differentiation #53

Merged
merged 61 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
c390bec
Add truncated SVD adjoint with wrapper for KrylovKit iterative SVD, a…
pbrehmer Mar 4, 2024
51507ce
Use KrylovKit.linsolve for truncation linear problem, make loss funct…
pbrehmer Mar 5, 2024
d3a31fb
Improve loss function, compare SVD gradient with TensorKit.tsvd gradient
pbrehmer Mar 5, 2024
8ac307e
Update SVD adjoint linear problem to use Tuple and remove reshapes
pbrehmer Mar 26, 2024
80db1c0
Fix ZeroTangent case for linear problem
pbrehmer Apr 11, 2024
ae96298
Add SVD wrapper structs and function, utilize tsvd machinery, convert…
pbrehmer Jun 20, 2024
78ab152
Copy ctmrg.jl from master, add svdalg field to CTMRG, use svdwrap in …
pbrehmer Jun 20, 2024
dc6ad2b
Merge branch 'master' into svd_adjoint
lkdvos Jun 28, 2024
fc6600e
Use KrylovKit implementation of eigsolve instead of eigsolve.jl, dele…
pbrehmer Jul 4, 2024
823f52e
Add IterSVD _tsvd! method and adjoint using KrylovKit.svdsolve adjoint
pbrehmer Jul 5, 2024
a615b4a
Add PEPSKit.tsvd wrapper, fix IterSVD adjoint
pbrehmer Jul 5, 2024
a815e41
Add TensorKit compat entry for softened tsvd type restrictions
pbrehmer Jul 5, 2024
447bfd8
Add ProjectorAlg and refactor all tests and examples
pbrehmer Jul 5, 2024
bbd132d
Update MPSKit compat
lkdvos Jul 5, 2024
0c03cd4
Replace tsvd with tsvd!, add views to IterSVD adjoint
pbrehmer Jul 8, 2024
14f0065
Improve IterSVD allocation, implement CTMRG convenience constructor, …
pbrehmer Jul 8, 2024
9b2c4b7
Fix tests
pbrehmer Jul 8, 2024
0c13d47
Add block-wise dense fallback option
pbrehmer Jul 8, 2024
538652d
Add SVDrrule wrapper, add separate adjoint structs and rrules, update…
pbrehmer Jul 8, 2024
7032ed0
Add IterSVD test for symmetric tensor with fallback
pbrehmer Jul 9, 2024
66a827e
Merge branch 'master' into svd_adjoint
pbrehmer Jul 9, 2024
d09561f
Formatting
pbrehmer Jul 9, 2024
b3a0726
Fix missing cnext in ctmrg, update README example
pbrehmer Jul 9, 2024
89ae0a4
Rename DenseSVDAdjoint, update svd_wrapper test
pbrehmer Jul 9, 2024
25d198c
Make CRCExt extension backwards compatible with v1.8
pbrehmer Jul 9, 2024
6b818e7
Replace SVDrrule with SVDAdjoint, clean up adjoint algorithms
pbrehmer Jul 9, 2024
32f7b9f
Separate CTMRG gauge fixing from main file, add correlation length
pbrehmer Jul 9, 2024
6afda34
Add AllSides scheme
pbrehmer Jul 9, 2024
14f8ac4
Adjust gauge fixing
pbrehmer Jul 9, 2024
8fe9183
Add FixedSVD, refactor build_projectors, improve SVD passing
pbrehmer Jul 10, 2024
08a907e
Make runnable and add leftmoves/allsides test
pbrehmer Jul 10, 2024
555ba8d
Merge branch 'master' into pb-ctmrg-allsides
pbrehmer Jul 10, 2024
50cb911
Add GradMode{F} type parameter for iterscheme, fix runtests.jl
pbrehmer Jul 10, 2024
8eb3f7c
Add iterscheme flag to GradMode, add GradMode wrapper for KrylovKit.L…
pbrehmer Jul 10, 2024
c3ad83a
Fix AllSides mode, add element-wise convergence test for FixedSVD
pbrehmer Jul 10, 2024
584380c
Write new contractions in new index convention, add `@autoopt`
pbrehmer Jul 10, 2024
3de5685
Add :FixedIter and :LeftMoves safeguard, pdate tests
pbrehmer Jul 11, 2024
8e9ca87
Update tests
pbrehmer Jul 11, 2024
eaa8506
Parallelize AllSides CTMRG using hacky differentiable @fwdthreads mac…
pbrehmer Jul 11, 2024
bd77412
Fix tests some more
pbrehmer Jul 11, 2024
023d90e
Stabilize gaugefix test
pbrehmer Jul 12, 2024
eb8c5bc
Refactor enlarged corners and AllSides corner contractions
pbrehmer Jul 12, 2024
86b204d
Fix small `@diffset` switch up
pbrehmer Jul 12, 2024
8b16c18
Fix `@diffset` race condition in AllSides CTMRG, update gaugefix.jl t…
pbrehmer Jul 12, 2024
2e2a472
Rename :sequential, :simultaneous, :fixed, :diffgauge
pbrehmer Jul 12, 2024
e8bf56b
Merge branch 'master' into pb-ctmrg-allsides
pbrehmer Jul 12, 2024
2f4db74
Fix old CTMRGEnv constructor
pbrehmer Jul 12, 2024
4c0ba28
Formatting
pbrehmer Jul 12, 2024
47a74a0
Move correlation_length out of PR (add separate PR later)
pbrehmer Jul 15, 2024
4c65c8c
Refactor enlarged corners again, update Defaults, clean up docstrings
pbrehmer Jul 15, 2024
ccb1f95
Clean up and format
pbrehmer Jul 15, 2024
741f4de
Merge branch 'master' into pb-ctmrg-allsides
pbrehmer Jul 15, 2024
fe17ed7
Fix left over merge issues, update default verbosities
pbrehmer Jul 15, 2024
9b00244
Fix calc_elementwise_convergence in tests, add consistency test betwe…
pbrehmer Jul 15, 2024
bcd2798
Revert gaugefix.jl test back to old state
pbrehmer Jul 15, 2024
4713c11
Fix new PEPSOptimize constructor in tests
pbrehmer Jul 15, 2024
df4fa10
Fix formatting, fix convention of Ising model
pbrehmer Jul 15, 2024
ec1ca7d
Implement review comments
pbrehmer Jul 16, 2024
90cab74
Stabilize tests
pbrehmer Jul 16, 2024
0fcad18
Reintroduce p-wave to gradients test (only with :sequential)
pbrehmer Jul 16, 2024
677bbeb
Disable gradparts.jl test
pbrehmer Jul 16, 2024
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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ ctm_alg = CTMRG(; tol=1e-10, miniter=4, maxiter=100, verbosity=1, trscheme=trunc
opt_alg = PEPSOptimize(;
boundary_alg=ctm_alg,
optimizer=LBFGS(4; maxiter=100, gradtol=1e-4, verbosity=2),
gradient_alg=GMRES(; tol=1e-6, maxiter=100),
gradient_alg=LinSolver(),
reuse_env=true,
verbosity=2,
)

# ground state search
Expand Down
3 changes: 1 addition & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ ctm_alg = CTMRG(; tol=1e-10, miniter=4, maxiter=100, verbosity=1, trscheme=trunc
opt_alg = PEPSOptimize(;
boundary_alg=ctm_alg,
optimizer=LBFGS(4; maxiter=100, gradtol=1e-4, verbosity=2),
gradient_alg=GMRES(; tol=1e-6, maxiter=100),
gradient_alg=LinSolver(),
reuse_env=true,
verbosity=2,
)

# ground state search
Expand Down
5 changes: 2 additions & 3 deletions examples/heisenberg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ H = square_lattice_heisenberg(; Jx=-1, Jy=1, Jz=-1)
# Parameters
χbond = 2
χenv = 20
ctm_alg = CTMRG(; tol=1e-10, miniter=4, maxiter=100, verbosity=1, trscheme=truncdim(χenv))
ctm_alg = CTMRG(; tol=1e-10, miniter=4, maxiter=100, verbosity=2)
opt_alg = PEPSOptimize(;
boundary_alg=ctm_alg,
optimizer=LBFGS(4; maxiter=100, gradtol=1e-4, verbosity=2),
gradient_alg=GMRES(; tol=1e-6, maxiter=100),
gradient_alg=LinSolver(; solver=GMRES(; tol=1e-6, maxiter=100)),
reuse_env=true,
verbosity=2,
)

# Ground state search
Expand Down
15 changes: 12 additions & 3 deletions src/PEPSKit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using MPSKit: loginit!, logiter!, logfinish!, logcancel!
include("utility/util.jl")
include("utility/svd.jl")
include("utility/rotations.jl")
include("utility/diffset.jl")
include("utility/hook_pullback.jl")
include("utility/autoopt.jl")

Expand All @@ -31,7 +32,9 @@ include("environments/ctmrgenv.jl")
include("operators/localoperator.jl")
include("operators/models.jl")

include("algorithms/ctmrg_gauge_fix.jl")
include("algorithms/ctmrg.jl")
include("algorithms/ctmrg_all_sides.jl")
include("algorithms/peps_opt.jl")

include("utility/symmetrization.jl")
Expand All @@ -54,19 +57,25 @@ Module containing default values that represent typical algorithm parameters.
- `fpgrad_tol = 1e-6`: Convergence tolerance for the fixed-point gradient iteration
"""
module Defaults
using TensorKit, KrylovKit, OptimKit
const ctmrg_maxiter = 100
const ctmrg_miniter = 4
const ctmrg_tol = 1e-12
const fpgrad_maxiter = 100
const ctmrg_tol = 1e-10
const fpgrad_maxiter = 20
const fpgrad_tol = 1e-6
const ctmrgscheme = :simultaneous
const iterscheme = :fixed
const fwd_alg = TensorKit.SVD()
const rrule_alg = GMRES(; tol=ctmrg_tol)
const optimizer = LBFGS(10; maxiter=100, gradtol=1e-4, verbosity=2)
end

export SVDAdjoint, IterSVD, NonTruncSVDAdjoint
export FixedSpaceTruncation, ProjectorAlg, CTMRG, CTMRGEnv
export LocalOperator
export expectation_value, costfun
export leading_boundary
export PEPSOptimize, GeomSum, ManualIter, LinSolve
export PEPSOptimize, GeomSum, ManualIter, LinSolver
export fixedpoint

export InfinitePEPS, InfiniteTransferPEPS
Expand Down
Loading