-
Notifications
You must be signed in to change notification settings - Fork 22
CompatHelper: bump compat for OptimKit to 0.4, (keep existing compat) #122
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
leburgel
merged 5 commits into
master
from
compathelper/new_version/2025-01-28-01-10-04-750-01930399612
Feb 3, 2025
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8f5829e
CompatHelper: bump compat for OptimKit to 0.4, (keep existing compat)
fe015a4
Merge branch 'master' into compathelper/new_version/2025-01-28-01-10-…
lkdvos 31d733a
Merge branch 'master' into compathelper/new_version/2025-01-28-01-10-…
lkdvos cc72e54
Update random seed and default LBFGS verbosity
pbrehmer e74e655
Remove sandbox file
pbrehmer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
using Test | ||
using Random | ||
using TensorKit | ||
using KrylovKit | ||
using LineSearches, Manifolds, Manopt | ||
using PEPSKit | ||
|
||
## | ||
using KrylovKit | ||
using TensorKit | ||
using PEPSKit | ||
|
||
Dbond = 2 | ||
χenv = 16 | ||
svd_alg = SVDAdjoint(; fwd_alg=IterSVD(; alg=GKL(; tol=1e-10))) | ||
ctmrg_alg = SimultaneousCTMRG(; svd_alg) | ||
ψ = InfinitePEPS(2, Dbond) | ||
env = leading_boundary(CTMRGEnv(ψ, ℂ^χenv), ψ, ctmrg_alg); | ||
|
||
## | ||
# initialize parameters | ||
Dbond = 2 | ||
χenv = 16 | ||
# ctm_alg = SequentialCTMRG() | ||
# opt_alg = PEPSOptimize(; boundary_alg=ctm_alg, tol=1e-3, gradient_alg=LinSolver(; solver=GMRES(; tol=1e-4), iterscheme=:diffgauge)) | ||
ctm_alg = SimultaneousCTMRG() | ||
opt_alg = PEPSOptimize(; boundary_alg=ctm_alg, tol=1e-3) | ||
# compare against Juraj Hasik's data: | ||
# https://github.com/jurajHasik/j1j2_ipeps_states/blob/main/single-site_pg-C4v-A1/j20.0/state_1s_A1_j20.0_D2_chi_opt48.dat | ||
E_ref = -0.6602310934799577 | ||
|
||
# initialize states | ||
Random.seed!(123) | ||
H = heisenberg_XYZ(InfiniteSquare()) | ||
psi_init = InfinitePEPS(2, Dbond) | ||
env_init, = leading_boundary(CTMRGEnv(psi_init, ComplexSpace(χenv)), psi_init, ctm_alg) | ||
|
||
# optimize energy and compute correlation lengths | ||
peps, env, E, = fixedpoint(psi_init, H, opt_alg, env_init); | ||
ξ_h, ξ_v, = correlation_length(peps, env) | ||
|
||
@test E ≈ E_ref atol = 1e-2 | ||
@test all(@. ξ_h > 0 && ξ_v > 0) | ||
|
||
## | ||
g = 3.1 | ||
e = -1.6417 * 2 | ||
mˣ = 0.91 | ||
|
||
# initialize parameters | ||
χbond = 2 | ||
χenv = 16 | ||
ctm_alg = SimultaneousCTMRG() | ||
opt_alg = PEPSOptimize(; | ||
boundary_alg=ctm_alg, | ||
tol=1e-3, | ||
# stepsize=WolfePowellBinaryLinesearch(), | ||
# stepsize=Manopt.LineSearchesStepsize(LineSearches.HagerZhang(; alphamax=1.0)), | ||
# stepsize=ConstantLength(1.0), | ||
# stepsize=WolfePowellLinesearch(), | ||
# stepsize=WolfePowellLinesearch(; sufficient_decrease=0.1, sufficient_curvature=0.9), | ||
# direction_update=InverseBroyden(1.0), | ||
# cautious_update=true, | ||
) | ||
|
||
# initialize states | ||
H = transverse_field_ising(InfiniteSquare(); g) | ||
H_polar = transverse_field_ising(InfiniteSquare(); g=4.5) | ||
Random.seed!(91283219347) | ||
psi_init = InfinitePEPS(2, χbond) | ||
env_init, = leading_boundary(CTMRGEnv(psi_init, ComplexSpace(χenv)), psi_init, ctm_alg) | ||
|
||
# find fixedpoint | ||
peps, env, E, = fixedpoint(psi_init, H, opt_alg, env_init); | ||
# peps_polar, env_polar, E_polar, = fixedpoint(psi_init, H_polar, opt_alg, env_init); | ||
|
||
## | ||
χbond = 2 | ||
χenv = 12 | ||
ctm_alg = SimultaneousCTMRG() | ||
opt_alg = PEPSOptimize(; | ||
boundary_alg=ctm_alg, | ||
tol=1e-3, | ||
gradient_alg=LinSolver(; iterscheme=:diffgauge), | ||
symmetrization=RotateReflect(), | ||
) | ||
|
||
# initialize states | ||
Random.seed!(91283219347) | ||
H = j1_j2(InfiniteSquare(); J2=0.25) | ||
psi_init = product_peps(2, χbond; noise_amp=1e-1) | ||
psi_init = symmetrize!(psi_init, RotateReflect()) | ||
env_init, = leading_boundary(CTMRGEnv(psi_init, ComplexSpace(χenv)), psi_init, ctm_alg); | ||
|
||
# find fixedpoint | ||
result = fixedpoint(psi_init, H, opt_alg, env_init) | ||
|
||
## | ||
unitcell = (2, 2) | ||
H = pwave_superconductor(InfiniteSquare(unitcell...)) | ||
Dbond = 2 | ||
χenv = 16 | ||
ctm_alg = SimultaneousCTMRG() | ||
opt_alg = PEPSOptimize(; | ||
boundary_alg=ctm_alg, | ||
maxiter=10, | ||
gradient_alg=LinSolver(; iterscheme=:diffgauge), | ||
# stepsize=WolfePowellLinesearch(), | ||
stepsize=ConstantLength(1.5), | ||
memory_size=4, | ||
) | ||
|
||
# initialize states | ||
Pspace = Vect[FermionParity](0 => 1, 1 => 1) | ||
Vspace = Vect[FermionParity](0 => Dbond ÷ 2, 1 => Dbond ÷ 2) | ||
Envspace = Vect[FermionParity](0 => χenv ÷ 2, 1 => χenv ÷ 2) | ||
Random.seed!(91283219347) | ||
psi_init = InfinitePEPS(Pspace, Vspace, Vspace; unitcell) | ||
env_init, = leading_boundary(CTMRGEnv(psi_init, Envspace), psi_init, ctm_alg); | ||
|
||
# find fixedpoint | ||
peps, env, E, = fixedpoint(psi_init, H, opt_alg, env_init); | ||
@show E / 4 | ||
|
||
# comparison with Gaussian PEPS minimum at D=2 on 1000x1000 square lattice with aPBC | ||
@test E / prod(size(psi_init)) ≈ -2.6241 atol = 5e-2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.