diff --git a/docs/src/examples/2d_ising_partition_function/index.md b/docs/src/examples/2d_ising_partition_function/index.md index 3e5c831b9..c3ef0b1c2 100644 --- a/docs/src/examples/2d_ising_partition_function/index.md +++ b/docs/src/examples/2d_ising_partition_function/index.md @@ -46,7 +46,7 @@ Since we later want to compute the magnetization and energy to check our results the appropriate rank-4 tensors here as well while we're at it. ````julia -function classical_ising(; beta=log(1 + sqrt(2)) / 2, J=1.0) +function classical_ising(; beta = log(1 + sqrt(2)) / 2, J = 1.0) K = beta * J # Boltzmann weights @@ -119,12 +119,12 @@ settings: ````julia Venv = ℂ^20 env₀ = CTMRGEnv(Z, Venv) -env, = leading_boundary(env₀, Z; tol=1e-8, maxiter=500); +env, = leading_boundary(env₀, Z; tol = 1.0e-8, maxiter = 500); ```` ```` [ Info: CTMRG init: obj = +1.784252138312e+00 -1.557258880375e+00im err = 1.0000e+00 -[ Info: CTMRG conv 63: obj = +3.353928644031e+00 err = 4.5903314811e-09 time = 8.12 sec +[ Info: CTMRG conv 63: obj = +3.353928644031e+00 err = 4.6032264022e-09 time = 5.74 sec ```` @@ -159,9 +159,9 @@ e = expectation_value(Z, (1, 1) => E, env) ```` ```` -λ = 3.3539286440313782 - 5.873212040152551e-16im -m = 0.9736086674403001 + 1.8262157316829647e-17im -e = -1.8637796145082437 - 1.4609725853463717e-16im +λ = 3.353928644031378 + 7.047583922370844e-16im +m = 0.9736086674403002 + 0.0im +e = -1.8637796145082448 + 1.4610281815259345e-16im ```` @@ -174,7 +174,7 @@ magnetization and energy per site (where we use `quadgk` to perform integrals of auxiliary variable from $0$ to $\pi/2$): ````julia -function classical_ising_exact(; beta=log(1 + sqrt(2)) / 2, J=1.0) +function classical_ising_exact(; beta = log(1 + sqrt(2)) / 2, J = 1.0) K = beta * J k = 1 / sinh(2 * K)^2 @@ -205,9 +205,9 @@ extrapolation): ```` ```` -(-(log(λ)) / beta - f_exact) / f_exact = -6.605563039765528e-16 - 1.447068124555315e-16im -(abs(m) - abs(m_exact)) / abs(m_exact) = -4.561270094458082e-16 -(e - e_exact) / e_exact = -0.023732068099090543 + 7.652732508485748e-17im +(-(log(λ)) / beta - f_exact) / f_exact = -8.807417386354037e-16 + 1.736415096112634e-16im +(abs(m) - abs(m_exact)) / abs(m_exact) = -3.420952570843561e-16 +(e - e_exact) / e_exact = -0.02373206809908996 - 7.653023727290916e-17im ```` diff --git a/docs/src/examples/2d_ising_partition_function/main.ipynb b/docs/src/examples/2d_ising_partition_function/main.ipynb index fcc17cec6..092054c04 100644 --- a/docs/src/examples/2d_ising_partition_function/main.ipynb +++ b/docs/src/examples/2d_ising_partition_function/main.ipynb @@ -66,7 +66,7 @@ "outputs": [], "cell_type": "code", "source": [ - "function classical_ising(; beta=log(1 + sqrt(2)) / 2, J=1.0)\n", + "function classical_ising(; beta = log(1 + sqrt(2)) / 2, J = 1.0)\n", " K = beta * J\n", "\n", " # Boltzmann weights\n", @@ -139,7 +139,7 @@ "source": [ "Venv = ℂ^20\n", "env₀ = CTMRGEnv(Z, Venv)\n", - "env, = leading_boundary(env₀, Z; tol=1e-8, maxiter=500);" + "env, = leading_boundary(env₀, Z; tol = 1.0e-8, maxiter = 500);" ], "metadata": {}, "execution_count": null @@ -202,7 +202,7 @@ "outputs": [], "cell_type": "code", "source": [ - "function classical_ising_exact(; beta=log(1 + sqrt(2)) / 2, J=1.0)\n", + "function classical_ising_exact(; beta = log(1 + sqrt(2)) / 2, J = 1.0)\n", " K = beta * J\n", "\n", " k = 1 / sinh(2 * K)^2\n", diff --git a/docs/src/examples/3d_ising_partition_function/index.md b/docs/src/examples/3d_ising_partition_function/index.md index 9fab4c32c..81de314e8 100644 --- a/docs/src/examples/3d_ising_partition_function/index.md +++ b/docs/src/examples/3d_ising_partition_function/index.md @@ -52,7 +52,7 @@ lattice. To verify our example we will check the magnetization and energy, so we the corresponding rank-6 tensors `M` and `E` while we're at it. ````julia -function three_dimensional_classical_ising(; beta, J=1.0) +function three_dimensional_classical_ising(; beta, J = 1.0) K = beta * J # Boltzmann weights @@ -161,9 +161,9 @@ we'll specify the specific reverse rule algorithm that will be used to compute t of this cost function. ````julia -boundary_alg = SimultaneousCTMRG(; maxiter=150, tol=1e-8, verbosity=1) +boundary_alg = SimultaneousCTMRG(; maxiter = 150, tol = 1.0e-8, verbosity = 1) rrule_alg = EigSolver(; - solver_alg=KrylovKit.Arnoldi(; maxiter=30, tol=1e-6, eager=true), iterscheme=:diffgauge + solver_alg = KrylovKit.Arnoldi(; maxiter = 30, tol = 1.0e-6, eager = true), iterscheme = :diffgauge ) T = InfinitePEPO(O) @@ -178,7 +178,7 @@ function pepo_costfun((peps, env_double_layer, env_triple_layer)) env_double_layer, n_double_layer, boundary_alg; - alg_rrule=rrule_alg, + alg_rrule = rrule_alg, ) # construct the PEPS-PEPO-PEPS overlap network n_triple_layer = InfiniteSquareNetwork(ψ, T) @@ -188,7 +188,7 @@ function pepo_costfun((peps, env_double_layer, env_triple_layer)) env_triple_layer, n_triple_layer, boundary_alg; - alg_rrule=rrule_alg, + alg_rrule = rrule_alg, ) # update the environments for reuse PEPSKit.ignore_derivatives() do @@ -253,12 +253,12 @@ function pepo_retract((peps, env_double_layer, env_triple_layer), η, α) return (peps´, env_double_layer´, env_triple_layer´), ξ end function pepo_transport!( - ξ, - (peps, env_double_layer, env_triple_layer), - η, - α, - (peps´, env_double_layer´, env_triple_layer´), -) + ξ, + (peps, env_double_layer, env_triple_layer), + η, + α, + (peps´, env_double_layer´, env_triple_layer´), + ) return PEPSKit.peps_transport!( ξ, (peps, env_double_layer), η, α, (peps´, env_double_layer´) ) @@ -279,99 +279,97 @@ psi0 = initializePEPS(T, Vpeps) env2_0 = CTMRGEnv(InfiniteSquareNetwork(psi0), Venv) env3_0 = CTMRGEnv(InfiniteSquareNetwork(psi0, T), Venv) -optimizer_alg = LBFGS(32; maxiter=100, gradtol=1e-5, verbosity=3) +optimizer_alg = LBFGS(32; maxiter = 100, gradtol = 1.0e-5, verbosity = 3) (psi_final, env2_final, env3_final), f, = optimize( pepo_costfun, (psi0, env2_0, env3_0), optimizer_alg; - inner=PEPSKit.real_inner, - retract=pepo_retract, - (transport!)=(pepo_transport!), + inner = PEPSKit.real_inner, + retract = pepo_retract, + (transport!) = (pepo_transport!), ); ```` ```` [ Info: LBFGS: initializing with f = -0.554073395182, ‖∇f‖ = 7.7844e-01 -┌ Warning: CTMRG cancel 150: obj = +1.702942227203e+01 +1.438609518622e-07im err = 2.4390784946e-05 time = 25.66 sec -└ @ PEPSKit ~/git/PEPSKit.jl/src/algorithms/ctmrg/ctmrg.jl:153 -[ Info: LBFGS: iter 1, time 72.51 s: f = -0.777080930424, ‖∇f‖ = 3.1305e-02, α = 7.10e+02, m = 0, nfg = 7 -[ Info: LBFGS: iter 2, time 76.22 s: f = -0.784111515920, ‖∇f‖ = 2.0103e-02, α = 1.00e+00, m = 1, nfg = 1 -[ Info: LBFGS: iter 3, time 79.91 s: f = -0.792705733264, ‖∇f‖ = 2.3327e-02, α = 1.00e+00, m = 2, nfg = 1 -[ Info: LBFGS: iter 4, time 82.31 s: f = -0.796289732161, ‖∇f‖ = 2.2475e-02, α = 1.00e+00, m = 3, nfg = 1 -[ Info: LBFGS: iter 5, time 84.94 s: f = -0.799674902231, ‖∇f‖ = 7.0288e-03, α = 1.00e+00, m = 4, nfg = 1 -[ Info: LBFGS: iter 6, time 87.13 s: f = -0.800082100115, ‖∇f‖ = 1.2717e-03, α = 1.00e+00, m = 5, nfg = 1 -[ Info: LBFGS: iter 7, time 89.94 s: f = -0.800110603120, ‖∇f‖ = 1.3384e-03, α = 1.00e+00, m = 6, nfg = 1 -[ Info: LBFGS: iter 8, time 92.01 s: f = -0.800262202003, ‖∇f‖ = 2.4945e-03, α = 1.00e+00, m = 7, nfg = 1 -[ Info: LBFGS: iter 9, time 93.65 s: f = -0.800450505439, ‖∇f‖ = 2.9259e-03, α = 1.00e+00, m = 8, nfg = 1 -[ Info: LBFGS: iter 10, time 95.79 s: f = -0.800764917063, ‖∇f‖ = 1.7221e-03, α = 1.00e+00, m = 9, nfg = 1 -[ Info: LBFGS: iter 11, time 98.09 s: f = -0.800876048822, ‖∇f‖ = 2.2475e-03, α = 1.00e+00, m = 10, nfg = 1 -[ Info: LBFGS: iter 12, time 99.35 s: f = -0.801100867388, ‖∇f‖ = 1.5561e-03, α = 1.00e+00, m = 11, nfg = 1 -[ Info: LBFGS: iter 13, time 100.88 s: f = -0.801317048785, ‖∇f‖ = 1.1561e-03, α = 1.00e+00, m = 12, nfg = 1 -[ Info: LBFGS: iter 14, time 102.48 s: f = -0.801373050522, ‖∇f‖ = 7.1300e-04, α = 1.00e+00, m = 13, nfg = 1 -[ Info: LBFGS: iter 15, time 103.88 s: f = -0.801388615258, ‖∇f‖ = 2.8462e-04, α = 1.00e+00, m = 14, nfg = 1 -[ Info: LBFGS: iter 16, time 105.37 s: f = -0.801394633326, ‖∇f‖ = 2.7607e-04, α = 1.00e+00, m = 15, nfg = 1 -[ Info: LBFGS: iter 17, time 107.89 s: f = -0.801408061547, ‖∇f‖ = 3.6096e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 18, time 109.37 s: f = -0.801509542237, ‖∇f‖ = 1.9822e-03, α = 1.00e+00, m = 17, nfg = 1 -[ Info: LBFGS: iter 19, time 111.39 s: f = -0.801578405298, ‖∇f‖ = 1.8040e-03, α = 1.00e+00, m = 18, nfg = 1 -[ Info: LBFGS: iter 20, time 117.86 s: f = -0.801694524832, ‖∇f‖ = 2.9356e-03, α = 5.48e-01, m = 19, nfg = 3 -[ Info: LBFGS: iter 21, time 123.02 s: f = -0.801761920585, ‖∇f‖ = 1.1993e-03, α = 3.82e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 22, time 124.85 s: f = -0.801797785496, ‖∇f‖ = 6.0337e-04, α = 1.00e+00, m = 21, nfg = 1 -[ Info: LBFGS: iter 23, time 129.85 s: f = -0.801808747834, ‖∇f‖ = 3.7053e-04, α = 5.24e-01, m = 22, nfg = 2 -[ Info: LBFGS: iter 24, time 131.58 s: f = -0.801812729196, ‖∇f‖ = 3.0781e-04, α = 1.00e+00, m = 23, nfg = 1 -[ Info: LBFGS: iter 25, time 133.29 s: f = -0.801816445181, ‖∇f‖ = 2.9994e-04, α = 1.00e+00, m = 24, nfg = 1 -[ Info: LBFGS: iter 26, time 136.36 s: f = -0.801824712580, ‖∇f‖ = 3.6497e-04, α = 1.00e+00, m = 25, nfg = 1 -[ Info: LBFGS: iter 27, time 139.94 s: f = -0.801839673918, ‖∇f‖ = 5.4217e-04, α = 1.00e+00, m = 26, nfg = 1 -[ Info: LBFGS: iter 28, time 143.71 s: f = -0.801857480042, ‖∇f‖ = 2.7918e-04, α = 1.00e+00, m = 27, nfg = 1 -[ Info: LBFGS: iter 29, time 149.41 s: f = -0.801864556175, ‖∇f‖ = 1.2323e-04, α = 1.00e+00, m = 28, nfg = 1 -[ Info: LBFGS: iter 30, time 154.13 s: f = -0.801865599394, ‖∇f‖ = 8.6049e-05, α = 1.00e+00, m = 29, nfg = 1 -[ Info: LBFGS: iter 31, time 157.32 s: f = -0.801867571015, ‖∇f‖ = 8.8673e-05, α = 1.00e+00, m = 30, nfg = 1 -[ Info: LBFGS: iter 32, time 163.14 s: f = -0.801870391456, ‖∇f‖ = 2.6510e-04, α = 1.00e+00, m = 31, nfg = 1 -[ Info: LBFGS: iter 33, time 165.78 s: f = -0.801874799763, ‖∇f‖ = 2.7836e-04, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 34, time 167.98 s: f = -0.801877566434, ‖∇f‖ = 1.8512e-04, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 35, time 170.53 s: f = -0.801878506140, ‖∇f‖ = 2.0603e-04, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 36, time 172.48 s: f = -0.801878994665, ‖∇f‖ = 5.6086e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 37, time 174.33 s: f = -0.801879153394, ‖∇f‖ = 6.2420e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 38, time 176.63 s: f = -0.801879354902, ‖∇f‖ = 6.0532e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 39, time 179.06 s: f = -0.801880114487, ‖∇f‖ = 6.2680e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 40, time 181.77 s: f = -0.801881471358, ‖∇f‖ = 6.2392e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 41, time 184.73 s: f = -0.801882270540, ‖∇f‖ = 9.4942e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 42, time 187.02 s: f = -0.801882598674, ‖∇f‖ = 5.1910e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 43, time 189.45 s: f = -0.801882711254, ‖∇f‖ = 2.6275e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 44, time 191.07 s: f = -0.801882805203, ‖∇f‖ = 2.9425e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 45, time 192.75 s: f = -0.801883026107, ‖∇f‖ = 2.7910e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 46, time 194.86 s: f = -0.801883400172, ‖∇f‖ = 3.7426e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 47, time 197.16 s: f = -0.801883717581, ‖∇f‖ = 5.4717e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 48, time 199.08 s: f = -0.801883966703, ‖∇f‖ = 2.9045e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 49, time 201.86 s: f = -0.801884163647, ‖∇f‖ = 3.0661e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 50, time 205.72 s: f = -0.801884391105, ‖∇f‖ = 4.1905e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 51, time 209.31 s: f = -0.801884815983, ‖∇f‖ = 6.9018e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 52, time 212.00 s: f = -0.801885013426, ‖∇f‖ = 3.8025e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 53, time 215.29 s: f = -0.801885126302, ‖∇f‖ = 1.9306e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 54, time 219.02 s: f = -0.801885184513, ‖∇f‖ = 3.3083e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 55, time 221.19 s: f = -0.801885308658, ‖∇f‖ = 4.9014e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 56, time 223.60 s: f = -0.801885502272, ‖∇f‖ = 1.1303e-04, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 57, time 226.58 s: f = -0.801885922461, ‖∇f‖ = 7.5880e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 58, time 230.06 s: f = -0.801886457901, ‖∇f‖ = 7.2957e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 59, time 232.86 s: f = -0.801886614664, ‖∇f‖ = 6.8816e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 60, time 239.07 s: f = -0.801886696733, ‖∇f‖ = 3.0687e-05, α = 4.26e-01, m = 32, nfg = 2 -[ Info: LBFGS: iter 61, time 243.89 s: f = -0.801886716271, ‖∇f‖ = 2.1581e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 62, time 247.56 s: f = -0.801886732686, ‖∇f‖ = 1.7659e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 63, time 251.23 s: f = -0.801886790357, ‖∇f‖ = 4.1045e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 64, time 255.93 s: f = -0.801886827021, ‖∇f‖ = 4.0831e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 65, time 259.48 s: f = -0.801886871471, ‖∇f‖ = 4.1034e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 66, time 261.08 s: f = -0.801886949561, ‖∇f‖ = 5.1171e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 67, time 262.97 s: f = -0.801887066611, ‖∇f‖ = 4.5902e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 68, time 265.75 s: f = -0.801887172302, ‖∇f‖ = 7.4809e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 69, time 269.35 s: f = -0.801887249758, ‖∇f‖ = 3.9621e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 70, time 271.31 s: f = -0.801887292123, ‖∇f‖ = 1.3999e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 71, time 273.21 s: f = -0.801887312573, ‖∇f‖ = 1.0813e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 72, time 275.65 s: f = -0.801887349746, ‖∇f‖ = 1.1335e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 73, time 278.92 s: f = -0.801887427063, ‖∇f‖ = 1.9028e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 74, time 281.71 s: f = -0.801887495619, ‖∇f‖ = 1.9287e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: iter 75, time 286.27 s: f = -0.801887521348, ‖∇f‖ = 2.5285e-05, α = 5.43e-01, m = 32, nfg = 2 -[ Info: LBFGS: iter 76, time 289.89 s: f = -0.801887560128, ‖∇f‖ = 2.7097e-05, α = 1.00e+00, m = 32, nfg = 1 -[ Info: LBFGS: converged after 77 iterations and time 292.11 s: f = -0.801887571683, ‖∇f‖ = 7.8821e-06 +┌ Warning: CTMRG cancel 150: obj = +1.702942228759e+01 +1.443123606306e-07im err = 2.4386740905e-05 time = 2.49 sec +└ @ PEPSKit ~/PEPSKit.jl/src/algorithms/ctmrg/ctmrg.jl:152 +[ Info: LBFGS: iter 1, time 154.68 s: f = -0.777080930369, ‖∇f‖ = 3.1305e-02, α = 7.10e+02, m = 0, nfg = 7 +[ Info: LBFGS: iter 2, time 156.09 s: f = -0.784111515961, ‖∇f‖ = 2.0103e-02, α = 1.00e+00, m = 1, nfg = 1 +[ Info: LBFGS: iter 3, time 156.40 s: f = -0.792705733484, ‖∇f‖ = 2.3327e-02, α = 1.00e+00, m = 2, nfg = 1 +[ Info: LBFGS: iter 4, time 156.65 s: f = -0.796289732476, ‖∇f‖ = 2.2475e-02, α = 1.00e+00, m = 3, nfg = 1 +[ Info: LBFGS: iter 5, time 156.86 s: f = -0.799674902374, ‖∇f‖ = 7.0288e-03, α = 1.00e+00, m = 4, nfg = 1 +[ Info: LBFGS: iter 6, time 157.05 s: f = -0.800082100121, ‖∇f‖ = 1.2717e-03, α = 1.00e+00, m = 5, nfg = 1 +[ Info: LBFGS: iter 7, time 157.27 s: f = -0.800110603125, ‖∇f‖ = 1.3384e-03, α = 1.00e+00, m = 6, nfg = 1 +[ Info: LBFGS: iter 8, time 157.45 s: f = -0.800262201996, ‖∇f‖ = 2.4945e-03, α = 1.00e+00, m = 7, nfg = 1 +[ Info: LBFGS: iter 9, time 157.64 s: f = -0.800450505448, ‖∇f‖ = 2.9259e-03, α = 1.00e+00, m = 8, nfg = 1 +[ Info: LBFGS: iter 10, time 157.85 s: f = -0.800764917087, ‖∇f‖ = 1.7221e-03, α = 1.00e+00, m = 9, nfg = 1 +[ Info: LBFGS: iter 11, time 158.07 s: f = -0.800876048838, ‖∇f‖ = 2.2475e-03, α = 1.00e+00, m = 10, nfg = 1 +[ Info: LBFGS: iter 12, time 158.26 s: f = -0.801100867467, ‖∇f‖ = 1.5561e-03, α = 1.00e+00, m = 11, nfg = 1 +[ Info: LBFGS: iter 13, time 158.48 s: f = -0.801317048856, ‖∇f‖ = 1.1561e-03, α = 1.00e+00, m = 12, nfg = 1 +[ Info: LBFGS: iter 14, time 158.69 s: f = -0.801373050545, ‖∇f‖ = 7.1300e-04, α = 1.00e+00, m = 13, nfg = 1 +[ Info: LBFGS: iter 15, time 158.89 s: f = -0.801388615264, ‖∇f‖ = 2.8462e-04, α = 1.00e+00, m = 14, nfg = 1 +[ Info: LBFGS: iter 16, time 159.10 s: f = -0.801394633333, ‖∇f‖ = 2.7607e-04, α = 1.00e+00, m = 15, nfg = 1 +[ Info: LBFGS: iter 17, time 159.28 s: f = -0.801408061564, ‖∇f‖ = 3.6096e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 18, time 159.53 s: f = -0.801509542169, ‖∇f‖ = 1.9822e-03, α = 1.00e+00, m = 17, nfg = 1 +[ Info: LBFGS: iter 19, time 159.77 s: f = -0.801578405251, ‖∇f‖ = 1.8040e-03, α = 1.00e+00, m = 18, nfg = 1 +[ Info: LBFGS: iter 20, time 160.69 s: f = -0.801694524424, ‖∇f‖ = 2.9356e-03, α = 5.48e-01, m = 19, nfg = 3 +[ Info: LBFGS: iter 21, time 161.31 s: f = -0.801761920683, ‖∇f‖ = 1.1993e-03, α = 3.82e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 22, time 161.60 s: f = -0.801797785494, ‖∇f‖ = 6.0337e-04, α = 1.00e+00, m = 21, nfg = 1 +[ Info: LBFGS: iter 23, time 162.21 s: f = -0.801808747834, ‖∇f‖ = 3.7053e-04, α = 5.24e-01, m = 22, nfg = 2 +[ Info: LBFGS: iter 24, time 162.50 s: f = -0.801812729173, ‖∇f‖ = 3.0781e-04, α = 1.00e+00, m = 23, nfg = 1 +[ Info: LBFGS: iter 25, time 162.80 s: f = -0.801816445211, ‖∇f‖ = 2.9994e-04, α = 1.00e+00, m = 24, nfg = 1 +[ Info: LBFGS: iter 26, time 163.09 s: f = -0.801824713130, ‖∇f‖ = 3.6496e-04, α = 1.00e+00, m = 25, nfg = 1 +[ Info: LBFGS: iter 27, time 163.41 s: f = -0.801839673823, ‖∇f‖ = 5.4222e-04, α = 1.00e+00, m = 26, nfg = 1 +[ Info: LBFGS: iter 28, time 163.74 s: f = -0.801857478904, ‖∇f‖ = 2.7917e-04, α = 1.00e+00, m = 27, nfg = 1 +[ Info: LBFGS: iter 29, time 164.06 s: f = -0.801864555224, ‖∇f‖ = 1.2319e-04, α = 1.00e+00, m = 28, nfg = 1 +[ Info: LBFGS: iter 30, time 164.37 s: f = -0.801865598736, ‖∇f‖ = 8.6048e-05, α = 1.00e+00, m = 29, nfg = 1 +[ Info: LBFGS: iter 31, time 164.68 s: f = -0.801867571755, ‖∇f‖ = 8.8636e-05, α = 1.00e+00, m = 30, nfg = 1 +[ Info: LBFGS: iter 32, time 165.00 s: f = -0.801870393528, ‖∇f‖ = 2.6554e-04, α = 1.00e+00, m = 31, nfg = 1 +[ Info: LBFGS: iter 33, time 165.35 s: f = -0.801874797039, ‖∇f‖ = 2.7841e-04, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 34, time 165.70 s: f = -0.801877566644, ‖∇f‖ = 1.8523e-04, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 35, time 166.02 s: f = -0.801878506245, ‖∇f‖ = 2.0638e-04, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 36, time 166.33 s: f = -0.801878995097, ‖∇f‖ = 5.6081e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 37, time 166.64 s: f = -0.801879153573, ‖∇f‖ = 6.2356e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 38, time 166.94 s: f = -0.801879355075, ‖∇f‖ = 6.0528e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 39, time 167.25 s: f = -0.801880115100, ‖∇f‖ = 6.2768e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 40, time 167.60 s: f = -0.801881475065, ‖∇f‖ = 6.2301e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 41, time 167.96 s: f = -0.801882272425, ‖∇f‖ = 9.5267e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 42, time 168.29 s: f = -0.801882600033, ‖∇f‖ = 5.1283e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 43, time 168.61 s: f = -0.801882711875, ‖∇f‖ = 2.6091e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 44, time 168.92 s: f = -0.801882805828, ‖∇f‖ = 2.9316e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 45, time 169.21 s: f = -0.801883027060, ‖∇f‖ = 2.7982e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 46, time 169.52 s: f = -0.801883402178, ‖∇f‖ = 3.8102e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 47, time 169.85 s: f = -0.801883718321, ‖∇f‖ = 5.3658e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 48, time 170.17 s: f = -0.801883962887, ‖∇f‖ = 2.8728e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 49, time 170.51 s: f = -0.801884158085, ‖∇f‖ = 3.0680e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 50, time 170.84 s: f = -0.801884385940, ‖∇f‖ = 4.1973e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 51, time 171.20 s: f = -0.801884810459, ‖∇f‖ = 6.8881e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 52, time 171.54 s: f = -0.801885011014, ‖∇f‖ = 3.8651e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 53, time 171.87 s: f = -0.801885126625, ‖∇f‖ = 1.9013e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 54, time 172.21 s: f = -0.801885186489, ‖∇f‖ = 3.2919e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 55, time 172.56 s: f = -0.801885309713, ‖∇f‖ = 4.8521e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 56, time 172.91 s: f = -0.801885491631, ‖∇f‖ = 1.1478e-04, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 57, time 173.29 s: f = -0.801885912857, ‖∇f‖ = 7.7221e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 58, time 173.66 s: f = -0.801886451980, ‖∇f‖ = 6.5316e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 59, time 174.01 s: f = -0.801886639803, ‖∇f‖ = 5.1567e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 60, time 174.69 s: f = -0.801886699372, ‖∇f‖ = 4.5540e-05, α = 3.68e-01, m = 32, nfg = 2 +[ Info: LBFGS: iter 61, time 174.99 s: f = -0.801886723992, ‖∇f‖ = 2.1992e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 62, time 175.28 s: f = -0.801886735202, ‖∇f‖ = 1.8064e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 63, time 175.61 s: f = -0.801886771395, ‖∇f‖ = 3.8651e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 64, time 175.93 s: f = -0.801886801952, ‖∇f‖ = 4.2630e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 65, time 176.24 s: f = -0.801886837856, ‖∇f‖ = 3.9318e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 66, time 176.55 s: f = -0.801886916783, ‖∇f‖ = 3.8747e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 67, time 176.88 s: f = -0.801887030054, ‖∇f‖ = 3.7140e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 68, time 177.23 s: f = -0.801887141197, ‖∇f‖ = 5.7017e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 69, time 177.94 s: f = -0.801887199203, ‖∇f‖ = 3.0700e-05, α = 5.24e-01, m = 32, nfg = 2 +[ Info: LBFGS: iter 70, time 178.28 s: f = -0.801887246612, ‖∇f‖ = 1.3885e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 71, time 178.61 s: f = -0.801887263715, ‖∇f‖ = 1.5769e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 72, time 178.95 s: f = -0.801887319463, ‖∇f‖ = 2.1423e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 73, time 179.30 s: f = -0.801887406143, ‖∇f‖ = 1.9895e-05, α = 1.00e+00, m = 32, nfg = 1 +[ Info: LBFGS: iter 74, time 180.00 s: f = -0.801887467460, ‖∇f‖ = 1.9799e-05, α = 3.61e-01, m = 32, nfg = 2 +[ Info: LBFGS: converged after 75 iterations and time 180.33 s: f = -0.801887535670, ‖∇f‖ = 9.9342e-06 ```` @@ -386,7 +384,7 @@ the final value of the cost function we have just optimized. ```` ```` --0.8018875716825512 +-0.8018875356702571 ```` As another check, we can compute the magnetization per site and compare it to a [reference @@ -404,7 +402,7 @@ m_ref = 0.667162 ```` ```` -0.00011017887044251218 +0.00011315585491944447 ```` --- diff --git a/docs/src/examples/3d_ising_partition_function/main.ipynb b/docs/src/examples/3d_ising_partition_function/main.ipynb index 5f171655f..8b9f410b8 100644 --- a/docs/src/examples/3d_ising_partition_function/main.ipynb +++ b/docs/src/examples/3d_ising_partition_function/main.ipynb @@ -72,7 +72,7 @@ "outputs": [], "cell_type": "code", "source": [ - "function three_dimensional_classical_ising(; beta, J=1.0)\n", + "function three_dimensional_classical_ising(; beta, J = 1.0)\n", " K = beta * J\n", "\n", " # Boltzmann weights\n", @@ -197,9 +197,9 @@ "outputs": [], "cell_type": "code", "source": [ - "boundary_alg = SimultaneousCTMRG(; maxiter=150, tol=1e-8, verbosity=1)\n", + "boundary_alg = SimultaneousCTMRG(; maxiter = 150, tol = 1.0e-8, verbosity = 1)\n", "rrule_alg = EigSolver(;\n", - " solver_alg=KrylovKit.Arnoldi(; maxiter=30, tol=1e-6, eager=true), iterscheme=:diffgauge\n", + " solver_alg = KrylovKit.Arnoldi(; maxiter = 30, tol = 1.0e-6, eager = true), iterscheme = :diffgauge\n", ")\n", "T = InfinitePEPO(O)\n", "\n", @@ -214,7 +214,7 @@ " env_double_layer,\n", " n_double_layer,\n", " boundary_alg;\n", - " alg_rrule=rrule_alg,\n", + " alg_rrule = rrule_alg,\n", " )\n", " # construct the PEPS-PEPO-PEPS overlap network\n", " n_triple_layer = InfiniteSquareNetwork(ψ, T)\n", @@ -224,7 +224,7 @@ " env_triple_layer,\n", " n_triple_layer,\n", " boundary_alg;\n", - " alg_rrule=rrule_alg,\n", + " alg_rrule = rrule_alg,\n", " )\n", " # update the environments for reuse\n", " PEPSKit.ignore_derivatives() do\n", @@ -299,12 +299,12 @@ " return (peps´, env_double_layer´, env_triple_layer´), ξ\n", "end\n", "function pepo_transport!(\n", - " ξ,\n", - " (peps, env_double_layer, env_triple_layer),\n", - " η,\n", - " α,\n", - " (peps´, env_double_layer´, env_triple_layer´),\n", - ")\n", + " ξ,\n", + " (peps, env_double_layer, env_triple_layer),\n", + " η,\n", + " α,\n", + " (peps´, env_double_layer´, env_triple_layer´),\n", + " )\n", " return PEPSKit.peps_transport!(\n", " ξ, (peps, env_double_layer), η, α, (peps´, env_double_layer´)\n", " )\n", @@ -335,15 +335,15 @@ "env2_0 = CTMRGEnv(InfiniteSquareNetwork(psi0), Venv)\n", "env3_0 = CTMRGEnv(InfiniteSquareNetwork(psi0, T), Venv)\n", "\n", - "optimizer_alg = LBFGS(32; maxiter=100, gradtol=1e-5, verbosity=3)\n", + "optimizer_alg = LBFGS(32; maxiter = 100, gradtol = 1.0e-5, verbosity = 3)\n", "\n", "(psi_final, env2_final, env3_final), f, = optimize(\n", " pepo_costfun,\n", " (psi0, env2_0, env3_0),\n", " optimizer_alg;\n", - " inner=PEPSKit.real_inner,\n", - " retract=pepo_retract,\n", - " (transport!)=(pepo_transport!),\n", + " inner = PEPSKit.real_inner,\n", + " retract = pepo_retract,\n", + " (transport!) = (pepo_transport!),\n", ");" ], "metadata": {}, @@ -409,11 +409,11 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.10.4" + "version": "1.11.5" }, "kernelspec": { - "name": "julia-1.10", - "display_name": "Julia 1.10.4", + "name": "julia-1.11", + "display_name": "Julia 1.11.5", "language": "julia" } }, diff --git a/docs/src/examples/bose_hubbard/index.md b/docs/src/examples/bose_hubbard/index.md index 4fbd9afdf..2324d3dea 100644 --- a/docs/src/examples/bose_hubbard/index.md +++ b/docs/src/examples/bose_hubbard/index.md @@ -99,9 +99,9 @@ optimization framework in the usual way to find the ground state. So, we first s algorithms and their tolerances: ````julia -boundary_alg = (; tol=1e-8, alg=:simultaneous, trscheme=(; alg=:fixedspace)) -gradient_alg = (; tol=1e-6, maxiter=10, alg=:eigsolver, iterscheme=:diffgauge) -optimizer_alg = (; tol=1e-4, alg=:lbfgs, maxiter=150, ls_maxiter=2, ls_maxfg=2); +boundary_alg = (; tol = 1.0e-8, alg = :simultaneous, trscheme = (; alg = :fixedspace)) +gradient_alg = (; tol = 1.0e-6, maxiter = 10, alg = :eigsolver, iterscheme = :diffgauge) +optimizer_alg = (; tol = 1.0e-4, alg = :lbfgs, maxiter = 150, ls_maxiter = 2, ls_maxfg = 2); ```` !!! note @@ -128,7 +128,7 @@ env₀, = leading_boundary(CTMRGEnv(peps₀, V_env), peps₀; boundary_alg...); ```` [ Info: CTMRG init: obj = +1.693461429863e+00 +8.390974048721e-02im err = 1.0000e+00 -[ Info: CTMRG conv 19: obj = +1.181834754305e+01 -1.514065517581e-11im err = 3.6943032303e-09 time = 10.11 sec +[ Info: CTMRG conv 19: obj = +1.181834754305e+01 -1.514596781954e-11im err = 3.6943031807e-09 time = 8.97 sec ```` @@ -136,165 +136,165 @@ And at last, we optimize (which might take a bit): ````julia peps, env, E, info = fixedpoint( - H, peps₀, env₀; boundary_alg, gradient_alg, optimizer_alg, verbosity=3 + H, peps₀, env₀; boundary_alg, gradient_alg, optimizer_alg, verbosity = 3 ) @show E; ```` ```` [ Info: LBFGS: initializing with f = 9.360531870693, ‖∇f‖ = 1.6954e+01 -[ Info: LBFGS: iter 1, time 701.65 s: f = 0.114269686001, ‖∇f‖ = 6.0686e+00, α = 1.56e+02, m = 0, nfg = 7 -[ Info: LBFGS: iter 2, time 728.49 s: f = 0.059480938109, ‖∇f‖ = 7.2206e+00, α = 5.27e-01, m = 1, nfg = 2 -[ Info: LBFGS: iter 3, time 731.02 s: f = -0.046499452154, ‖∇f‖ = 1.6329e+00, α = 1.00e+00, m = 2, nfg = 1 -[ Info: LBFGS: iter 4, time 733.33 s: f = -0.079703746761, ‖∇f‖ = 1.4901e+00, α = 1.00e+00, m = 3, nfg = 1 -[ Info: LBFGS: iter 5, time 741.06 s: f = -0.125317852116, ‖∇f‖ = 3.2630e+00, α = 5.23e-01, m = 4, nfg = 3 -[ Info: LBFGS: iter 6, time 743.44 s: f = -0.163554919136, ‖∇f‖ = 1.2781e+00, α = 1.00e+00, m = 5, nfg = 1 -[ Info: LBFGS: iter 7, time 745.87 s: f = -0.193532735205, ‖∇f‖ = 9.6932e-01, α = 1.00e+00, m = 6, nfg = 1 -[ Info: LBFGS: iter 8, time 750.42 s: f = -0.208656321305, ‖∇f‖ = 7.0028e-01, α = 1.68e-01, m = 7, nfg = 2 -[ Info: LBFGS: iter 9, time 754.81 s: f = -0.220718433131, ‖∇f‖ = 4.3381e-01, α = 3.95e-01, m = 8, nfg = 2 -[ Info: LBFGS: iter 10, time 756.97 s: f = -0.227817345451, ‖∇f‖ = 5.8993e-01, α = 1.00e+00, m = 9, nfg = 1 -[ Info: LBFGS: iter 11, time 758.22 s: f = -0.235906486614, ‖∇f‖ = 5.2265e-01, α = 1.00e+00, m = 10, nfg = 1 -[ Info: LBFGS: iter 12, time 759.22 s: f = -0.245544719146, ‖∇f‖ = 3.6462e-01, α = 1.00e+00, m = 11, nfg = 1 -[ Info: LBFGS: iter 13, time 760.15 s: f = -0.251717239104, ‖∇f‖ = 3.3074e-01, α = 1.00e+00, m = 12, nfg = 1 -[ Info: LBFGS: iter 14, time 761.46 s: f = -0.256869388517, ‖∇f‖ = 2.9129e-01, α = 1.00e+00, m = 13, nfg = 1 -[ Info: LBFGS: iter 15, time 762.25 s: f = -0.265345632618, ‖∇f‖ = 2.3580e-01, α = 1.00e+00, m = 14, nfg = 1 -[ Info: LBFGS: iter 16, time 762.92 s: f = -0.267397827065, ‖∇f‖ = 3.0098e-01, α = 1.00e+00, m = 15, nfg = 1 -[ Info: LBFGS: iter 17, time 763.80 s: f = -0.268894232393, ‖∇f‖ = 1.1725e-01, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 18, time 764.47 s: f = -0.269501536204, ‖∇f‖ = 8.8162e-02, α = 1.00e+00, m = 17, nfg = 1 -[ Info: LBFGS: iter 19, time 765.20 s: f = -0.270154405723, ‖∇f‖ = 7.1880e-02, α = 1.00e+00, m = 18, nfg = 1 -[ Info: LBFGS: iter 20, time 766.33 s: f = -0.270612692535, ‖∇f‖ = 6.5906e-02, α = 1.00e+00, m = 19, nfg = 1 -[ Info: LBFGS: iter 21, time 767.10 s: f = -0.270978612739, ‖∇f‖ = 6.8050e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 22, time 767.78 s: f = -0.271251104415, ‖∇f‖ = 4.7832e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 23, time 768.66 s: f = -0.271592065726, ‖∇f‖ = 5.2245e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 24, time 769.33 s: f = -0.271907473229, ‖∇f‖ = 4.7783e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 25, time 769.98 s: f = -0.272188790523, ‖∇f‖ = 6.1727e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 26, time 770.91 s: f = -0.272341714943, ‖∇f‖ = 2.8588e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 27, time 771.62 s: f = -0.272416985007, ‖∇f‖ = 2.4404e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 28, time 772.51 s: f = -0.272488140129, ‖∇f‖ = 2.8167e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 29, time 773.65 s: f = -0.272607173824, ‖∇f‖ = 4.0551e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 30, time 774.38 s: f = -0.272669542134, ‖∇f‖ = 2.8338e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 31, time 775.06 s: f = -0.272710735517, ‖∇f‖ = 1.3171e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 32, time 776.00 s: f = -0.272737399252, ‖∇f‖ = 1.5064e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 33, time 776.65 s: f = -0.272785529240, ‖∇f‖ = 2.2115e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 34, time 777.35 s: f = -0.272869320169, ‖∇f‖ = 2.7454e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 35, time 778.48 s: f = -0.272917746483, ‖∇f‖ = 4.3200e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 36, time 779.25 s: f = -0.272982782962, ‖∇f‖ = 1.3998e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 37, time 779.88 s: f = -0.273001975620, ‖∇f‖ = 9.8876e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 38, time 780.76 s: f = -0.273014701177, ‖∇f‖ = 1.2336e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 39, time 781.44 s: f = -0.273032513150, ‖∇f‖ = 1.6628e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 40, time 782.05 s: f = -0.273047957581, ‖∇f‖ = 1.1548e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 41, time 782.92 s: f = -0.273056319318, ‖∇f‖ = 6.3307e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 42, time 783.58 s: f = -0.273062571625, ‖∇f‖ = 6.8219e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 43, time 784.32 s: f = -0.273067065009, ‖∇f‖ = 8.8510e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 44, time 785.40 s: f = -0.273077210298, ‖∇f‖ = 9.9163e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 45, time 786.71 s: f = -0.273086893657, ‖∇f‖ = 1.8575e-02, α = 5.12e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 46, time 787.59 s: f = -0.273103078820, ‖∇f‖ = 8.5718e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 47, time 788.24 s: f = -0.273110799146, ‖∇f‖ = 5.8581e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 48, time 788.86 s: f = -0.273120104690, ‖∇f‖ = 8.0410e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 49, time 789.90 s: f = -0.273131281119, ‖∇f‖ = 1.1878e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 50, time 790.67 s: f = -0.273143808372, ‖∇f‖ = 9.4250e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 51, time 791.37 s: f = -0.273153887746, ‖∇f‖ = 7.2150e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 52, time 792.24 s: f = -0.273158885697, ‖∇f‖ = 6.7195e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 53, time 792.89 s: f = -0.273161233672, ‖∇f‖ = 4.1608e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 54, time 793.51 s: f = -0.273163225685, ‖∇f‖ = 4.0591e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 55, time 794.38 s: f = -0.273166294476, ‖∇f‖ = 4.9791e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 56, time 795.00 s: f = -0.273169366216, ‖∇f‖ = 4.4714e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 57, time 795.65 s: f = -0.273172354203, ‖∇f‖ = 6.3685e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 58, time 796.67 s: f = -0.273175363804, ‖∇f‖ = 3.9908e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 59, time 797.42 s: f = -0.273177279555, ‖∇f‖ = 3.9256e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 60, time 798.14 s: f = -0.273182789739, ‖∇f‖ = 6.6561e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 61, time 799.68 s: f = -0.273184790994, ‖∇f‖ = 5.6288e-03, α = 5.40e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 62, time 800.38 s: f = -0.273186538837, ‖∇f‖ = 2.7232e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 63, time 801.29 s: f = -0.273187761546, ‖∇f‖ = 2.8879e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 64, time 802.02 s: f = -0.273189383925, ‖∇f‖ = 3.5846e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 65, time 802.81 s: f = -0.273193896451, ‖∇f‖ = 8.4511e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 66, time 803.91 s: f = -0.273197826539, ‖∇f‖ = 6.5550e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 67, time 804.62 s: f = -0.273200889061, ‖∇f‖ = 3.7358e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 68, time 805.29 s: f = -0.273203155178, ‖∇f‖ = 3.5407e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 69, time 806.21 s: f = -0.273203929980, ‖∇f‖ = 3.6210e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 70, time 806.87 s: f = -0.273204838261, ‖∇f‖ = 3.2225e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 71, time 807.58 s: f = -0.273208065775, ‖∇f‖ = 3.2082e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 72, time 809.27 s: f = -0.273208664645, ‖∇f‖ = 2.6363e-03, α = 3.31e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 73, time 809.86 s: f = -0.273209100891, ‖∇f‖ = 2.4085e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 74, time 810.72 s: f = -0.273212054238, ‖∇f‖ = 3.6766e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 75, time 811.36 s: f = -0.273214539258, ‖∇f‖ = 4.4246e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 76, time 812.95 s: f = -0.273216162063, ‖∇f‖ = 4.5554e-03, α = 4.50e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 77, time 813.63 s: f = -0.273217804060, ‖∇f‖ = 2.2786e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 78, time 814.23 s: f = -0.273218883332, ‖∇f‖ = 2.0806e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 79, time 815.09 s: f = -0.273220350202, ‖∇f‖ = 2.6261e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 80, time 815.76 s: f = -0.273220936627, ‖∇f‖ = 6.7759e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 81, time 816.37 s: f = -0.273223126358, ‖∇f‖ = 2.3172e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 82, time 817.34 s: f = -0.273223758693, ‖∇f‖ = 1.4729e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 83, time 818.06 s: f = -0.273224312355, ‖∇f‖ = 1.6490e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 84, time 818.66 s: f = -0.273224595270, ‖∇f‖ = 5.4563e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 85, time 819.52 s: f = -0.273225489234, ‖∇f‖ = 2.6430e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 86, time 820.21 s: f = -0.273226533430, ‖∇f‖ = 1.3412e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 87, time 820.82 s: f = -0.273227338612, ‖∇f‖ = 1.9615e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 88, time 821.71 s: f = -0.273228071289, ‖∇f‖ = 2.3685e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 89, time 822.46 s: f = -0.273228784006, ‖∇f‖ = 2.1043e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 90, time 823.10 s: f = -0.273229430175, ‖∇f‖ = 1.6761e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 91, time 823.97 s: f = -0.273230395114, ‖∇f‖ = 2.3630e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 92, time 824.61 s: f = -0.273230913013, ‖∇f‖ = 4.6973e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 93, time 825.22 s: f = -0.273231822369, ‖∇f‖ = 2.4314e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 94, time 826.15 s: f = -0.273233026044, ‖∇f‖ = 2.0545e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 95, time 826.88 s: f = -0.273234060512, ‖∇f‖ = 3.0017e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 96, time 827.53 s: f = -0.273235400747, ‖∇f‖ = 3.5897e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 97, time 828.40 s: f = -0.273236050489, ‖∇f‖ = 3.5955e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 98, time 829.05 s: f = -0.273236795492, ‖∇f‖ = 1.2968e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 99, time 829.66 s: f = -0.273237167136, ‖∇f‖ = 1.6986e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 100, time 830.53 s: f = -0.273237666635, ‖∇f‖ = 2.2956e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 101, time 832.10 s: f = -0.273237902441, ‖∇f‖ = 2.7825e-03, α = 4.67e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 102, time 832.99 s: f = -0.273238278596, ‖∇f‖ = 1.4666e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 103, time 833.63 s: f = -0.273238526414, ‖∇f‖ = 8.6123e-04, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 104, time 834.30 s: f = -0.273238754345, ‖∇f‖ = 1.6678e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 105, time 835.20 s: f = -0.273239114660, ‖∇f‖ = 2.6137e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 106, time 835.98 s: f = -0.273239823032, ‖∇f‖ = 3.4309e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 107, time 836.70 s: f = -0.273240368425, ‖∇f‖ = 4.2900e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 108, time 837.60 s: f = -0.273241164149, ‖∇f‖ = 1.7960e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 109, time 838.27 s: f = -0.273241477217, ‖∇f‖ = 1.0362e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 110, time 838.99 s: f = -0.273241714533, ‖∇f‖ = 1.6183e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 111, time 839.90 s: f = -0.273241995140, ‖∇f‖ = 2.2016e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 112, time 840.64 s: f = -0.273242534073, ‖∇f‖ = 2.3919e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 113, time 842.25 s: f = -0.273242711278, ‖∇f‖ = 2.5310e-03, α = 2.34e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 114, time 842.90 s: f = -0.273243067693, ‖∇f‖ = 1.2098e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 115, time 843.58 s: f = -0.273243262667, ‖∇f‖ = 8.8410e-04, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 116, time 844.49 s: f = -0.273243396694, ‖∇f‖ = 1.3054e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 117, time 845.17 s: f = -0.273243632472, ‖∇f‖ = 1.6606e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 118, time 845.92 s: f = -0.273243978972, ‖∇f‖ = 2.4494e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 119, time 846.80 s: f = -0.273244469815, ‖∇f‖ = 1.7476e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 120, time 847.44 s: f = -0.273244908487, ‖∇f‖ = 1.1114e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 121, time 848.15 s: f = -0.273245191811, ‖∇f‖ = 1.8355e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 122, time 849.04 s: f = -0.273245438183, ‖∇f‖ = 1.7466e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 123, time 849.78 s: f = -0.273245813350, ‖∇f‖ = 1.8849e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 124, time 850.49 s: f = -0.273246990667, ‖∇f‖ = 2.4067e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 125, time 852.08 s: f = -0.273247342251, ‖∇f‖ = 2.8162e-03, α = 4.42e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 126, time 852.72 s: f = -0.273247837859, ‖∇f‖ = 1.6699e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 127, time 853.62 s: f = -0.273248269606, ‖∇f‖ = 1.5051e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 128, time 854.38 s: f = -0.273248928543, ‖∇f‖ = 2.4379e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 129, time 855.08 s: f = -0.273249639369, ‖∇f‖ = 2.6766e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 130, time 855.99 s: f = -0.273250417480, ‖∇f‖ = 3.1154e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 131, time 856.68 s: f = -0.273250924677, ‖∇f‖ = 1.7813e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 132, time 857.35 s: f = -0.273251180562, ‖∇f‖ = 1.2277e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 133, time 858.27 s: f = -0.273251373009, ‖∇f‖ = 1.2344e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 134, time 859.00 s: f = -0.273251572043, ‖∇f‖ = 1.5999e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 135, time 859.67 s: f = -0.273251882821, ‖∇f‖ = 2.1224e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 136, time 860.53 s: f = -0.273252172658, ‖∇f‖ = 1.7119e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 137, time 861.16 s: f = -0.273252409193, ‖∇f‖ = 1.1616e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 138, time 861.80 s: f = -0.273252645647, ‖∇f‖ = 1.3121e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 139, time 862.69 s: f = -0.273252871996, ‖∇f‖ = 1.3829e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 140, time 863.40 s: f = -0.273253359134, ‖∇f‖ = 1.8830e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 141, time 864.06 s: f = -0.273253963261, ‖∇f‖ = 2.5909e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 142, time 864.94 s: f = -0.273254681754, ‖∇f‖ = 1.9402e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 143, time 865.57 s: f = -0.273255691367, ‖∇f‖ = 3.1128e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 144, time 866.18 s: f = -0.273256163902, ‖∇f‖ = 2.2255e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 145, time 867.02 s: f = -0.273256631020, ‖∇f‖ = 1.3304e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 146, time 867.73 s: f = -0.273257004955, ‖∇f‖ = 1.5051e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 147, time 868.41 s: f = -0.273257432452, ‖∇f‖ = 1.4023e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 148, time 869.94 s: f = -0.273257620772, ‖∇f‖ = 2.4790e-03, α = 1.96e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 149, time 870.56 s: f = -0.273257961671, ‖∇f‖ = 1.0700e-03, α = 1.00e+00, m = 20, nfg = 1 -┌ Warning: LBFGS: not converged to requested tol after 150 iterations and time 871.43 s: f = -0.273258098818, ‖∇f‖ = 7.5289e-04 +[ Info: LBFGS: iter 1, time 835.55 s: f = 0.114269686001, ‖∇f‖ = 6.0686e+00, α = 1.56e+02, m = 0, nfg = 7 +[ Info: LBFGS: iter 2, time 867.07 s: f = 0.059480938115, ‖∇f‖ = 7.2206e+00, α = 5.27e-01, m = 1, nfg = 2 +[ Info: LBFGS: iter 3, time 870.15 s: f = -0.046499452141, ‖∇f‖ = 1.6329e+00, α = 1.00e+00, m = 2, nfg = 1 +[ Info: LBFGS: iter 4, time 873.04 s: f = -0.079703746750, ‖∇f‖ = 1.4901e+00, α = 1.00e+00, m = 3, nfg = 1 +[ Info: LBFGS: iter 5, time 883.62 s: f = -0.125317852222, ‖∇f‖ = 3.2630e+00, α = 5.23e-01, m = 4, nfg = 3 +[ Info: LBFGS: iter 6, time 886.73 s: f = -0.163554919176, ‖∇f‖ = 1.2781e+00, α = 1.00e+00, m = 5, nfg = 1 +[ Info: LBFGS: iter 7, time 890.21 s: f = -0.193532735237, ‖∇f‖ = 9.6932e-01, α = 1.00e+00, m = 6, nfg = 1 +[ Info: LBFGS: iter 8, time 895.90 s: f = -0.208656321338, ‖∇f‖ = 7.0028e-01, α = 1.68e-01, m = 7, nfg = 2 +[ Info: LBFGS: iter 9, time 901.97 s: f = -0.220718433148, ‖∇f‖ = 4.3381e-01, α = 3.95e-01, m = 8, nfg = 2 +[ Info: LBFGS: iter 10, time 904.78 s: f = -0.227817345456, ‖∇f‖ = 5.8993e-01, α = 1.00e+00, m = 9, nfg = 1 +[ Info: LBFGS: iter 11, time 906.29 s: f = -0.235906486649, ‖∇f‖ = 5.2265e-01, α = 1.00e+00, m = 10, nfg = 1 +[ Info: LBFGS: iter 12, time 907.72 s: f = -0.245544719160, ‖∇f‖ = 3.6462e-01, α = 1.00e+00, m = 11, nfg = 1 +[ Info: LBFGS: iter 13, time 909.56 s: f = -0.251717239130, ‖∇f‖ = 3.3074e-01, α = 1.00e+00, m = 12, nfg = 1 +[ Info: LBFGS: iter 14, time 910.74 s: f = -0.256869388562, ‖∇f‖ = 2.9129e-01, α = 1.00e+00, m = 13, nfg = 1 +[ Info: LBFGS: iter 15, time 911.84 s: f = -0.265345632631, ‖∇f‖ = 2.3580e-01, α = 1.00e+00, m = 14, nfg = 1 +[ Info: LBFGS: iter 16, time 912.79 s: f = -0.267397827108, ‖∇f‖ = 3.0098e-01, α = 1.00e+00, m = 15, nfg = 1 +[ Info: LBFGS: iter 17, time 914.23 s: f = -0.268894232390, ‖∇f‖ = 1.1725e-01, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 18, time 915.16 s: f = -0.269501536205, ‖∇f‖ = 8.8162e-02, α = 1.00e+00, m = 17, nfg = 1 +[ Info: LBFGS: iter 19, time 916.08 s: f = -0.270154405721, ‖∇f‖ = 7.1880e-02, α = 1.00e+00, m = 18, nfg = 1 +[ Info: LBFGS: iter 20, time 917.04 s: f = -0.270612692532, ‖∇f‖ = 6.5906e-02, α = 1.00e+00, m = 19, nfg = 1 +[ Info: LBFGS: iter 21, time 918.52 s: f = -0.270978612734, ‖∇f‖ = 6.8050e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 22, time 919.42 s: f = -0.271251104411, ‖∇f‖ = 4.7832e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 23, time 920.32 s: f = -0.271592065725, ‖∇f‖ = 5.2245e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 24, time 921.24 s: f = -0.271907473230, ‖∇f‖ = 4.7783e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 25, time 922.68 s: f = -0.272188790518, ‖∇f‖ = 6.1727e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 26, time 923.58 s: f = -0.272341714938, ‖∇f‖ = 2.8588e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 27, time 924.50 s: f = -0.272416985001, ‖∇f‖ = 2.4404e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 28, time 925.41 s: f = -0.272488140123, ‖∇f‖ = 2.8167e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 29, time 926.85 s: f = -0.272607173823, ‖∇f‖ = 4.0551e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 30, time 927.74 s: f = -0.272669542118, ‖∇f‖ = 2.8338e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 31, time 928.65 s: f = -0.272710735515, ‖∇f‖ = 1.3171e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 32, time 929.56 s: f = -0.272737399244, ‖∇f‖ = 1.5064e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 33, time 931.01 s: f = -0.272785529235, ‖∇f‖ = 2.2115e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 34, time 931.92 s: f = -0.272869320156, ‖∇f‖ = 2.7454e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 35, time 932.84 s: f = -0.272917746471, ‖∇f‖ = 4.3200e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 36, time 933.76 s: f = -0.272982782958, ‖∇f‖ = 1.3998e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 37, time 935.17 s: f = -0.273001975617, ‖∇f‖ = 9.8876e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 38, time 936.04 s: f = -0.273014701175, ‖∇f‖ = 1.2336e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 39, time 936.94 s: f = -0.273032513148, ‖∇f‖ = 1.6628e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 40, time 937.86 s: f = -0.273047957579, ‖∇f‖ = 1.1548e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 41, time 939.28 s: f = -0.273056319317, ‖∇f‖ = 6.3307e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 42, time 940.16 s: f = -0.273062571624, ‖∇f‖ = 6.8219e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 43, time 941.04 s: f = -0.273067065008, ‖∇f‖ = 8.8510e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 44, time 941.96 s: f = -0.273077210295, ‖∇f‖ = 9.9163e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 45, time 944.28 s: f = -0.273086893655, ‖∇f‖ = 1.8575e-02, α = 5.12e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 46, time 945.20 s: f = -0.273103078820, ‖∇f‖ = 8.5718e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 47, time 946.11 s: f = -0.273110799145, ‖∇f‖ = 5.8581e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 48, time 947.54 s: f = -0.273120104689, ‖∇f‖ = 8.0410e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 49, time 948.44 s: f = -0.273131281118, ‖∇f‖ = 1.1878e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 50, time 949.35 s: f = -0.273143808372, ‖∇f‖ = 9.4250e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 51, time 950.28 s: f = -0.273153887747, ‖∇f‖ = 7.2150e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 52, time 951.68 s: f = -0.273158885697, ‖∇f‖ = 6.7195e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 53, time 952.56 s: f = -0.273161233672, ‖∇f‖ = 4.1608e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 54, time 953.46 s: f = -0.273163225686, ‖∇f‖ = 4.0591e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 55, time 954.35 s: f = -0.273166294475, ‖∇f‖ = 4.9791e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 56, time 955.75 s: f = -0.273169366216, ‖∇f‖ = 4.4714e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 57, time 956.64 s: f = -0.273172354203, ‖∇f‖ = 6.3685e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 58, time 957.53 s: f = -0.273175363803, ‖∇f‖ = 3.9908e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 59, time 958.43 s: f = -0.273177279555, ‖∇f‖ = 3.9256e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 60, time 959.83 s: f = -0.273182789738, ‖∇f‖ = 6.6561e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 61, time 961.64 s: f = -0.273184790994, ‖∇f‖ = 5.6288e-03, α = 5.40e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 62, time 962.54 s: f = -0.273186538838, ‖∇f‖ = 2.7232e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 63, time 963.95 s: f = -0.273187761549, ‖∇f‖ = 2.8879e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 64, time 964.83 s: f = -0.273189383930, ‖∇f‖ = 3.5846e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 65, time 965.74 s: f = -0.273193896466, ‖∇f‖ = 8.4511e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 66, time 966.67 s: f = -0.273197826544, ‖∇f‖ = 6.5550e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 67, time 968.12 s: f = -0.273200889068, ‖∇f‖ = 3.7358e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 68, time 969.01 s: f = -0.273203155185, ‖∇f‖ = 3.5407e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 69, time 969.90 s: f = -0.273203929982, ‖∇f‖ = 3.6210e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 70, time 970.80 s: f = -0.273204838272, ‖∇f‖ = 3.2225e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 71, time 972.23 s: f = -0.273208065807, ‖∇f‖ = 3.2081e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 72, time 974.02 s: f = -0.273208664671, ‖∇f‖ = 2.6363e-03, α = 3.31e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 73, time 974.93 s: f = -0.273209100927, ‖∇f‖ = 2.4085e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 74, time 976.34 s: f = -0.273212054415, ‖∇f‖ = 3.6766e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 75, time 977.24 s: f = -0.273214539457, ‖∇f‖ = 4.4246e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 76, time 979.08 s: f = -0.273216162290, ‖∇f‖ = 4.5551e-03, α = 4.50e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 77, time 980.50 s: f = -0.273217804190, ‖∇f‖ = 2.2785e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 78, time 981.39 s: f = -0.273218883441, ‖∇f‖ = 2.0806e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 79, time 982.29 s: f = -0.273220350356, ‖∇f‖ = 2.6261e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 80, time 983.22 s: f = -0.273220936494, ‖∇f‖ = 6.7764e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 81, time 984.67 s: f = -0.273223126428, ‖∇f‖ = 2.3171e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 82, time 985.56 s: f = -0.273223758728, ‖∇f‖ = 1.4729e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 83, time 986.46 s: f = -0.273224312383, ‖∇f‖ = 1.6490e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 84, time 987.36 s: f = -0.273224595281, ‖∇f‖ = 5.4564e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 85, time 988.77 s: f = -0.273225489255, ‖∇f‖ = 2.6429e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 86, time 989.66 s: f = -0.273226533423, ‖∇f‖ = 1.3412e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 87, time 990.56 s: f = -0.273227338626, ‖∇f‖ = 1.9615e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 88, time 991.47 s: f = -0.273228071304, ‖∇f‖ = 2.3684e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 89, time 992.90 s: f = -0.273228783978, ‖∇f‖ = 2.1046e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 90, time 993.79 s: f = -0.273229430170, ‖∇f‖ = 1.6761e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 91, time 994.71 s: f = -0.273230395023, ‖∇f‖ = 2.3630e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 92, time 995.62 s: f = -0.273230913396, ‖∇f‖ = 4.6952e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 93, time 997.05 s: f = -0.273231822793, ‖∇f‖ = 2.4311e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 94, time 997.94 s: f = -0.273233027133, ‖∇f‖ = 2.0551e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 95, time 998.86 s: f = -0.273234061771, ‖∇f‖ = 3.0019e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 96, time 999.77 s: f = -0.273235399472, ‖∇f‖ = 3.6034e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 97, time 1001.23 s: f = -0.273236063107, ‖∇f‖ = 3.5368e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 98, time 1002.12 s: f = -0.273236795508, ‖∇f‖ = 1.2966e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 99, time 1003.01 s: f = -0.273237171417, ‖∇f‖ = 1.7109e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 100, time 1003.93 s: f = -0.273237667965, ‖∇f‖ = 2.2989e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 101, time 1006.24 s: f = -0.273237900160, ‖∇f‖ = 2.7773e-03, α = 4.53e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 102, time 1007.14 s: f = -0.273238275586, ‖∇f‖ = 1.4700e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 103, time 1008.06 s: f = -0.273238523826, ‖∇f‖ = 8.5901e-04, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 104, time 1009.47 s: f = -0.273238752012, ‖∇f‖ = 1.6628e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 105, time 1010.37 s: f = -0.273239111781, ‖∇f‖ = 2.6098e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 106, time 1011.27 s: f = -0.273239819089, ‖∇f‖ = 3.4353e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 107, time 1012.19 s: f = -0.273240369600, ‖∇f‖ = 4.2704e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 108, time 1013.60 s: f = -0.273241162430, ‖∇f‖ = 1.8052e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 109, time 1014.50 s: f = -0.273241475226, ‖∇f‖ = 1.0380e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 110, time 1015.42 s: f = -0.273241711280, ‖∇f‖ = 1.6135e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 111, time 1016.34 s: f = -0.273241988851, ‖∇f‖ = 2.1980e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 112, time 1017.75 s: f = -0.273242526227, ‖∇f‖ = 2.4062e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 113, time 1019.58 s: f = -0.273242706890, ‖∇f‖ = 2.5536e-03, α = 2.41e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 114, time 1020.49 s: f = -0.273243063849, ‖∇f‖ = 1.2275e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 115, time 1021.91 s: f = -0.273243259716, ‖∇f‖ = 8.8173e-04, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 116, time 1022.80 s: f = -0.273243390541, ‖∇f‖ = 1.2958e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 117, time 1023.71 s: f = -0.273243624187, ‖∇f‖ = 1.6522e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 118, time 1024.65 s: f = -0.273243975601, ‖∇f‖ = 2.4195e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 119, time 1026.08 s: f = -0.273244470238, ‖∇f‖ = 1.8095e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 120, time 1026.98 s: f = -0.273244906935, ‖∇f‖ = 1.1191e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 121, time 1027.88 s: f = -0.273245198892, ‖∇f‖ = 1.8385e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 122, time 1028.78 s: f = -0.273245436436, ‖∇f‖ = 1.7034e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 123, time 1030.25 s: f = -0.273245814839, ‖∇f‖ = 1.9152e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 124, time 1031.16 s: f = -0.273246901974, ‖∇f‖ = 2.4769e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 125, time 1032.06 s: f = -0.273247151000, ‖∇f‖ = 4.6605e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 126, time 1032.99 s: f = -0.273247895600, ‖∇f‖ = 1.6220e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 127, time 1034.43 s: f = -0.273248199597, ‖∇f‖ = 1.2653e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 128, time 1035.35 s: f = -0.273248721139, ‖∇f‖ = 2.0361e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 129, time 1036.28 s: f = -0.273249366483, ‖∇f‖ = 2.4923e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 130, time 1037.20 s: f = -0.273250035605, ‖∇f‖ = 3.6119e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 131, time 1038.61 s: f = -0.273250756926, ‖∇f‖ = 2.1636e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 132, time 1039.54 s: f = -0.273251085961, ‖∇f‖ = 1.1672e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 133, time 1040.45 s: f = -0.273251307038, ‖∇f‖ = 1.3676e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 134, time 1041.38 s: f = -0.273251484982, ‖∇f‖ = 1.6617e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 135, time 1042.81 s: f = -0.273251929354, ‖∇f‖ = 1.8732e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 136, time 1044.65 s: f = -0.273252100396, ‖∇f‖ = 1.8209e-03, α = 4.46e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 137, time 1045.58 s: f = -0.273252323246, ‖∇f‖ = 1.1334e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 138, time 1047.02 s: f = -0.273252503681, ‖∇f‖ = 1.3498e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 139, time 1047.93 s: f = -0.273252679906, ‖∇f‖ = 1.8133e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 140, time 1048.85 s: f = -0.273253041604, ‖∇f‖ = 1.9959e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 141, time 1049.78 s: f = -0.273253394913, ‖∇f‖ = 2.7713e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 142, time 1051.23 s: f = -0.273253983127, ‖∇f‖ = 1.4203e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 143, time 1052.13 s: f = -0.273254647402, ‖∇f‖ = 2.1096e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 144, time 1053.05 s: f = -0.273255259635, ‖∇f‖ = 2.8357e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 145, time 1053.99 s: f = -0.273256194806, ‖∇f‖ = 3.9979e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 146, time 1056.37 s: f = -0.273256707532, ‖∇f‖ = 2.3435e-03, α = 4.40e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 147, time 1057.29 s: f = -0.273257209926, ‖∇f‖ = 1.0557e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 148, time 1058.22 s: f = -0.273257438291, ‖∇f‖ = 9.7121e-04, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 149, time 1059.67 s: f = -0.273257563053, ‖∇f‖ = 1.1509e-03, α = 1.00e+00, m = 20, nfg = 1 +┌ Warning: LBFGS: not converged to requested tol after 150 iterations and time 1060.58 s: f = -0.273257823816, ‖∇f‖ = 1.5465e-03 └ @ OptimKit ~/.julia/packages/OptimKit/G6i79/src/lbfgs.jl:197 -E = -0.27325809881788027 +E = -0.2732578238158397 ```` @@ -308,7 +308,7 @@ E_ref = -0.273284888 ```` ```` -(E - E_ref) / E_ref = -9.802657701195407e-5 +(E - E_ref) / E_ref = -9.90328603911651e-5 ```` diff --git a/docs/src/examples/bose_hubbard/main.ipynb b/docs/src/examples/bose_hubbard/main.ipynb index 69a5f18ac..b15d9f844 100644 --- a/docs/src/examples/bose_hubbard/main.ipynb +++ b/docs/src/examples/bose_hubbard/main.ipynb @@ -154,9 +154,9 @@ "outputs": [], "cell_type": "code", "source": [ - "boundary_alg = (; tol=1e-8, alg=:simultaneous, trscheme=(; alg=:fixedspace))\n", - "gradient_alg = (; tol=1e-6, maxiter=10, alg=:eigsolver, iterscheme=:diffgauge)\n", - "optimizer_alg = (; tol=1e-4, alg=:lbfgs, maxiter=150, ls_maxiter=2, ls_maxfg=2);" + "boundary_alg = (; tol = 1.0e-8, alg = :simultaneous, trscheme = (; alg = :fixedspace))\n", + "gradient_alg = (; tol = 1.0e-6, maxiter = 10, alg = :eigsolver, iterscheme = :diffgauge)\n", + "optimizer_alg = (; tol = 1.0e-4, alg = :lbfgs, maxiter = 150, ls_maxiter = 2, ls_maxfg = 2);" ], "metadata": {}, "execution_count": null @@ -205,7 +205,7 @@ "cell_type": "code", "source": [ "peps, env, E, info = fixedpoint(\n", - " H, peps₀, env₀; boundary_alg, gradient_alg, optimizer_alg, verbosity=3\n", + " H, peps₀, env₀; boundary_alg, gradient_alg, optimizer_alg, verbosity = 3\n", ")\n", "@show E;" ], diff --git a/docs/src/examples/boundary_mps/index.md b/docs/src/examples/boundary_mps/index.md index 8ddeeb1ad..d8d775dd3 100644 --- a/docs/src/examples/boundary_mps/index.md +++ b/docs/src/examples/boundary_mps/index.md @@ -187,12 +187,12 @@ boundary MPS fixed point, we call [`leading_boundary`](@ref) using the [`MPSKit.VUMPS`](@extref) algorithm: ````julia -mps, env, ϵ = leading_boundary(mps₀, T, VUMPS(; tol=1e-6, verbosity=2)); +mps, env, ϵ = leading_boundary(mps₀, T, VUMPS(; tol = 1.0e-6, verbosity = 2)); ```` ```` [ Info: VUMPS init: obj = +1.674563752306e+00 +3.035692829590e+00im err = 7.5576e-01 -[ Info: VUMPS conv 120: obj = +6.831610878310e+00 -9.694386191727e-09im err = 9.5145748780e-07 time = 25.25 sec +[ Info: VUMPS conv 120: obj = +6.831610878310e+00 -9.694385865125e-09im err = 9.5145748821e-07 time = 7.42 sec ```` @@ -204,22 +204,22 @@ norm_vumps = abs(prod(expectation_value(mps, T))) ```` ```` -6.831610878309706 +6.831610878309698 ```` This can be compared to the result obtained using CTMRG, where we see that the results match: ````julia -env_ctmrg, = leading_boundary(CTMRGEnv(ψ, ComplexSpace(20)), ψ; tol=1e-6, verbosity=2) +env_ctmrg, = leading_boundary(CTMRGEnv(ψ, ComplexSpace(20)), ψ; tol = 1.0e-6, verbosity = 2) norm_ctmrg = abs(norm(ψ, env_ctmrg)) @show abs(norm_vumps - norm_ctmrg) / norm_vumps; ```` ```` -[ Info: CTMRG init: obj = -1.530193898578e+01 +2.533005049756e-01im err = 1.0000e+00 -[ Info: CTMRG conv 30: obj = +6.831603585666e+00 err = 4.7443353447e-07 time = 3.78 sec -abs(norm_vumps - norm_ctmrg) / norm_vumps = 1.0674852619316525e-6 +[ Info: CTMRG init: obj = -1.495741317009e+01 +3.091851579631e-01im err = 1.0000e+00 +[ Info: CTMRG conv 30: obj = +6.831603585666e+00 err = 6.2262595139e-07 time = 0.40 sec +abs(norm_vumps - norm_ctmrg) / norm_vumps = 1.0674852575113105e-6 ```` @@ -238,7 +238,7 @@ argument and then define the corresponding transfer operator, where we again spe direction which will be facing north: ````julia -ψ_2x2 = InfinitePEPS(rand, ComplexF64, ComplexSpace(2), ComplexSpace(2); unitcell=(2, 2)) +ψ_2x2 = InfinitePEPS(rand, ComplexF64, ComplexSpace(2), ComplexSpace(2); unitcell = (2, 2)) T_2x2 = PEPSKit.MultilineTransferPEPS(ψ_2x2, dir); ```` @@ -246,11 +246,11 @@ Now, the procedure is the same as before: We compute the norm once using VUMPS, ````julia mps₀_2x2 = initialize_mps(T_2x2, fill(ComplexSpace(20), 2, 2)) -mps_2x2, = leading_boundary(mps₀_2x2, T_2x2, VUMPS(; tol=1e-6, verbosity=2)) +mps_2x2, = leading_boundary(mps₀_2x2, T_2x2, VUMPS(; tol = 1.0e-6, verbosity = 2)) norm_2x2_vumps = abs(prod(expectation_value(mps_2x2, T_2x2))) env_ctmrg_2x2, = leading_boundary( - CTMRGEnv(ψ_2x2, ComplexSpace(20)), ψ_2x2; tol=1e-6, verbosity=2 + CTMRGEnv(ψ_2x2, ComplexSpace(20)), ψ_2x2; tol = 1.0e-6, verbosity = 2 ) norm_2x2_ctmrg = abs(norm(ψ_2x2, env_ctmrg_2x2)) @@ -258,12 +258,12 @@ norm_2x2_ctmrg = abs(norm(ψ_2x2, env_ctmrg_2x2)) ```` ```` -[ Info: VUMPS init: obj = +9.819004336879e+02 +3.170023011746e+01im err = 8.6013e-01 -┌ Warning: VUMPS cancel 200: obj = +1.050428151028e+05 -1.899053741715e+02im err = 2.8823293066e-02 time = 2.71 min +[ Info: VUMPS init: obj = +8.149302834396e+02 -8.860408249120e+01im err = 8.6172e-01 +┌ Warning: VUMPS cancel 200: obj = +1.046992011815e+05 -2.212181695361e+00im err = 6.9503579749e-03 time = 13.67 sec └ @ MPSKit ~/.julia/packages/MPSKit/cKwp2/src/algorithms/groundstate/vumps.jl:76 -[ Info: CTMRG init: obj = -5.668964998506e+01 -2.489382614044e+01im err = 1.0000e+00 -[ Info: CTMRG conv 82: obj = +1.046633714846e+05 err = 7.6507920704e-07 time = 36.93 sec -abs(norm_2x2_vumps - norm_2x2_ctmrg) / norm_2x2_vumps = 0.0036139041100238267 +[ Info: CTMRG init: obj = -1.240261729401e+02 -1.672150510263e+01im err = 1.0000e+00 +[ Info: CTMRG conv 47: obj = +1.046633714846e+05 err = 1.6991268013e-07 time = 1.84 sec +abs(norm_2x2_vumps - norm_2x2_ctmrg) / norm_2x2_vumps = 0.00034221579358038244 ```` @@ -282,7 +282,7 @@ T | \psi \rangle$. The classical Ising PEPO is defined as follows: ````julia -function ising_pepo(β; unitcell=(1, 1, 1)) +function ising_pepo(β; unitcell = (1, 1, 1)) t = ComplexF64[exp(β) exp(-β); exp(-β) exp(β)] q = sqrt(t) @@ -317,16 +317,16 @@ As before, we converge the boundary MPS using VUMPS and then compute the expecta ````julia mps₀_pepo = initialize_mps(transfer_pepo, [ComplexSpace(20)]) -mps_pepo, = leading_boundary(mps₀_pepo, transfer_pepo, VUMPS(; tol=1e-6, verbosity=2)) +mps_pepo, = leading_boundary(mps₀_pepo, transfer_pepo, VUMPS(; tol = 1.0e-6, verbosity = 2)) norm_pepo = abs(prod(expectation_value(mps_pepo, transfer_pepo))); @show norm_pepo; ```` ```` -[ Info: VUMPS init: obj = +2.552585816795e+01 -2.455978462565e-01im err = 8.9526e-01 -┌ Warning: VUMPS cancel 200: obj = +6.211569029510e+01 +1.206390478837e+00im err = 6.9644987097e-01 time = 3.12 min +[ Info: VUMPS init: obj = +2.655321432467e+01 +3.760603778362e-01im err = 8.9759e-01 +┌ Warning: VUMPS cancel 200: obj = +7.226394646816e+01 +6.223361199138e+00im err = 5.7986634490e-01 time = 37.47 sec └ @ MPSKit ~/.julia/packages/MPSKit/cKwp2/src/algorithms/groundstate/vumps.jl:76 -norm_pepo = 62.12740424984486 +norm_pepo = 72.5314289378628 ```` diff --git a/docs/src/examples/boundary_mps/main.ipynb b/docs/src/examples/boundary_mps/main.ipynb index db4ba69cc..0df75e4fc 100644 --- a/docs/src/examples/boundary_mps/main.ipynb +++ b/docs/src/examples/boundary_mps/main.ipynb @@ -194,7 +194,7 @@ "outputs": [], "cell_type": "code", "source": [ - "mps, env, ϵ = leading_boundary(mps₀, T, VUMPS(; tol=1e-6, verbosity=2));" + "mps, env, ϵ = leading_boundary(mps₀, T, VUMPS(; tol = 1.0e-6, verbosity = 2));" ], "metadata": {}, "execution_count": null @@ -228,7 +228,7 @@ "outputs": [], "cell_type": "code", "source": [ - "env_ctmrg, = leading_boundary(CTMRGEnv(ψ, ComplexSpace(20)), ψ; tol=1e-6, verbosity=2)\n", + "env_ctmrg, = leading_boundary(CTMRGEnv(ψ, ComplexSpace(20)), ψ; tol = 1.0e-6, verbosity = 2)\n", "norm_ctmrg = abs(norm(ψ, env_ctmrg))\n", "@show abs(norm_vumps - norm_ctmrg) / norm_vumps;" ], @@ -258,7 +258,7 @@ "outputs": [], "cell_type": "code", "source": [ - "ψ_2x2 = InfinitePEPS(rand, ComplexF64, ComplexSpace(2), ComplexSpace(2); unitcell=(2, 2))\n", + "ψ_2x2 = InfinitePEPS(rand, ComplexF64, ComplexSpace(2), ComplexSpace(2); unitcell = (2, 2))\n", "T_2x2 = PEPSKit.MultilineTransferPEPS(ψ_2x2, dir);" ], "metadata": {}, @@ -276,11 +276,11 @@ "cell_type": "code", "source": [ "mps₀_2x2 = initialize_mps(T_2x2, fill(ComplexSpace(20), 2, 2))\n", - "mps_2x2, = leading_boundary(mps₀_2x2, T_2x2, VUMPS(; tol=1e-6, verbosity=2))\n", + "mps_2x2, = leading_boundary(mps₀_2x2, T_2x2, VUMPS(; tol = 1.0e-6, verbosity = 2))\n", "norm_2x2_vumps = abs(prod(expectation_value(mps_2x2, T_2x2)))\n", "\n", "env_ctmrg_2x2, = leading_boundary(\n", - " CTMRGEnv(ψ_2x2, ComplexSpace(20)), ψ_2x2; tol=1e-6, verbosity=2\n", + " CTMRGEnv(ψ_2x2, ComplexSpace(20)), ψ_2x2; tol = 1.0e-6, verbosity = 2\n", ")\n", "norm_2x2_ctmrg = abs(norm(ψ_2x2, env_ctmrg_2x2))\n", "\n", @@ -312,7 +312,7 @@ "outputs": [], "cell_type": "code", "source": [ - "function ising_pepo(β; unitcell=(1, 1, 1))\n", + "function ising_pepo(β; unitcell = (1, 1, 1))\n", " t = ComplexF64[exp(β) exp(-β); exp(-β) exp(β)]\n", " q = sqrt(t)\n", "\n", @@ -359,7 +359,7 @@ "cell_type": "code", "source": [ "mps₀_pepo = initialize_mps(transfer_pepo, [ComplexSpace(20)])\n", - "mps_pepo, = leading_boundary(mps₀_pepo, transfer_pepo, VUMPS(; tol=1e-6, verbosity=2))\n", + "mps_pepo, = leading_boundary(mps₀_pepo, transfer_pepo, VUMPS(; tol = 1.0e-6, verbosity = 2))\n", "norm_pepo = abs(prod(expectation_value(mps_pepo, transfer_pepo)));\n", "@show norm_pepo;" ], @@ -390,11 +390,11 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.10.4" + "version": "1.11.5" }, "kernelspec": { - "name": "julia-1.10", - "display_name": "Julia 1.10.4", + "name": "julia-1.11", + "display_name": "Julia 1.11.5", "language": "julia" } }, diff --git a/docs/src/examples/fermi_hubbard/index.md b/docs/src/examples/fermi_hubbard/index.md index 5e98c0e43..32e36042c 100644 --- a/docs/src/examples/fermi_hubbard/index.md +++ b/docs/src/examples/fermi_hubbard/index.md @@ -81,9 +81,9 @@ Again, the procedure of ground state optimization is very similar to before. Fir define all algorithmic parameters: ````julia -boundary_alg = (; tol=1e-8, alg=:simultaneous, trscheme=(; alg=:fixedspace)) -gradient_alg = (; tol=1e-6, alg=:eigsolver, maxiter=10, iterscheme=:diffgauge) -optimizer_alg = (; tol=1e-4, alg=:lbfgs, maxiter=80, ls_maxiter=3, ls_maxfg=3) +boundary_alg = (; tol = 1.0e-8, alg = :simultaneous, trscheme = (; alg = :fixedspace)) +gradient_alg = (; tol = 1.0e-6, alg = :eigsolver, maxiter = 10, iterscheme = :diffgauge) +optimizer_alg = (; tol = 1.0e-4, alg = :lbfgs, maxiter = 80, ls_maxiter = 3, ls_maxfg = 3) ```` ```` @@ -102,7 +102,7 @@ env₀, = leading_boundary(CTMRGEnv(peps₀, V_env), peps₀; boundary_alg...); ```` [ Info: CTMRG init: obj = +5.484842275412e+04 +4.469243203539e+04im err = 1.0000e+00 -[ Info: CTMRG conv 26: obj = +8.371681846538e+04 -3.790555638261e-07im err = 7.4963854454e-09 time = 13.30 sec +[ Info: CTMRG conv 26: obj = +8.371681846538e+04 -3.789700713241e-07im err = 7.4963851544e-09 time = 14.25 sec ```` @@ -110,7 +110,7 @@ And third, we start the ground state search (this does take quite long): ````julia peps, env, E, info = fixedpoint( - H, peps₀, env₀; boundary_alg, gradient_alg, optimizer_alg, verbosity=3 + H, peps₀, env₀; boundary_alg, gradient_alg, optimizer_alg, verbosity = 3 ) @show E; ```` @@ -120,91 +120,91 @@ peps, env, E, info = fixedpoint( ┌ Warning: Linesearch not converged after 1 iterations and 4 function evaluations: │ α = 2.50e+01, dϕ = -1.49e-01, ϕ - ϕ₀ = -2.88e+00 └ @ OptimKit ~/.julia/packages/OptimKit/G6i79/src/linesearches.jl:148 -[ Info: LBFGS: iter 1, time 793.77 s: f = 3.801380487744, ‖∇f‖ = 2.3456e+01, α = 2.50e+01, m = 0, nfg = 4 +[ Info: LBFGS: iter 1, time 874.29 s: f = 3.801380487744, ‖∇f‖ = 2.3456e+01, α = 2.50e+01, m = 0, nfg = 4 ┌ Warning: Linesearch not converged after 1 iterations and 4 function evaluations: │ α = 2.50e+01, dϕ = -5.73e-03, ϕ - ϕ₀ = -3.81e+00 └ @ OptimKit ~/.julia/packages/OptimKit/G6i79/src/linesearches.jl:148 -[ Info: LBFGS: iter 2, time 853.65 s: f = -0.009727650286, ‖∇f‖ = 3.2049e+00, α = 2.50e+01, m = 0, nfg = 4 -[ Info: LBFGS: iter 3, time 863.27 s: f = -0.115210826428, ‖∇f‖ = 2.7846e+00, α = 1.00e+00, m = 1, nfg = 1 -[ Info: LBFGS: iter 4, time 871.02 s: f = -0.616412169228, ‖∇f‖ = 2.3680e+00, α = 1.00e+00, m = 2, nfg = 1 -[ Info: LBFGS: iter 5, time 879.38 s: f = -0.817801148604, ‖∇f‖ = 1.9111e+00, α = 1.00e+00, m = 3, nfg = 1 -[ Info: LBFGS: iter 6, time 886.54 s: f = -0.990286615265, ‖∇f‖ = 2.3790e+00, α = 1.00e+00, m = 4, nfg = 1 -[ Info: LBFGS: iter 7, time 893.63 s: f = -1.142787566798, ‖∇f‖ = 1.5680e+00, α = 1.00e+00, m = 5, nfg = 1 -[ Info: LBFGS: iter 8, time 900.37 s: f = -1.238274330219, ‖∇f‖ = 3.5015e+00, α = 1.00e+00, m = 6, nfg = 1 -[ Info: LBFGS: iter 9, time 906.52 s: f = -1.438136282421, ‖∇f‖ = 1.3366e+00, α = 1.00e+00, m = 7, nfg = 1 -[ Info: LBFGS: iter 10, time 913.28 s: f = -1.523107107396, ‖∇f‖ = 1.3496e+00, α = 1.00e+00, m = 8, nfg = 1 -[ Info: LBFGS: iter 11, time 925.83 s: f = -1.619305193101, ‖∇f‖ = 1.1951e+00, α = 1.72e-01, m = 9, nfg = 2 -[ Info: LBFGS: iter 12, time 938.59 s: f = -1.681451834691, ‖∇f‖ = 9.4848e-01, α = 2.37e-01, m = 10, nfg = 2 -[ Info: LBFGS: iter 13, time 945.21 s: f = -1.720734533825, ‖∇f‖ = 1.4216e+00, α = 1.00e+00, m = 11, nfg = 1 -[ Info: LBFGS: iter 14, time 951.23 s: f = -1.770831967062, ‖∇f‖ = 6.2747e-01, α = 1.00e+00, m = 12, nfg = 1 -[ Info: LBFGS: iter 15, time 957.54 s: f = -1.807572162185, ‖∇f‖ = 5.1320e-01, α = 1.00e+00, m = 13, nfg = 1 -[ Info: LBFGS: iter 16, time 964.04 s: f = -1.859768355558, ‖∇f‖ = 7.1320e-01, α = 1.00e+00, m = 14, nfg = 1 -[ Info: LBFGS: iter 17, time 970.07 s: f = -1.893160382125, ‖∇f‖ = 6.7323e-01, α = 1.00e+00, m = 15, nfg = 1 -[ Info: LBFGS: iter 18, time 976.60 s: f = -1.923092489408, ‖∇f‖ = 5.5419e-01, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 19, time 982.73 s: f = -1.948142544093, ‖∇f‖ = 4.7661e-01, α = 1.00e+00, m = 17, nfg = 1 -[ Info: LBFGS: iter 20, time 988.99 s: f = -1.969512080077, ‖∇f‖ = 4.1608e-01, α = 1.00e+00, m = 18, nfg = 1 -[ Info: LBFGS: iter 21, time 995.49 s: f = -1.982557838199, ‖∇f‖ = 4.5138e-01, α = 1.00e+00, m = 19, nfg = 1 -[ Info: LBFGS: iter 22, time 1001.53 s: f = -1.994007805763, ‖∇f‖ = 3.1538e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 23, time 1008.01 s: f = -2.002836016203, ‖∇f‖ = 3.0511e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 24, time 1014.23 s: f = -2.014062852739, ‖∇f‖ = 3.3491e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 25, time 1020.54 s: f = -2.022023251661, ‖∇f‖ = 4.3758e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 26, time 1027.43 s: f = -2.030112566345, ‖∇f‖ = 2.0509e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 27, time 1033.68 s: f = -2.035073683394, ‖∇f‖ = 1.6307e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 28, time 1041.37 s: f = -2.038663850455, ‖∇f‖ = 1.6880e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 29, time 1047.68 s: f = -2.041323592429, ‖∇f‖ = 2.4114e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 30, time 1054.18 s: f = -2.044997390531, ‖∇f‖ = 1.2115e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 31, time 1060.52 s: f = -2.046747469529, ‖∇f‖ = 9.5108e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 32, time 1066.77 s: f = -2.048741416293, ‖∇f‖ = 1.0509e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 33, time 1073.32 s: f = -2.049793769908, ‖∇f‖ = 1.7378e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 34, time 1079.57 s: f = -2.051022900848, ‖∇f‖ = 6.4055e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 35, time 1086.37 s: f = -2.051499900828, ‖∇f‖ = 4.9307e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 36, time 1092.41 s: f = -2.051918795787, ‖∇f‖ = 6.2013e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 37, time 1098.86 s: f = -2.052357188363, ‖∇f‖ = 9.4494e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 38, time 1105.51 s: f = -2.052855317283, ‖∇f‖ = 4.8219e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 39, time 1111.67 s: f = -2.053138284528, ‖∇f‖ = 3.5599e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 40, time 1118.16 s: f = -2.053404037719, ‖∇f‖ = 4.1844e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 41, time 1124.32 s: f = -2.053605747242, ‖∇f‖ = 5.7514e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 42, time 1130.46 s: f = -2.053822345457, ‖∇f‖ = 3.1996e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 43, time 1137.04 s: f = -2.054015631924, ‖∇f‖ = 3.1314e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 44, time 1143.26 s: f = -2.054206835742, ‖∇f‖ = 4.1588e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 45, time 1149.94 s: f = -2.054349141892, ‖∇f‖ = 6.7905e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 46, time 1156.12 s: f = -2.054531571463, ‖∇f‖ = 2.9227e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 47, time 1162.09 s: f = -2.054628027248, ‖∇f‖ = 2.5100e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 48, time 1168.81 s: f = -2.054735541814, ‖∇f‖ = 3.1538e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 49, time 1174.97 s: f = -2.054896782689, ‖∇f‖ = 3.4823e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 50, time 1187.91 s: f = -2.055018285181, ‖∇f‖ = 5.2680e-02, α = 5.17e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 51, time 1194.18 s: f = -2.055214629205, ‖∇f‖ = 3.0513e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 52, time 1200.82 s: f = -2.055401907931, ‖∇f‖ = 2.8740e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 53, time 1207.17 s: f = -2.055643036845, ‖∇f‖ = 4.1540e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 54, time 1214.41 s: f = -2.055979753449, ‖∇f‖ = 6.0310e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 55, time 1221.01 s: f = -2.056292876565, ‖∇f‖ = 6.4503e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 56, time 1227.43 s: f = -2.056764405334, ‖∇f‖ = 4.5709e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 57, time 1234.03 s: f = -2.057301128967, ‖∇f‖ = 5.8535e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 58, time 1240.46 s: f = -2.057684443650, ‖∇f‖ = 7.0407e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 59, time 1247.59 s: f = -2.058273607981, ‖∇f‖ = 6.4287e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 60, time 1254.06 s: f = -2.058991887287, ‖∇f‖ = 8.8941e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 61, time 1260.57 s: f = -2.059459011165, ‖∇f‖ = 1.1553e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 62, time 1267.38 s: f = -2.060066395744, ‖∇f‖ = 6.9440e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 63, time 1273.69 s: f = -2.060520108858, ‖∇f‖ = 8.4931e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 64, time 1286.84 s: f = -2.060815447648, ‖∇f‖ = 1.2115e-01, α = 5.26e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 65, time 1300.45 s: f = -2.060925751723, ‖∇f‖ = 8.3903e-02, α = 5.47e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 66, time 1306.62 s: f = -2.061209735735, ‖∇f‖ = 5.4010e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 67, time 1313.25 s: f = -2.061580165204, ‖∇f‖ = 5.5975e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 68, time 1319.55 s: f = -2.062036980876, ‖∇f‖ = 7.8898e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 69, time 1326.11 s: f = -2.062251708571, ‖∇f‖ = 1.1537e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 70, time 1332.60 s: f = -2.062519627764, ‖∇f‖ = 1.2953e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 71, time 1339.00 s: f = -2.063059957357, ‖∇f‖ = 7.2868e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 72, time 1345.65 s: f = -2.063313169462, ‖∇f‖ = 5.2530e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 73, time 1351.78 s: f = -2.063715485916, ‖∇f‖ = 5.0261e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 74, time 1358.45 s: f = -2.064332648129, ‖∇f‖ = 7.7209e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 75, time 1364.80 s: f = -2.064773366748, ‖∇f‖ = 1.2451e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 76, time 1371.14 s: f = -2.065371919335, ‖∇f‖ = 6.8015e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 77, time 1378.07 s: f = -2.065945932184, ‖∇f‖ = 7.6664e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 78, time 1384.35 s: f = -2.066640743413, ‖∇f‖ = 1.1191e-01, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 79, time 1391.26 s: f = -2.067648357027, ‖∇f‖ = 2.3836e-01, α = 1.00e+00, m = 20, nfg = 1 -┌ Warning: LBFGS: not converged to requested tol after 80 iterations and time 1397.73 s: f = -2.069253142065, ‖∇f‖ = 2.0413e-01 +[ Info: LBFGS: iter 2, time 963.43 s: f = -0.009727650286, ‖∇f‖ = 3.2049e+00, α = 2.50e+01, m = 0, nfg = 4 +[ Info: LBFGS: iter 3, time 977.14 s: f = -0.115210826428, ‖∇f‖ = 2.7846e+00, α = 1.00e+00, m = 1, nfg = 1 +[ Info: LBFGS: iter 4, time 990.71 s: f = -0.616412169228, ‖∇f‖ = 2.3680e+00, α = 1.00e+00, m = 2, nfg = 1 +[ Info: LBFGS: iter 5, time 1003.13 s: f = -0.817801148604, ‖∇f‖ = 1.9111e+00, α = 1.00e+00, m = 3, nfg = 1 +[ Info: LBFGS: iter 6, time 1015.30 s: f = -0.990286615265, ‖∇f‖ = 2.3790e+00, α = 1.00e+00, m = 4, nfg = 1 +[ Info: LBFGS: iter 7, time 1026.31 s: f = -1.142787566798, ‖∇f‖ = 1.5680e+00, α = 1.00e+00, m = 5, nfg = 1 +[ Info: LBFGS: iter 8, time 1036.16 s: f = -1.238274330219, ‖∇f‖ = 3.5015e+00, α = 1.00e+00, m = 6, nfg = 1 +[ Info: LBFGS: iter 9, time 1046.93 s: f = -1.438136282421, ‖∇f‖ = 1.3366e+00, α = 1.00e+00, m = 7, nfg = 1 +[ Info: LBFGS: iter 10, time 1056.67 s: f = -1.523107107396, ‖∇f‖ = 1.3496e+00, α = 1.00e+00, m = 8, nfg = 1 +[ Info: LBFGS: iter 11, time 1077.81 s: f = -1.619305193101, ‖∇f‖ = 1.1951e+00, α = 1.72e-01, m = 9, nfg = 2 +[ Info: LBFGS: iter 12, time 1097.26 s: f = -1.681451834691, ‖∇f‖ = 9.4848e-01, α = 2.37e-01, m = 10, nfg = 2 +[ Info: LBFGS: iter 13, time 1107.99 s: f = -1.720734533825, ‖∇f‖ = 1.4216e+00, α = 1.00e+00, m = 11, nfg = 1 +[ Info: LBFGS: iter 14, time 1117.66 s: f = -1.770831967062, ‖∇f‖ = 6.2747e-01, α = 1.00e+00, m = 12, nfg = 1 +[ Info: LBFGS: iter 15, time 1127.31 s: f = -1.807572162185, ‖∇f‖ = 5.1320e-01, α = 1.00e+00, m = 13, nfg = 1 +[ Info: LBFGS: iter 16, time 1138.09 s: f = -1.859768355558, ‖∇f‖ = 7.1320e-01, α = 1.00e+00, m = 14, nfg = 1 +[ Info: LBFGS: iter 17, time 1147.68 s: f = -1.893160382125, ‖∇f‖ = 6.7323e-01, α = 1.00e+00, m = 15, nfg = 1 +[ Info: LBFGS: iter 18, time 1157.44 s: f = -1.923092489408, ‖∇f‖ = 5.5419e-01, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 19, time 1168.12 s: f = -1.948142544093, ‖∇f‖ = 4.7661e-01, α = 1.00e+00, m = 17, nfg = 1 +[ Info: LBFGS: iter 20, time 1177.91 s: f = -1.969512080077, ‖∇f‖ = 4.1608e-01, α = 1.00e+00, m = 18, nfg = 1 +[ Info: LBFGS: iter 21, time 1187.87 s: f = -1.982557838199, ‖∇f‖ = 4.5138e-01, α = 1.00e+00, m = 19, nfg = 1 +[ Info: LBFGS: iter 22, time 1198.67 s: f = -1.994007805763, ‖∇f‖ = 3.1538e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 23, time 1208.61 s: f = -2.002836016203, ‖∇f‖ = 3.0511e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 24, time 1218.59 s: f = -2.014062852739, ‖∇f‖ = 3.3491e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 25, time 1229.70 s: f = -2.022023251661, ‖∇f‖ = 4.3758e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 26, time 1239.66 s: f = -2.030112566345, ‖∇f‖ = 2.0509e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 27, time 1249.67 s: f = -2.035073683394, ‖∇f‖ = 1.6307e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 28, time 1261.85 s: f = -2.038663850455, ‖∇f‖ = 1.6880e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 29, time 1271.84 s: f = -2.041323592429, ‖∇f‖ = 2.4114e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 30, time 1281.66 s: f = -2.044997390530, ‖∇f‖ = 1.2115e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 31, time 1292.49 s: f = -2.046747469529, ‖∇f‖ = 9.5108e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 32, time 1302.32 s: f = -2.048741416292, ‖∇f‖ = 1.0509e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 33, time 1312.17 s: f = -2.049793769908, ‖∇f‖ = 1.7378e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 34, time 1323.04 s: f = -2.051022900848, ‖∇f‖ = 6.4055e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 35, time 1332.89 s: f = -2.051499900828, ‖∇f‖ = 4.9307e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 36, time 1342.73 s: f = -2.051918795787, ‖∇f‖ = 6.2013e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 37, time 1353.60 s: f = -2.052357188363, ‖∇f‖ = 9.4494e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 38, time 1363.45 s: f = -2.052855317283, ‖∇f‖ = 4.8219e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 39, time 1373.40 s: f = -2.053138284528, ‖∇f‖ = 3.5599e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 40, time 1384.12 s: f = -2.053404037719, ‖∇f‖ = 4.1844e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 41, time 1393.97 s: f = -2.053605747242, ‖∇f‖ = 5.7514e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 42, time 1403.69 s: f = -2.053822345457, ‖∇f‖ = 3.1996e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 43, time 1414.45 s: f = -2.054015631924, ‖∇f‖ = 3.1314e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 44, time 1424.21 s: f = -2.054206835742, ‖∇f‖ = 4.1588e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 45, time 1434.10 s: f = -2.054349141892, ‖∇f‖ = 6.7905e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 46, time 1444.85 s: f = -2.054531571463, ‖∇f‖ = 2.9227e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 47, time 1454.61 s: f = -2.054628027248, ‖∇f‖ = 2.5100e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 48, time 1464.37 s: f = -2.054735541814, ‖∇f‖ = 3.1538e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 49, time 1475.16 s: f = -2.054896782689, ‖∇f‖ = 3.4823e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 50, time 1494.75 s: f = -2.055018285181, ‖∇f‖ = 5.2680e-02, α = 5.17e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 51, time 1505.51 s: f = -2.055214629205, ‖∇f‖ = 3.0513e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 52, time 1515.33 s: f = -2.055401907932, ‖∇f‖ = 2.8740e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 53, time 1525.32 s: f = -2.055643036846, ‖∇f‖ = 4.1540e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 54, time 1536.28 s: f = -2.055979753449, ‖∇f‖ = 6.0310e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 55, time 1546.19 s: f = -2.056292876566, ‖∇f‖ = 6.4503e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 56, time 1556.12 s: f = -2.056764405334, ‖∇f‖ = 4.5709e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 57, time 1567.05 s: f = -2.057301128966, ‖∇f‖ = 5.8535e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 58, time 1577.08 s: f = -2.057684443651, ‖∇f‖ = 7.0407e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 59, time 1587.05 s: f = -2.058273607978, ‖∇f‖ = 6.4287e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 60, time 1598.01 s: f = -2.058991887288, ‖∇f‖ = 8.8941e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 61, time 1607.94 s: f = -2.059459011130, ‖∇f‖ = 1.1553e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 62, time 1617.89 s: f = -2.060066395726, ‖∇f‖ = 6.9440e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 63, time 1628.87 s: f = -2.060520108822, ‖∇f‖ = 8.4931e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 64, time 1648.98 s: f = -2.060815447626, ‖∇f‖ = 1.2115e-01, α = 5.26e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 65, time 1669.96 s: f = -2.060925751714, ‖∇f‖ = 8.3903e-02, α = 5.47e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 66, time 1679.97 s: f = -2.061209735729, ‖∇f‖ = 5.4010e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 67, time 1690.95 s: f = -2.061580165208, ‖∇f‖ = 5.5975e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 68, time 1701.12 s: f = -2.062036980891, ‖∇f‖ = 7.8898e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 69, time 1711.14 s: f = -2.062251708572, ‖∇f‖ = 1.1537e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 70, time 1722.19 s: f = -2.062519628412, ‖∇f‖ = 1.2953e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 71, time 1732.19 s: f = -2.063059957021, ‖∇f‖ = 7.2868e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 72, time 1742.20 s: f = -2.063313168886, ‖∇f‖ = 5.2530e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 73, time 1753.23 s: f = -2.063715484908, ‖∇f‖ = 5.0261e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 74, time 1763.31 s: f = -2.064332647622, ‖∇f‖ = 7.7210e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 75, time 1773.36 s: f = -2.064773364480, ‖∇f‖ = 1.2451e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 76, time 1784.47 s: f = -2.065371916869, ‖∇f‖ = 6.8015e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 77, time 1794.59 s: f = -2.065945928950, ‖∇f‖ = 7.6664e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 78, time 1804.62 s: f = -2.066640737009, ‖∇f‖ = 1.1191e-01, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 79, time 1815.78 s: f = -2.067648349055, ‖∇f‖ = 2.3836e-01, α = 1.00e+00, m = 20, nfg = 1 +┌ Warning: LBFGS: not converged to requested tol after 80 iterations and time 1826.00 s: f = -2.069253135434, ‖∇f‖ = 2.0413e-01 └ @ OptimKit ~/.julia/packages/OptimKit/G6i79/src/lbfgs.jl:197 -E = -2.069253142065458 +E = -2.069253135433506 ```` @@ -219,7 +219,7 @@ E_ref = -2.09765625 ```` ```` -(E - E_ref) / E_ref = -0.013540401547938157 +(E - E_ref) / E_ref = -0.013540404709539051 ```` diff --git a/docs/src/examples/fermi_hubbard/main.ipynb b/docs/src/examples/fermi_hubbard/main.ipynb index 601e4d146..3c91e65da 100644 --- a/docs/src/examples/fermi_hubbard/main.ipynb +++ b/docs/src/examples/fermi_hubbard/main.ipynb @@ -127,9 +127,9 @@ "outputs": [], "cell_type": "code", "source": [ - "boundary_alg = (; tol=1e-8, alg=:simultaneous, trscheme=(; alg=:fixedspace))\n", - "gradient_alg = (; tol=1e-6, alg=:eigsolver, maxiter=10, iterscheme=:diffgauge)\n", - "optimizer_alg = (; tol=1e-4, alg=:lbfgs, maxiter=80, ls_maxiter=3, ls_maxfg=3)" + "boundary_alg = (; tol = 1.0e-8, alg = :simultaneous, trscheme = (; alg = :fixedspace))\n", + "gradient_alg = (; tol = 1.0e-6, alg = :eigsolver, maxiter = 10, iterscheme = :diffgauge)\n", + "optimizer_alg = (; tol = 1.0e-4, alg = :lbfgs, maxiter = 80, ls_maxiter = 3, ls_maxfg = 3)" ], "metadata": {}, "execution_count": null @@ -166,7 +166,7 @@ "cell_type": "code", "source": [ "peps, env, E, info = fixedpoint(\n", - " H, peps₀, env₀; boundary_alg, gradient_alg, optimizer_alg, verbosity=3\n", + " H, peps₀, env₀; boundary_alg, gradient_alg, optimizer_alg, verbosity = 3\n", ")\n", "@show E;" ], diff --git a/docs/src/examples/heisenberg/index.md b/docs/src/examples/heisenberg/index.md index 069ec1571..304e932b6 100644 --- a/docs/src/examples/heisenberg/index.md +++ b/docs/src/examples/heisenberg/index.md @@ -44,7 +44,7 @@ the `heisenberg_XYZ` method from [MPSKitModels](https://quantumkithub.github.io/ which is redefined for the `InfiniteSquare` and reexported in PEPSKit: ````julia -H = heisenberg_XYZ(InfiniteSquare(); Jx=-1, Jy=1, Jz=-1) +H = heisenberg_XYZ(InfiniteSquare(); Jx = -1, Jy = 1, Jz = -1) ```` ```` @@ -106,7 +106,7 @@ arguments. To see a description of all arguments, see the docstring of specific tolerance and during the CTMRG run keep all index dimensions fixed: ````julia -boundary_alg = (; tol=1e-10, trscheme=(; alg=:fixedspace)); +boundary_alg = (; tol = 1.0e-10, trscheme = (; alg = :fixedspace)); ```` Let us also configure the optimizer algorithm. We are going to optimize the PEPS using the @@ -115,7 +115,7 @@ the convergence tolerance (for the gradient norm) as well as the maximal number and the BFGS memory size (which is used to approximate the Hessian): ````julia -optimizer_alg = (; alg=:lbfgs, tol=1e-4, maxiter=100, lbfgs_memory=16); +optimizer_alg = (; alg = :lbfgs, tol = 1.0e-4, maxiter = 100, lbfgs_memory = 16); ```` Additionally, during optimization, we want to reuse the previous CTMRG environment to @@ -182,7 +182,7 @@ env₀, info_ctmrg = leading_boundary(env_random, peps₀; boundary_alg...); ```` [ Info: CTMRG init: obj = -2.749614463601e+00 +3.639628057806e+00im err = 1.0000e+00 -[ Info: CTMRG conv 27: obj = +9.727103564786e+00 err = 2.6201331116e-11 time = 0.11 sec +[ Info: CTMRG conv 27: obj = +9.727103564786e+00 err = 2.6201801020e-11 time = 0.22 sec ```` @@ -196,7 +196,7 @@ directions and unit cell entries: ```` ```` -info_ctmrg.truncation_error = 0.0008076332824218652 +info_ctmrg.truncation_error = 0.000807633282421865 ```` @@ -214,89 +214,88 @@ peps, env, E, info_opt = fixedpoint( ```` [ Info: LBFGS: initializing with f = 0.000601645310, ‖∇f‖ = 9.3547e-01 -[ Info: LBFGS: iter 1, time 530.06 s: f = -0.489780515318, ‖∇f‖ = 6.0029e-01, α = 5.94e+01, m = 0, nfg = 5 -[ Info: LBFGS: iter 2, time 530.54 s: f = -0.501969370083, ‖∇f‖ = 5.3739e-01, α = 2.80e-01, m = 1, nfg = 2 -[ Info: LBFGS: iter 3, time 530.74 s: f = -0.523150697049, ‖∇f‖ = 3.9920e-01, α = 1.00e+00, m = 2, nfg = 1 -[ Info: LBFGS: iter 4, time 531.20 s: f = -0.538654572532, ‖∇f‖ = 4.1550e-01, α = 2.29e-01, m = 3, nfg = 2 -[ Info: LBFGS: iter 5, time 532.38 s: f = -0.549895732330, ‖∇f‖ = 4.4023e-01, α = 6.96e-02, m = 4, nfg = 4 -[ Info: LBFGS: iter 6, time 532.92 s: f = -0.568903773751, ‖∇f‖ = 4.8251e-01, α = 2.23e-01, m = 5, nfg = 2 -[ Info: LBFGS: iter 7, time 533.16 s: f = -0.586868032368, ‖∇f‖ = 4.2837e-01, α = 1.00e+00, m = 6, nfg = 1 -[ Info: LBFGS: iter 8, time 533.38 s: f = -0.599838784884, ‖∇f‖ = 2.2069e-01, α = 1.00e+00, m = 7, nfg = 1 -[ Info: LBFGS: iter 9, time 533.60 s: f = -0.606610614420, ‖∇f‖ = 1.9251e-01, α = 1.00e+00, m = 8, nfg = 1 -[ Info: LBFGS: iter 10, time 533.84 s: f = -0.624864046816, ‖∇f‖ = 2.9515e-01, α = 1.00e+00, m = 9, nfg = 1 -[ Info: LBFGS: iter 11, time 534.08 s: f = -0.638375159059, ‖∇f‖ = 2.3675e-01, α = 1.00e+00, m = 10, nfg = 1 -[ Info: LBFGS: iter 12, time 534.31 s: f = -0.644407080181, ‖∇f‖ = 3.2337e-01, α = 1.00e+00, m = 11, nfg = 1 -[ Info: LBFGS: iter 13, time 534.50 s: f = -0.651446429016, ‖∇f‖ = 1.3169e-01, α = 1.00e+00, m = 12, nfg = 1 -[ Info: LBFGS: iter 14, time 534.72 s: f = -0.654528109114, ‖∇f‖ = 6.6176e-02, α = 1.00e+00, m = 13, nfg = 1 -[ Info: LBFGS: iter 15, time 534.91 s: f = -0.655971360805, ‖∇f‖ = 5.1875e-02, α = 1.00e+00, m = 14, nfg = 1 -[ Info: LBFGS: iter 16, time 535.10 s: f = -0.657229359697, ‖∇f‖ = 5.8978e-02, α = 1.00e+00, m = 15, nfg = 1 -[ Info: LBFGS: iter 17, time 535.32 s: f = -0.658531955935, ‖∇f‖ = 5.5554e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 18, time 535.52 s: f = -0.659295132854, ‖∇f‖ = 3.0496e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 19, time 536.06 s: f = -0.659541951176, ‖∇f‖ = 2.2298e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 20, time 536.20 s: f = -0.659737986411, ‖∇f‖ = 2.7588e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 21, time 536.36 s: f = -0.659907309305, ‖∇f‖ = 1.9371e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 22, time 536.54 s: f = -0.660097028826, ‖∇f‖ = 1.4424e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 23, time 536.71 s: f = -0.660261859699, ‖∇f‖ = 1.2401e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 24, time 536.87 s: f = -0.660393163588, ‖∇f‖ = 1.9193e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 25, time 537.07 s: f = -0.660497281869, ‖∇f‖ = 1.3339e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 26, time 537.25 s: f = -0.660573874568, ‖∇f‖ = 1.2488e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 27, time 537.44 s: f = -0.660741356378, ‖∇f‖ = 1.6202e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 28, time 537.65 s: f = -0.660904313170, ‖∇f‖ = 1.8663e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 29, time 537.86 s: f = -0.661016299819, ‖∇f‖ = 1.3961e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 30, time 538.08 s: f = -0.661073848395, ‖∇f‖ = 8.0058e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 31, time 538.31 s: f = -0.661115845926, ‖∇f‖ = 7.7807e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 32, time 538.56 s: f = -0.661170946003, ‖∇f‖ = 9.2025e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 33, time 538.80 s: f = -0.661189817521, ‖∇f‖ = 1.7374e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 34, time 539.03 s: f = -0.661228749942, ‖∇f‖ = 5.5230e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 35, time 539.24 s: f = -0.661241674095, ‖∇f‖ = 4.6578e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 36, time 539.47 s: f = -0.661255546757, ‖∇f‖ = 5.3449e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 37, time 539.65 s: f = -0.661267660051, ‖∇f‖ = 1.2056e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 38, time 539.85 s: f = -0.661283904430, ‖∇f‖ = 6.5960e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 39, time 540.02 s: f = -0.661292307599, ‖∇f‖ = 4.6473e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 40, time 540.23 s: f = -0.661305251122, ‖∇f‖ = 5.5816e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 41, time 540.44 s: f = -0.661333861848, ‖∇f‖ = 1.0256e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 42, time 540.63 s: f = -0.661388067313, ‖∇f‖ = 1.3577e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 43, time 540.83 s: f = -0.661466697789, ‖∇f‖ = 2.6785e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 44, time 541.03 s: f = -0.661613249837, ‖∇f‖ = 1.8758e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 45, time 541.23 s: f = -0.661815950052, ‖∇f‖ = 3.1866e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 46, time 541.44 s: f = -0.661914266112, ‖∇f‖ = 2.3377e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 47, time 541.66 s: f = -0.661987630419, ‖∇f‖ = 2.6251e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 48, time 541.89 s: f = -0.662122898853, ‖∇f‖ = 4.1624e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 49, time 542.13 s: f = -0.662298584531, ‖∇f‖ = 1.1873e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 50, time 542.32 s: f = -0.662344209408, ‖∇f‖ = 8.9765e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 51, time 542.53 s: f = -0.662406985361, ‖∇f‖ = 9.1973e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 52, time 542.74 s: f = -0.662448422288, ‖∇f‖ = 1.4069e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 53, time 542.95 s: f = -0.662470844143, ‖∇f‖ = 1.1027e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 54, time 543.18 s: f = -0.662486913078, ‖∇f‖ = 3.8679e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 55, time 543.81 s: f = -0.662492606250, ‖∇f‖ = 2.6466e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 56, time 543.99 s: f = -0.662499228449, ‖∇f‖ = 2.5451e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 57, time 544.22 s: f = -0.662501449522, ‖∇f‖ = 6.7506e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 58, time 544.38 s: f = -0.662506093367, ‖∇f‖ = 2.2951e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 59, time 544.54 s: f = -0.662508017653, ‖∇f‖ = 1.3999e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 60, time 544.69 s: f = -0.662509746635, ‖∇f‖ = 1.4558e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 61, time 544.86 s: f = -0.662510852584, ‖∇f‖ = 2.9108e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 62, time 545.02 s: f = -0.662511459247, ‖∇f‖ = 2.2460e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 63, time 545.19 s: f = -0.662511826357, ‖∇f‖ = 7.7832e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 64, time 545.35 s: f = -0.662511947523, ‖∇f‖ = 6.8985e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 65, time 545.52 s: f = -0.662512259234, ‖∇f‖ = 9.7159e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 66, time 545.70 s: f = -0.662512598991, ‖∇f‖ = 9.8695e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 67, time 546.08 s: f = -0.662512857448, ‖∇f‖ = 1.7013e-03, α = 5.19e-01, m = 16, nfg = 2 -[ Info: LBFGS: iter 68, time 546.27 s: f = -0.662513219985, ‖∇f‖ = 6.8818e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 69, time 546.46 s: f = -0.662513359115, ‖∇f‖ = 7.6621e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 70, time 546.65 s: f = -0.662513515960, ‖∇f‖ = 6.8437e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 71, time 546.84 s: f = -0.662513618580, ‖∇f‖ = 1.1894e-03, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 72, time 547.02 s: f = -0.662513786456, ‖∇f‖ = 4.9346e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 73, time 547.18 s: f = -0.662513847396, ‖∇f‖ = 4.4509e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 74, time 547.34 s: f = -0.662513979836, ‖∇f‖ = 4.8820e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 75, time 547.51 s: f = -0.662514103588, ‖∇f‖ = 4.8320e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 76, time 547.69 s: f = -0.662514142873, ‖∇f‖ = 7.4691e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 77, time 547.90 s: f = -0.662514224367, ‖∇f‖ = 2.1563e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 78, time 548.10 s: f = -0.662514238736, ‖∇f‖ = 1.6048e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 79, time 548.30 s: f = -0.662514255026, ‖∇f‖ = 1.8486e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 80, time 548.51 s: f = -0.662514264792, ‖∇f‖ = 1.7897e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 81, time 548.70 s: f = -0.662514271376, ‖∇f‖ = 1.2336e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 82, time 548.87 s: f = -0.662514276574, ‖∇f‖ = 1.1665e-04, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: converged after 83 iterations and time 549.04 s: f = -0.662514280757, ‖∇f‖ = 9.1781e-05 +[ Info: LBFGS: iter 1, time 653.26 s: f = -0.489780489234, ‖∇f‖ = 6.0028e-01, α = 5.94e+01, m = 0, nfg = 5 +[ Info: LBFGS: iter 2, time 654.02 s: f = -0.501969351328, ‖∇f‖ = 5.3739e-01, α = 2.80e-01, m = 1, nfg = 2 +[ Info: LBFGS: iter 3, time 654.40 s: f = -0.523150649702, ‖∇f‖ = 3.9920e-01, α = 1.00e+00, m = 2, nfg = 1 +[ Info: LBFGS: iter 4, time 655.20 s: f = -0.538654553217, ‖∇f‖ = 4.1550e-01, α = 2.29e-01, m = 3, nfg = 2 +[ Info: LBFGS: iter 5, time 657.28 s: f = -0.549895529711, ‖∇f‖ = 4.4023e-01, α = 6.96e-02, m = 4, nfg = 4 +[ Info: LBFGS: iter 6, time 658.20 s: f = -0.568903885964, ‖∇f‖ = 4.8252e-01, α = 2.23e-01, m = 5, nfg = 2 +[ Info: LBFGS: iter 7, time 658.58 s: f = -0.586868365051, ‖∇f‖ = 4.2836e-01, α = 1.00e+00, m = 6, nfg = 1 +[ Info: LBFGS: iter 8, time 658.96 s: f = -0.599839175727, ‖∇f‖ = 2.2069e-01, α = 1.00e+00, m = 7, nfg = 1 +[ Info: LBFGS: iter 9, time 659.33 s: f = -0.606610941341, ‖∇f‖ = 1.9251e-01, α = 1.00e+00, m = 8, nfg = 1 +[ Info: LBFGS: iter 10, time 659.69 s: f = -0.624864467621, ‖∇f‖ = 2.9516e-01, α = 1.00e+00, m = 9, nfg = 1 +[ Info: LBFGS: iter 11, time 660.04 s: f = -0.638376467572, ‖∇f‖ = 2.3674e-01, α = 1.00e+00, m = 10, nfg = 1 +[ Info: LBFGS: iter 12, time 660.39 s: f = -0.644410588164, ‖∇f‖ = 3.2330e-01, α = 1.00e+00, m = 11, nfg = 1 +[ Info: LBFGS: iter 13, time 660.71 s: f = -0.651444381192, ‖∇f‖ = 1.3176e-01, α = 1.00e+00, m = 12, nfg = 1 +[ Info: LBFGS: iter 14, time 661.05 s: f = -0.654528265227, ‖∇f‖ = 6.6190e-02, α = 1.00e+00, m = 13, nfg = 1 +[ Info: LBFGS: iter 15, time 661.39 s: f = -0.655971175652, ‖∇f‖ = 5.1869e-02, α = 1.00e+00, m = 14, nfg = 1 +[ Info: LBFGS: iter 16, time 661.72 s: f = -0.657229077727, ‖∇f‖ = 5.8976e-02, α = 1.00e+00, m = 15, nfg = 1 +[ Info: LBFGS: iter 17, time 662.06 s: f = -0.658532053807, ‖∇f‖ = 5.5534e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 18, time 662.40 s: f = -0.659295183671, ‖∇f‖ = 3.0535e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 19, time 662.73 s: f = -0.659542164961, ‖∇f‖ = 2.2302e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 20, time 663.05 s: f = -0.659738061987, ‖∇f‖ = 2.7531e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 21, time 663.38 s: f = -0.659907342873, ‖∇f‖ = 1.9373e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 22, time 663.73 s: f = -0.660097470227, ‖∇f‖ = 1.4408e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 23, time 664.05 s: f = -0.660262757053, ‖∇f‖ = 1.2375e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 24, time 664.39 s: f = -0.660393125905, ‖∇f‖ = 1.9300e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 25, time 664.72 s: f = -0.660497546366, ‖∇f‖ = 1.3215e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 26, time 665.04 s: f = -0.660574185878, ‖∇f‖ = 1.2473e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 27, time 665.39 s: f = -0.660741803152, ‖∇f‖ = 1.6340e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 28, time 665.75 s: f = -0.660903655648, ‖∇f‖ = 1.8796e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 29, time 666.10 s: f = -0.661017363978, ‖∇f‖ = 1.3066e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 30, time 666.45 s: f = -0.661073166057, ‖∇f‖ = 8.0202e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 31, time 666.80 s: f = -0.661117738290, ‖∇f‖ = 7.9517e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 32, time 667.99 s: f = -0.661172741238, ‖∇f‖ = 9.8830e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 33, time 668.32 s: f = -0.661193956739, ‖∇f‖ = 1.5397e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 34, time 668.72 s: f = -0.661227726765, ‖∇f‖ = 5.4743e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 35, time 669.07 s: f = -0.661241731905, ‖∇f‖ = 4.7251e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 36, time 669.42 s: f = -0.661255581390, ‖∇f‖ = 5.4063e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 37, time 669.74 s: f = -0.661264752007, ‖∇f‖ = 1.3807e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 38, time 670.08 s: f = -0.661283616258, ‖∇f‖ = 5.9652e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 39, time 670.40 s: f = -0.661291824999, ‖∇f‖ = 4.3576e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 40, time 670.74 s: f = -0.661304230051, ‖∇f‖ = 6.0191e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 41, time 671.08 s: f = -0.661331508375, ‖∇f‖ = 1.1163e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 42, time 671.43 s: f = -0.661376470938, ‖∇f‖ = 1.2657e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 43, time 671.79 s: f = -0.661468673389, ‖∇f‖ = 2.1031e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 44, time 672.15 s: f = -0.661514982560, ‖∇f‖ = 3.2277e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 45, time 672.52 s: f = -0.661747546318, ‖∇f‖ = 2.1689e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 46, time 672.87 s: f = -0.661905953148, ‖∇f‖ = 1.6677e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 47, time 673.23 s: f = -0.662062528550, ‖∇f‖ = 1.6193e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 48, time 673.58 s: f = -0.662213957905, ‖∇f‖ = 2.0197e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 49, time 673.95 s: f = -0.662326044624, ‖∇f‖ = 1.8366e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 50, time 674.32 s: f = -0.662393005733, ‖∇f‖ = 1.1551e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 51, time 674.68 s: f = -0.662429954725, ‖∇f‖ = 1.0083e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 52, time 675.04 s: f = -0.662449363090, ‖∇f‖ = 1.3903e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 53, time 675.40 s: f = -0.662477942405, ‖∇f‖ = 6.7608e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 54, time 675.76 s: f = -0.662486360536, ‖∇f‖ = 3.8704e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 55, time 676.11 s: f = -0.662492546495, ‖∇f‖ = 3.5233e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 56, time 676.45 s: f = -0.662497882956, ‖∇f‖ = 6.1259e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 57, time 676.81 s: f = -0.662502369825, ‖∇f‖ = 2.9147e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 58, time 677.17 s: f = -0.662504348191, ‖∇f‖ = 2.1731e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 59, time 677.52 s: f = -0.662507141108, ‖∇f‖ = 1.8340e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 60, time 677.87 s: f = -0.662508298294, ‖∇f‖ = 4.6222e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 61, time 678.24 s: f = -0.662510158234, ‖∇f‖ = 1.5689e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 62, time 678.57 s: f = -0.662510768904, ‖∇f‖ = 9.6230e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 63, time 678.93 s: f = -0.662511246489, ‖∇f‖ = 8.8002e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 64, time 679.26 s: f = -0.662511761487, ‖∇f‖ = 1.6668e-03, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 65, time 679.59 s: f = -0.662512148273, ‖∇f‖ = 7.9766e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 66, time 679.92 s: f = -0.662512357751, ‖∇f‖ = 6.8594e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 67, time 680.26 s: f = -0.662512976280, ‖∇f‖ = 7.1623e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 68, time 680.93 s: f = -0.662513222472, ‖∇f‖ = 1.0991e-03, α = 4.99e-01, m = 16, nfg = 2 +[ Info: LBFGS: iter 69, time 681.26 s: f = -0.662513507229, ‖∇f‖ = 5.7699e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 70, time 681.60 s: f = -0.662513689584, ‖∇f‖ = 4.2137e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 71, time 681.94 s: f = -0.662513825899, ‖∇f‖ = 6.8079e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 72, time 682.27 s: f = -0.662513929736, ‖∇f‖ = 4.8212e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 73, time 682.60 s: f = -0.662514019314, ‖∇f‖ = 3.6338e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 74, time 682.94 s: f = -0.662514148429, ‖∇f‖ = 3.7588e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 75, time 683.59 s: f = -0.662514184144, ‖∇f‖ = 4.0858e-04, α = 3.36e-01, m = 16, nfg = 2 +[ Info: LBFGS: iter 76, time 683.94 s: f = -0.662514214340, ‖∇f‖ = 2.6812e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 77, time 684.27 s: f = -0.662514236095, ‖∇f‖ = 1.7703e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 78, time 684.60 s: f = -0.662514249499, ‖∇f‖ = 1.8355e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 79, time 684.92 s: f = -0.662514261393, ‖∇f‖ = 1.2213e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 80, time 685.25 s: f = -0.662514269951, ‖∇f‖ = 2.1828e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 81, time 685.59 s: f = -0.662514275813, ‖∇f‖ = 1.6011e-04, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: converged after 82 iterations and time 685.90 s: f = -0.662514279390, ‖∇f‖ = 9.7855e-05 ```` @@ -311,7 +310,7 @@ the convergence rate: ```` info_opt.fg_evaluations = 95 -info_opt.gradnorms[1:10:end] = [0.9354698847828358, 0.29515098058470357, 0.02758843397008457, 0.0080057855195194, 0.005581593433505604, 0.008976519236226013, 0.0014558090494201758, 0.0006843650270592786, 0.00017896547683177183] +info_opt.gradnorms[1:10:end] = [0.9354703925772283, 0.29515809534278165, 0.02753139081589741, 0.008020152153989112, 0.0060190768119257575, 0.011551265856046971, 0.004622157491340677, 0.00042136817837828673, 0.00021828441953116996] ```` @@ -324,7 +323,7 @@ $E_{\text{ref}}=−0.6694421$. From our simple optimization we find: ```` ```` -E = -0.6625142807571207 +E = -0.6625142793898271 ```` @@ -351,8 +350,8 @@ correlation lengths and transfer matrix spectra for all unit cell coordinates: ```` ```` -ξ_h = [1.0343595729516264] -ξ_v = [1.0242394972193403] +ξ_h = [1.0343546234867007] +ξ_v = [1.024223131377083] ```` @@ -397,7 +396,7 @@ Finally, to evaluate the expecation value on the `LocalOperator`, we call: ```` ```` -expectation_value(peps, M, env) = -0.7550757719796017 - 6.317220878853466e-16im +expectation_value(peps, M, env) = -0.755066246984657 - 1.0408340855860843e-16im ```` diff --git a/docs/src/examples/heisenberg/main.ipynb b/docs/src/examples/heisenberg/main.ipynb index aed828fb9..752f6c3b7 100644 --- a/docs/src/examples/heisenberg/main.ipynb +++ b/docs/src/examples/heisenberg/main.ipynb @@ -74,7 +74,7 @@ "outputs": [], "cell_type": "code", "source": [ - "H = heisenberg_XYZ(InfiniteSquare(); Jx=-1, Jy=1, Jz=-1)" + "H = heisenberg_XYZ(InfiniteSquare(); Jx = -1, Jy = 1, Jz = -1)" ], "metadata": {}, "execution_count": null @@ -120,7 +120,7 @@ "outputs": [], "cell_type": "code", "source": [ - "boundary_alg = (; tol=1e-10, trscheme=(; alg=:fixedspace));" + "boundary_alg = (; tol = 1.0e-10, trscheme = (; alg = :fixedspace));" ], "metadata": {}, "execution_count": null @@ -139,7 +139,7 @@ "outputs": [], "cell_type": "code", "source": [ - "optimizer_alg = (; alg=:lbfgs, tol=1e-4, maxiter=100, lbfgs_memory=16);" + "optimizer_alg = (; alg = :lbfgs, tol = 1.0e-4, maxiter = 100, lbfgs_memory = 16);" ], "metadata": {}, "execution_count": null diff --git a/docs/src/examples/heisenberg_su/index.md b/docs/src/examples/heisenberg_su/index.md index 460ec28e6..2455d7946 100644 --- a/docs/src/examples/heisenberg_su/index.md +++ b/docs/src/examples/heisenberg_su/index.md @@ -35,19 +35,20 @@ Random.seed!(0); To construct the Heisenberg Hamiltonian as just discussed, we'll use `heisenberg_XYZ` and, in addition, make it real (`real` and `imag` works for `LocalOperator`s) since we want to use PEPS and environments with real entries. We can either initialize the Hamiltonian with -no internal symmetries (`symm = Trivial`) or use the global $U(1)$ symmetry +no internal symmetries (`symm = Trivial`) or use the global spin $U(1)$ symmetry (`symm = U1Irrep`): ````julia symm = Trivial ## ∈ {Trivial, U1Irrep} Nr, Nc = 2, 2 -H = real(heisenberg_XYZ(ComplexF64, symm, InfiniteSquare(Nr, Nc); Jx=1, Jy=1, Jz=1)); +H = real(heisenberg_XYZ(ComplexF64, symm, InfiniteSquare(Nr, Nc); Jx = 1, Jy = 1, Jz = 1)); ```` ## Simple updating -We proceed by initializing a random weighted PEPS that will be evolved. First though, we -need to define the appropriate (symmetric) spaces: +We proceed by initializing a random PEPS that will be evolved. +The weights used for simple update are initialized as identity matrices. +First though, we need to define the appropriate (symmetric) spaces: ````julia Dbond = 4 @@ -57,14 +58,15 @@ if symm == Trivial bond_space = ℂ^Dbond env_space = ℂ^χenv elseif symm == U1Irrep - physical_space = ℂ[U1Irrep](1//2 => 1, -1//2 => 1) - bond_space = ℂ[U1Irrep](0 => Dbond ÷ 2, 1//2 => Dbond ÷ 4, -1//2 => Dbond ÷ 4) - env_space = ℂ[U1Irrep](0 => χenv ÷ 2, 1//2 => χenv ÷ 4, -1//2 => χenv ÷ 4) + physical_space = ℂ[U1Irrep](1 // 2 => 1, -1 // 2 => 1) + bond_space = ℂ[U1Irrep](0 => Dbond ÷ 2, 1 // 2 => Dbond ÷ 4, -1 // 2 => Dbond ÷ 4) + env_space = ℂ[U1Irrep](0 => χenv ÷ 2, 1 // 2 => χenv ÷ 4, -1 // 2 => χenv ÷ 4) else error("not implemented") end -wpeps = InfiniteWeightPEPS(rand, Float64, physical_space, bond_space; unitcell=(Nr, Nc)); +peps = InfinitePEPS(rand, Float64, physical_space, bond_space; unitcell = (Nr, Nc)); +wts = SUWeight(peps); ```` Next, we can start the `SimpleUpdate` routine, successively decreasing the time intervals @@ -73,49 +75,38 @@ truncation schemes, which we use here to set a maximal bond dimension and at the fix a truncation error (if that can be reached by remaining below `Dbond`): ````julia -dts = [1e-2, 1e-3, 4e-4] -tols = [1e-6, 1e-8, 1e-8] +dts = [1.0e-2, 1.0e-3, 4.0e-4] +tols = [1.0e-6, 1.0e-8, 1.0e-8] maxiter = 10000 -trscheme_peps = truncerr(1e-10) & truncdim(Dbond) +trscheme_peps = truncerr(1.0e-10) & truncdim(Dbond) for (dt, tol) in zip(dts, tols) alg = SimpleUpdate(dt, tol, maxiter, trscheme_peps) - result = simpleupdate(wpeps, H, alg; bipartite=true) - global wpeps = result[1] + global peps, wts, = simpleupdate(peps, H, alg, wts; bipartite = true) end ```` ```` [ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU iter 1 : dt = 1e-02, weight diff = 1.683e+00, time = 11.440 sec +[ Info: SU iter 1 : dt = 1e-02, weight diff = 1.731e+00, time = 16.560 sec [ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU iter 500 : dt = 1e-02, weight diff = 3.879e-06, time = 0.002 sec +[ Info: SU conv 323 : dt = 1e-02, weight diff = 9.986e-07, time = 21.354 sec [ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU conv 596 : dt = 1e-02, weight diff = 9.933e-07, time = 15.728 sec +[ Info: SU iter 1 : dt = 1e-03, weight diff = 2.187e-03, time = 0.004 sec [ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU iter 1 : dt = 1e-03, weight diff = 2.135e-03, time = 0.002 sec +[ Info: SU iter 500 : dt = 1e-03, weight diff = 2.420e-07, time = 0.004 sec [ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU iter 500 : dt = 1e-03, weight diff = 9.632e-07, time = 0.002 sec +[ Info: SU iter 1000 : dt = 1e-03, weight diff = 1.665e-08, time = 0.004 sec [ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU iter 1000 : dt = 1e-03, weight diff = 2.415e-07, time = 0.002 sec +[ Info: SU conv 1098 : dt = 1e-03, weight diff = 9.958e-09, time = 4.536 sec [ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU iter 1500 : dt = 1e-03, weight diff = 6.291e-08, time = 0.002 sec +[ Info: SU iter 1 : dt = 4e-04, weight diff = 1.442e-04, time = 0.004 sec [ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU iter 2000 : dt = 1e-03, weight diff = 1.683e-08, time = 0.002 sec +[ Info: SU iter 500 : dt = 4e-04, weight diff = 3.551e-08, time = 0.004 sec [ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU conv 2205 : dt = 1e-03, weight diff = 9.978e-09, time = 4.523 sec +[ Info: SU iter 1000 : dt = 4e-04, weight diff = 1.159e-08, time = 0.004 sec [ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU iter 1 : dt = 4e-04, weight diff = 1.418e-04, time = 0.002 sec -[ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU iter 500 : dt = 4e-04, weight diff = 6.377e-08, time = 0.002 sec -[ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU iter 1000 : dt = 4e-04, weight diff = 3.544e-08, time = 0.002 sec -[ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU iter 1500 : dt = 4e-04, weight diff = 2.013e-08, time = 0.002 sec -[ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU iter 2000 : dt = 4e-04, weight diff = 1.157e-08, time = 0.002 sec -[ Info: Space of x-weight at [1, 1] = ℂ^4 -[ Info: SU conv 2133 : dt = 4e-04, weight diff = 9.999e-09, time = 4.370 sec +[ Info: SU conv 1068 : dt = 4e-04, weight diff = 9.987e-09, time = 4.404 sec ```` @@ -125,22 +116,22 @@ In order to compute observable expectation values, we need to converge a CTMRG e on the evolved PEPS. Let's do so: ````julia -peps = InfinitePEPS(wpeps) ## absorb the weights +normalize!.(peps.A, Inf) env₀ = CTMRGEnv(rand, Float64, peps, env_space) -trscheme_env = truncerr(1e-10) & truncdim(χenv) +trscheme_env = truncerr(1.0e-10) & truncdim(χenv) env, = leading_boundary( env₀, peps; - alg=:sequential, - projector_alg=:fullinfinite, - tol=1e-10, - trscheme=trscheme_env, + alg = :sequential, + projector_alg = :fullinfinite, + tol = 1.0e-10, + trscheme = trscheme_env, ); ```` ```` -[ Info: CTMRG init: obj = +8.705922473439e-05 err = 1.0000e+00 -[ Info: CTMRG conv 15: obj = +9.514115680898e-01 err = 3.3233542719e-11 time = 12.38 sec +[ Info: CTMRG init: obj = +1.188518474239e-04 err = 1.0000e+00 +[ Info: CTMRG conv 14: obj = +1.298574138984e+00 err = 8.6101675686e-11 time = 5.39 sec ```` @@ -174,9 +165,9 @@ M_norms = map( ```` ```` -E = -0.6674685583160885 -Ms = [0.031996449512473865 -0.029802620495641228; -0.029802620502662372 0.03199644954619269;;; 2.2900437051231523e-12 -1.0535461351073279e-12; -2.117937037209822e-12 8.849733787661354e-13;;; 0.3755961090665973 -0.3757765476186222; -0.3757765476169785 0.3755961090665911] -M_norms = [0.3769565093314765 0.3769565093330766; 0.3769565093319931 0.3769565093343324] +E = -0.6674725905835921 +Ms = [0.028455537297763654 -0.026889489648298712; -0.026889489681467996 0.028455537252025265;;; 1.060553381226903e-11 -4.813673765147186e-12; -9.758601912657205e-12 3.9884293784320235e-12;;; 0.37587672522461946 -0.3759920019289313; -0.3759920019256273 0.3758767252290504] +M_norms = [0.37695229163448324 0.37695229163393; 0.3769522916330006 0.37695229163544886] ```` @@ -190,13 +181,13 @@ well as finite bond dimension effects and a lacking extrapolation: ````julia E_ref = -0.6675 M_ref = 0.3767 -@show (E - E_ref) / E_ref -@show (mean(M_norms) - M_ref) / E_ref; +@show (E - E_ref) / abs(E_ref) +@show (mean(M_norms) - M_ref) / M_ref; ```` ```` -(E - E_ref) / E_ref = -4.710364630928602e-5 -(mean(M_norms) - M_ref) / E_ref = -0.00038428364452381346 +(E - E_ref) / abs(E_ref) = 4.106279611668376e-5 +(mean(M_norms) - M_ref) / M_ref = 0.0006697415296408165 ```` diff --git a/docs/src/examples/heisenberg_su/main.ipynb b/docs/src/examples/heisenberg_su/main.ipynb index 83f3b6ccd..7a8b31201 100644 --- a/docs/src/examples/heisenberg_su/main.ipynb +++ b/docs/src/examples/heisenberg_su/main.ipynb @@ -50,7 +50,7 @@ "To construct the Heisenberg Hamiltonian as just discussed, we'll use `heisenberg_XYZ` and,\n", "in addition, make it real (`real` and `imag` works for `LocalOperator`s) since we want to\n", "use PEPS and environments with real entries. We can either initialize the Hamiltonian with\n", - "no internal symmetries (`symm = Trivial`) or use the global $U(1)$ symmetry\n", + "no internal symmetries (`symm = Trivial`) or use the global spin $U(1)$ symmetry\n", "(`symm = U1Irrep`):" ], "metadata": {} @@ -61,7 +61,7 @@ "source": [ "symm = Trivial ## ∈ {Trivial, U1Irrep}\n", "Nr, Nc = 2, 2\n", - "H = real(heisenberg_XYZ(ComplexF64, symm, InfiniteSquare(Nr, Nc); Jx=1, Jy=1, Jz=1));" + "H = real(heisenberg_XYZ(ComplexF64, symm, InfiniteSquare(Nr, Nc); Jx = 1, Jy = 1, Jz = 1));" ], "metadata": {}, "execution_count": null @@ -71,8 +71,9 @@ "source": [ "## Simple updating\n", "\n", - "We proceed by initializing a random weighted PEPS that will be evolved. First though, we\n", - "need to define the appropriate (symmetric) spaces:" + "We proceed by initializing a random PEPS that will be evolved.\n", + "The weights used for simple update are initialized as identity matrices.\n", + "First though, we need to define the appropriate (symmetric) spaces:" ], "metadata": {} }, @@ -87,14 +88,15 @@ " bond_space = ℂ^Dbond\n", " env_space = ℂ^χenv\n", "elseif symm == U1Irrep\n", - " physical_space = ℂ[U1Irrep](1//2 => 1, -1//2 => 1)\n", - " bond_space = ℂ[U1Irrep](0 => Dbond ÷ 2, 1//2 => Dbond ÷ 4, -1//2 => Dbond ÷ 4)\n", - " env_space = ℂ[U1Irrep](0 => χenv ÷ 2, 1//2 => χenv ÷ 4, -1//2 => χenv ÷ 4)\n", + " physical_space = ℂ[U1Irrep](1 // 2 => 1, -1 // 2 => 1)\n", + " bond_space = ℂ[U1Irrep](0 => Dbond ÷ 2, 1 // 2 => Dbond ÷ 4, -1 // 2 => Dbond ÷ 4)\n", + " env_space = ℂ[U1Irrep](0 => χenv ÷ 2, 1 // 2 => χenv ÷ 4, -1 // 2 => χenv ÷ 4)\n", "else\n", " error(\"not implemented\")\n", "end\n", "\n", - "wpeps = InfiniteWeightPEPS(rand, Float64, physical_space, bond_space; unitcell=(Nr, Nc));" + "peps = InfinitePEPS(rand, Float64, physical_space, bond_space; unitcell = (Nr, Nc));\n", + "wts = SUWeight(peps);" ], "metadata": {}, "execution_count": null @@ -113,15 +115,14 @@ "outputs": [], "cell_type": "code", "source": [ - "dts = [1e-2, 1e-3, 4e-4]\n", - "tols = [1e-6, 1e-8, 1e-8]\n", + "dts = [1.0e-2, 1.0e-3, 4.0e-4]\n", + "tols = [1.0e-6, 1.0e-8, 1.0e-8]\n", "maxiter = 10000\n", - "trscheme_peps = truncerr(1e-10) & truncdim(Dbond)\n", + "trscheme_peps = truncerr(1.0e-10) & truncdim(Dbond)\n", "\n", "for (dt, tol) in zip(dts, tols)\n", " alg = SimpleUpdate(dt, tol, maxiter, trscheme_peps)\n", - " result = simpleupdate(wpeps, H, alg; bipartite=true)\n", - " global wpeps = result[1]\n", + " global peps, wts, = simpleupdate(peps, H, alg, wts; bipartite = true)\n", "end" ], "metadata": {}, @@ -141,16 +142,16 @@ "outputs": [], "cell_type": "code", "source": [ - "peps = InfinitePEPS(wpeps) ## absorb the weights\n", + "normalize!.(peps.A, Inf)\n", "env₀ = CTMRGEnv(rand, Float64, peps, env_space)\n", - "trscheme_env = truncerr(1e-10) & truncdim(χenv)\n", + "trscheme_env = truncerr(1.0e-10) & truncdim(χenv)\n", "env, = leading_boundary(\n", " env₀,\n", " peps;\n", - " alg=:sequential,\n", - " projector_alg=:fullinfinite,\n", - " tol=1e-10,\n", - " trscheme=trscheme_env,\n", + " alg = :sequential,\n", + " projector_alg = :fullinfinite,\n", + " tol = 1.0e-10,\n", + " trscheme = trscheme_env,\n", ");" ], "metadata": {}, @@ -213,8 +214,8 @@ "source": [ "E_ref = -0.6675\n", "M_ref = 0.3767\n", - "@show (E - E_ref) / E_ref\n", - "@show (mean(M_norms) - M_ref) / E_ref;" + "@show (E - E_ref) / abs(E_ref)\n", + "@show (mean(M_norms) - M_ref) / M_ref;" ], "metadata": {}, "execution_count": null diff --git a/docs/src/examples/hubbard_su/index.md b/docs/src/examples/hubbard_su/index.md index dbece23cc..02139785c 100644 --- a/docs/src/examples/hubbard_su/index.md +++ b/docs/src/examples/hubbard_su/index.md @@ -38,111 +38,78 @@ constructed on a $2 \times 2$ unit cell, so we have: t = 1 U = 6 Nr, Nc = 2, 2 -H = hubbard_model(Float64, Trivial, Trivial, InfiniteSquare(Nr, Nc); t, U, mu=U / 2); +H = hubbard_model(Float64, Trivial, Trivial, InfiniteSquare(Nr, Nc); t, U, mu = U / 2); +physical_space = Vect[fℤ₂](0 => 2, 1 => 2); ```` ## Running the simple update algorithm -Next, we'll specify the virtual PEPS bond dimension and define the fermionic physical and -virtual spaces. The simple update algorithm evolves an infinite PEPS with weights on the -virtual bonds, so we here need to intialize an [`InfiniteWeightPEPS`](@ref). By default, -the bond weights will be identity. Unlike in the other examples, we here use tensors with -real `Float64` entries: +Suppose the goal is to use imaginary-time simple update to optimize a PEPS +with bond dimension D = 8, and $2 \times 2$ unit cells. +For a challenging model like the Hubbard model, a naive evolution starting from a +random PEPS at D = 8 will almost always produce a sub-optimal state. +In this example, we shall demonstrate some common practices to improve SU result. + +First, we shall use a small D for the random PEPS initialization, which is chosen as 4 here. +For convenience, here we work with real tensors with `Float64` entries. +The bond weights are still initialized as identity matrices. ````julia -Dbond = 8 -physical_space = Vect[fℤ₂](0 => 2, 1 => 2) -virtual_space = Vect[fℤ₂](0 => Dbond / 2, 1 => Dbond / 2) -wpeps = InfiniteWeightPEPS(rand, Float64, physical_space, virtual_space; unitcell=(Nr, Nc)); +virtual_space = Vect[fℤ₂](0 => 2, 1 => 2) +peps = InfinitePEPS(rand, Float64, physical_space, virtual_space; unitcell = (Nr, Nc)); +wts = SUWeight(peps); ```` -Let's set the algorithm parameters: The plan is to successively decrease the time interval of -the Trotter-Suzuki as well as the convergence tolerance such that we obtain a more accurate -result at each iteration. To run the simple update, we call [`simpleupdate`](@ref) where we -use the keyword `bipartite=false` - meaning that we use the full $2 \times 2$ unit cell -without assuming a bipartite structure. Thus, we can start evolving: +Starting from the random state, we first use a relatively large evolution time step +`dt = 1e-2`. After convergence at D = 4, to avoid stucking at some bad local minimum, +we first increase D to 12, and drop it back to D = 8 after a while. +Afterwards, we keep D = 8 and gradually decrease `dt` to `1e-4` to improve convergence. ````julia -dts = [1e-2, 1e-3, 4e-4, 1e-4] -tols = [1e-6, 1e-8, 1e-8, 1e-8] +dts = [1.0e-2, 1.0e-2, 1.0e-3, 4.0e-4, 1.0e-4] +tols = [1.0e-7, 1.0e-7, 1.0e-8, 1.0e-8, 1.0e-8] +Ds = [4, 12, 8, 8, 8] maxiter = 20000 -for (n, (dt, tol)) in enumerate(zip(dts, tols)) - trscheme = truncerr(1e-10) & truncdim(Dbond) +for (dt, tol, Dbond) in zip(dts, tols, Ds) + trscheme = truncerr(1.0e-10) & truncdim(Dbond) alg = SimpleUpdate(dt, tol, maxiter, trscheme) - global wpeps, = simpleupdate(wpeps, H, alg; bipartite=false) + global peps, wts, = simpleupdate( + peps, H, alg, wts; bipartite = false, check_interval = 2000 + ) end ```` ```` -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 1 : dt = 1e-02, weight diff = 2.355e+00, time = 22.185 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 500 : dt = 1e-02, weight diff = 3.984e-04, time = 0.015 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 1000 : dt = 1e-02, weight diff = 2.866e-06, time = 0.014 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU conv 1061 : dt = 1e-02, weight diff = 9.956e-07, time = 41.388 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 1 : dt = 1e-03, weight diff = 6.070e-03, time = 0.014 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 500 : dt = 1e-03, weight diff = 1.874e-06, time = 0.024 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 1000 : dt = 1e-03, weight diff = 6.437e-07, time = 0.021 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 1500 : dt = 1e-03, weight diff = 2.591e-07, time = 0.014 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 2000 : dt = 1e-03, weight diff = 1.053e-07, time = 0.014 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 2500 : dt = 1e-03, weight diff = 4.280e-08, time = 0.014 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 3000 : dt = 1e-03, weight diff = 1.741e-08, time = 0.021 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU conv 3309 : dt = 1e-03, weight diff = 9.983e-09, time = 58.103 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 1 : dt = 4e-04, weight diff = 4.030e-04, time = 0.014 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 500 : dt = 4e-04, weight diff = 1.776e-07, time = 0.016 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 1000 : dt = 4e-04, weight diff = 7.091e-08, time = 0.016 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 1500 : dt = 4e-04, weight diff = 3.997e-08, time = 0.021 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 2000 : dt = 4e-04, weight diff = 2.622e-08, time = 0.016 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 2500 : dt = 4e-04, weight diff = 1.796e-08, time = 0.021 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 3000 : dt = 4e-04, weight diff = 1.245e-08, time = 0.014 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU conv 3303 : dt = 4e-04, weight diff = 9.997e-09, time = 57.388 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 1 : dt = 1e-04, weight diff = 2.014e-04, time = 0.014 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 500 : dt = 1e-04, weight diff = 5.664e-08, time = 0.016 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 1000 : dt = 1e-04, weight diff = 4.106e-08, time = 0.014 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 1500 : dt = 1e-04, weight diff = 3.033e-08, time = 0.021 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 2000 : dt = 1e-04, weight diff = 2.290e-08, time = 0.021 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 2500 : dt = 1e-04, weight diff = 1.773e-08, time = 0.014 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 3000 : dt = 1e-04, weight diff = 1.410e-08, time = 0.015 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU iter 3500 : dt = 1e-04, weight diff = 1.152e-08, time = 0.023 sec -[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>4, 1=>4) -[ Info: SU conv 3893 : dt = 1e-04, weight diff = 9.997e-09, time = 69.269 sec +[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>2, 1=>2) +[ Info: SU iter 1 : dt = 1e-02, weight diff = 1.316e+00, time = 27.486 sec +[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>2, 1=>2) +[ Info: SU conv 1045 : dt = 1e-02, weight diff = 9.843e-08, time = 34.956 sec +[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>6, 1=>6) +[ Info: SU iter 1 : dt = 1e-02, weight diff = 6.459e-06, time = 0.077 sec +[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>6, 1=>6) +[ Info: SU conv 584 : dt = 1e-02, weight diff = 9.946e-08, time = 42.322 sec +[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>3, 1=>5) +[ Info: SU iter 1 : dt = 1e-03, weight diff = 5.245e-03, time = 0.235 sec +[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>3, 1=>5) +[ Info: SU iter 2000 : dt = 1e-03, weight diff = 1.418e-07, time = 0.018 sec +[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>3, 1=>5) +[ Info: SU conv 3791 : dt = 1e-03, weight diff = 9.990e-09, time = 78.783 sec +[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>3, 1=>5) +[ Info: SU iter 1 : dt = 4e-04, weight diff = 3.256e-04, time = 0.018 sec +[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>3, 1=>5) +[ Info: SU iter 2000 : dt = 4e-04, weight diff = 1.888e-08, time = 0.024 sec +[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>3, 1=>5) +[ Info: SU conv 3034 : dt = 4e-04, weight diff = 9.997e-09, time = 62.113 sec +[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>3, 1=>5) +[ Info: SU iter 1 : dt = 1e-04, weight diff = 1.627e-04, time = 0.024 sec +[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>3, 1=>5) +[ Info: SU iter 2000 : dt = 1e-04, weight diff = 1.532e-08, time = 0.018 sec +[ Info: Space of x-weight at [1, 1] = Vect[FermionParity](0=>3, 1=>5) +[ Info: SU conv 2916 : dt = 1e-04, weight diff = 9.997e-09, time = 59.560 sec ```` -To obtain the evolved `InfiniteWeightPEPS` as an actual PEPS without weights on the bonds, -we can just call the following constructor: - -````julia -peps = InfinitePEPS(wpeps); -```` - ## Computing the ground-state energy In order to compute the energy expectation value with evolved PEPS, we need to converge a @@ -154,21 +121,21 @@ run: ````julia χenv₀, χenv = 6, 16 env_space = Vect[fℤ₂](0 => χenv₀ / 2, 1 => χenv₀ / 2) - +normalize!.(peps.A, Inf) env = CTMRGEnv(rand, Float64, peps, env_space) for χ in [χenv₀, χenv] global env, = leading_boundary( - env, peps; alg=:sequential, tol=1e-5, trscheme=truncdim(χ) + env, peps; alg = :sequential, tol = 1.0e-8, maxiter = 50, trscheme = truncdim(χ) ) end ```` ```` -[ Info: CTMRG init: obj = -1.542952315399e-10 err = 1.0000e+00 -┌ Warning: CTMRG cancel 100: obj = +6.651673256987e-01 err = 4.3704037477e-01 time = 34.96 sec -└ @ PEPSKit ~/repos/PEPSKit.jl/src/algorithms/ctmrg/ctmrg.jl:155 -[ Info: CTMRG init: obj = +6.651673256987e-01 err = 1.0000e+00 -[ Info: CTMRG conv 38: obj = +5.888235917397e-01 err = 5.1440892086e-06 time = 1.54 min +[ Info: CTMRG init: obj = +4.034556135739e-13 err = 1.0000e+00 +┌ Warning: CTMRG cancel 50: obj = +1.777694990783e+00 err = 2.1447151954e-06 time = 18.75 sec +└ @ PEPSKit ~/PEPSKit.jl/src/algorithms/ctmrg/ctmrg.jl:152 +[ Info: CTMRG init: obj = +1.777694990783e+00 err = 1.0000e+00 +[ Info: CTMRG conv 7: obj = +1.781063096355e+00 err = 3.5793745596e-10 time = 21.32 sec ```` @@ -181,7 +148,7 @@ E = expectation_value(peps, H, env) / (Nr * Nc) ```` ```` -E = -3.6333025742768026 +E = -3.652497562261351 ```` @@ -192,11 +159,11 @@ agree: ````julia Es_exact = Dict(0 => -1.62, 2 => -0.176, 4 => 0.8603, 6 => -0.6567, 8 => -0.5243) E_exact = Es_exact[U] - U / 2 -@show (E - E_exact) / E_exact; +@show (E - E_exact) / abs(E_exact); ```` ```` -(E - E_exact) / E_exact = -0.006398508415565196 +(E - E_exact) / abs(E_exact) = 0.001149243235334783 ```` diff --git a/docs/src/examples/hubbard_su/main.ipynb b/docs/src/examples/hubbard_su/main.ipynb index 67fb5b699..1b52b0d56 100644 --- a/docs/src/examples/hubbard_su/main.ipynb +++ b/docs/src/examples/hubbard_su/main.ipynb @@ -58,7 +58,8 @@ "t = 1\n", "U = 6\n", "Nr, Nc = 2, 2\n", - "H = hubbard_model(Float64, Trivial, Trivial, InfiniteSquare(Nr, Nc); t, U, mu=U / 2);" + "H = hubbard_model(Float64, Trivial, Trivial, InfiniteSquare(Nr, Nc); t, U, mu = U / 2);\n", + "physical_space = Vect[fℤ₂](0 => 2, 1 => 2);" ], "metadata": {}, "execution_count": null @@ -68,11 +69,15 @@ "source": [ "## Running the simple update algorithm\n", "\n", - "Next, we'll specify the virtual PEPS bond dimension and define the fermionic physical and\n", - "virtual spaces. The simple update algorithm evolves an infinite PEPS with weights on the\n", - "virtual bonds, so we here need to intialize an `InfiniteWeightPEPS`. By default,\n", - "the bond weights will be identity. Unlike in the other examples, we here use tensors with\n", - "real `Float64` entries:" + "Suppose the goal is to use imaginary-time simple update to optimize a PEPS\n", + "with bond dimension D = 8, and $2 \\times 2$ unit cells.\n", + "For a challenging model like the Hubbard model, a naive evolution starting from a\n", + "random PEPS at D = 8 will almost always produce a sub-optimal state.\n", + "In this example, we shall demonstrate some common practices to improve SU result.\n", + "\n", + "First, we shall use a small D for the random PEPS initialization, which is chosen as 4 here.\n", + "For convenience, here we work with real tensors with `Float64` entries.\n", + "The bond weights are still initialized as identity matrices." ], "metadata": {} }, @@ -80,10 +85,9 @@ "outputs": [], "cell_type": "code", "source": [ - "Dbond = 8\n", - "physical_space = Vect[fℤ₂](0 => 2, 1 => 2)\n", - "virtual_space = Vect[fℤ₂](0 => Dbond / 2, 1 => Dbond / 2)\n", - "wpeps = InfiniteWeightPEPS(rand, Float64, physical_space, virtual_space; unitcell=(Nr, Nc));" + "virtual_space = Vect[fℤ₂](0 => 2, 1 => 2)\n", + "peps = InfinitePEPS(rand, Float64, physical_space, virtual_space; unitcell = (Nr, Nc));\n", + "wts = SUWeight(peps);" ], "metadata": {}, "execution_count": null @@ -91,11 +95,10 @@ { "cell_type": "markdown", "source": [ - "Let's set the algorithm parameters: The plan is to successively decrease the time interval of\n", - "the Trotter-Suzuki as well as the convergence tolerance such that we obtain a more accurate\n", - "result at each iteration. To run the simple update, we call `simpleupdate` where we\n", - "use the keyword `bipartite=false` - meaning that we use the full $2 \\times 2$ unit cell\n", - "without assuming a bipartite structure. Thus, we can start evolving:" + "Starting from the random state, we first use a relatively large evolution time step\n", + "`dt = 1e-2`. After convergence at D = 4, to avoid stucking at some bad local minimum,\n", + "we first increase D to 12, and drop it back to D = 8 after a while.\n", + "Afterwards, we keep D = 8 and gradually decrease `dt` to `1e-4` to improve convergence." ], "metadata": {} }, @@ -103,36 +106,22 @@ "outputs": [], "cell_type": "code", "source": [ - "dts = [1e-2, 1e-3, 4e-4, 1e-4]\n", - "tols = [1e-6, 1e-8, 1e-8, 1e-8]\n", + "dts = [1.0e-2, 1.0e-2, 1.0e-3, 4.0e-4, 1.0e-4]\n", + "tols = [1.0e-7, 1.0e-7, 1.0e-8, 1.0e-8, 1.0e-8]\n", + "Ds = [4, 12, 8, 8, 8]\n", "maxiter = 20000\n", "\n", - "for (n, (dt, tol)) in enumerate(zip(dts, tols))\n", - " trscheme = truncerr(1e-10) & truncdim(Dbond)\n", + "for (dt, tol, Dbond) in zip(dts, tols, Ds)\n", + " trscheme = truncerr(1.0e-10) & truncdim(Dbond)\n", " alg = SimpleUpdate(dt, tol, maxiter, trscheme)\n", - " global wpeps, = simpleupdate(wpeps, H, alg; bipartite=false)\n", + " global peps, wts, = simpleupdate(\n", + " peps, H, alg, wts; bipartite = false, check_interval = 2000\n", + " )\n", "end" ], "metadata": {}, "execution_count": null }, - { - "cell_type": "markdown", - "source": [ - "To obtain the evolved `InfiniteWeightPEPS` as an actual PEPS without weights on the bonds,\n", - "we can just call the following constructor:" - ], - "metadata": {} - }, - { - "outputs": [], - "cell_type": "code", - "source": [ - "peps = InfinitePEPS(wpeps);" - ], - "metadata": {}, - "execution_count": null - }, { "cell_type": "markdown", "source": [ @@ -152,11 +141,11 @@ "source": [ "χenv₀, χenv = 6, 16\n", "env_space = Vect[fℤ₂](0 => χenv₀ / 2, 1 => χenv₀ / 2)\n", - "\n", + "normalize!.(peps.A, Inf)\n", "env = CTMRGEnv(rand, Float64, peps, env_space)\n", "for χ in [χenv₀, χenv]\n", " global env, = leading_boundary(\n", - " env, peps; alg=:sequential, tol=1e-5, trscheme=truncdim(χ)\n", + " env, peps; alg = :sequential, tol = 1.0e-8, maxiter = 50, trscheme = truncdim(χ)\n", " )\n", "end" ], @@ -196,7 +185,7 @@ "source": [ "Es_exact = Dict(0 => -1.62, 2 => -0.176, 4 => 0.8603, 6 => -0.6567, 8 => -0.5243)\n", "E_exact = Es_exact[U] - U / 2\n", - "@show (E - E_exact) / E_exact;" + "@show (E - E_exact) / abs(E_exact);" ], "metadata": {}, "execution_count": null diff --git a/docs/src/examples/j1j2_su/index.md b/docs/src/examples/j1j2_su/index.md index 23fa068d2..b268c7b2b 100644 --- a/docs/src/examples/j1j2_su/index.md +++ b/docs/src/examples/j1j2_su/index.md @@ -32,21 +32,21 @@ Random.seed!(29385293); ## Simple updating a challenging phase -Let's start by initializing an `InfiniteWeightPEPS` for which we set the required parameters -as well as physical and virtual vector spaces. We use the minimal unit cell size -($2 \times 2$) required by the simple update algorithm for Hamiltonians with -next-nearest-neighbour interactions: +Let's start by initializing an `InfinitePEPS` for which we set the required parameters +as well as physical and virtual vector spaces. +The `SUWeight` used by simple update will be initialized to identity matrices. +We use the minimal unit cell size ($2 \times 2$) required by the simple update algorithm +for Hamiltonians with next-nearest-neighbour interactions: ````julia -Dbond, χenv, symm = 4, 32, U1Irrep -trscheme_env = truncerr(1e-10) & truncdim(χenv) +Dbond, symm = 4, U1Irrep Nr, Nc, J1 = 2, 2, 1.0 -# random initialization of 2x2 iPEPS with weights and CTMRGEnv (using real numbers) -Pspace = Vect[U1Irrep](1//2 => 1, -1//2 => 1) -Vspace = Vect[U1Irrep](0 => 2, 1//2 => 1, -1//2 => 1) -Espace = Vect[U1Irrep](0 => χenv ÷ 2, 1//2 => χenv ÷ 4, -1//2 => χenv ÷ 4) -wpeps = InfiniteWeightPEPS(rand, Float64, Pspace, Vspace; unitcell=(Nr, Nc)); +# random initialization of 2x2 iPEPS (using real numbers) and SUWeight +Pspace = Vect[U1Irrep](1 // 2 => 1, -1 // 2 => 1) +Vspace = Vect[U1Irrep](0 => 2, 1 // 2 => 1, -1 // 2 => 1) +peps = InfinitePEPS(rand, Float64, Pspace, Vspace; unitcell = (Nr, Nc)); +wts = SUWeight(peps); ```` The value $J_2 / J_1 = 0.5$ corresponds to a [possible spin liquid phase](@cite liu_gapless_2022), @@ -55,40 +55,39 @@ Therefore, we shall gradually increase $J_2 / J_1$ from 0.1 to 0.5, each time in on the previously evolved PEPS: ````julia -dt, tol, maxiter = 1e-2, 1e-8, 30000 +dt, tol, maxiter = 1.0e-2, 1.0e-8, 30000 check_interval = 4000 -trscheme_peps = truncerr(1e-10) & truncdim(Dbond) +trscheme_peps = truncerr(1.0e-10) & truncdim(Dbond) alg = SimpleUpdate(dt, tol, maxiter, trscheme_peps) for J2 in 0.1:0.1:0.5 H = real( ## convert Hamiltonian `LocalOperator` to real floats - j1_j2_model(ComplexF64, symm, InfiniteSquare(Nr, Nc); J1, J2, sublattice=false), + j1_j2_model(ComplexF64, symm, InfiniteSquare(Nr, Nc); J1, J2, sublattice = false), ) - result = simpleupdate(wpeps, H, alg; check_interval) - global wpeps = result[1] + global peps, wts, = simpleupdate(peps, H, alg, wts; check_interval) end ```` ```` -[ Info: Space of x-weight at [1, 1] = Rep[U₁](0=>2, 1/2=>1, -1/2=>1) -[ Info: SU iter 1 : dt = 1e-02, weight diff = 1.188e+00, time = 0.029 sec -[ Info: Space of x-weight at [1, 1] = Rep[U₁](0=>2, 1=>1, -1=>1) -[ Info: SU conv 1832 : dt = 1e-02, weight diff = 9.942e-09, time = 52.896 sec -[ Info: Space of x-weight at [1, 1] = Rep[U₁](0=>2, 1=>1, -1=>1) -[ Info: SU iter 1 : dt = 1e-02, weight diff = 3.400e-04, time = 0.031 sec -[ Info: Space of x-weight at [1, 1] = Rep[U₁](0=>2, 1=>1, -1=>1) -[ Info: SU conv 523 : dt = 1e-02, weight diff = 9.964e-09, time = 15.817 sec -[ Info: Space of x-weight at [1, 1] = Rep[U₁](0=>2, 1=>1, -1=>1) -[ Info: SU iter 1 : dt = 1e-02, weight diff = 3.524e-04, time = 0.029 sec -[ Info: Space of x-weight at [1, 1] = Rep[U₁](0=>2, 1=>1, -1=>1) -[ Info: SU conv 611 : dt = 1e-02, weight diff = 9.848e-09, time = 18.467 sec -[ Info: Space of x-weight at [1, 1] = Rep[U₁](0=>2, 1=>1, -1=>1) -[ Info: SU iter 1 : dt = 1e-02, weight diff = 3.661e-04, time = 0.029 sec -[ Info: Space of x-weight at [1, 1] = Rep[U₁](0=>2, 1=>1, -1=>1) -[ Info: SU conv 735 : dt = 1e-02, weight diff = 9.962e-09, time = 22.205 sec -[ Info: Space of x-weight at [1, 1] = Rep[U₁](0=>2, 1=>1, -1=>1) -[ Info: SU iter 1 : dt = 1e-02, weight diff = 3.823e-04, time = 0.029 sec -[ Info: Space of x-weight at [1, 1] = Rep[U₁](0=>2, 1=>1, -1=>1) -[ Info: SU conv 901 : dt = 1e-02, weight diff = 9.994e-09, time = 27.331 sec +[ Info: Space of x-weight at [1, 1] = Rep[TensorKitSectors.U₁](0=>2, 1/2=>1, -1/2=>1) +[ Info: SU iter 1 : dt = 1e-02, weight diff = 1.188e+00, time = 28.698 sec +[ Info: Space of x-weight at [1, 1] = Rep[TensorKitSectors.U₁](0=>2, 1=>1, -1=>1) +[ Info: SU conv 1832 : dt = 1e-02, weight diff = 9.942e-09, time = 104.269 sec +[ Info: Space of x-weight at [1, 1] = Rep[TensorKitSectors.U₁](0=>2, 1=>1, -1=>1) +[ Info: SU iter 1 : dt = 1e-02, weight diff = 3.400e-04, time = 0.084 sec +[ Info: Space of x-weight at [1, 1] = Rep[TensorKitSectors.U₁](0=>2, 1=>1, -1=>1) +[ Info: SU conv 523 : dt = 1e-02, weight diff = 9.964e-09, time = 19.444 sec +[ Info: Space of x-weight at [1, 1] = Rep[TensorKitSectors.U₁](0=>2, 1=>1, -1=>1) +[ Info: SU iter 1 : dt = 1e-02, weight diff = 3.524e-04, time = 0.065 sec +[ Info: Space of x-weight at [1, 1] = Rep[TensorKitSectors.U₁](0=>2, 1=>1, -1=>1) +[ Info: SU conv 611 : dt = 1e-02, weight diff = 9.848e-09, time = 22.684 sec +[ Info: Space of x-weight at [1, 1] = Rep[TensorKitSectors.U₁](0=>2, 1=>1, -1=>1) +[ Info: SU iter 1 : dt = 1e-02, weight diff = 3.661e-04, time = 0.036 sec +[ Info: Space of x-weight at [1, 1] = Rep[TensorKitSectors.U₁](0=>2, 1=>1, -1=>1) +[ Info: SU conv 735 : dt = 1e-02, weight diff = 9.962e-09, time = 27.379 sec +[ Info: Space of x-weight at [1, 1] = Rep[TensorKitSectors.U₁](0=>2, 1=>1, -1=>1) +[ Info: SU iter 1 : dt = 1e-02, weight diff = 3.823e-04, time = 0.036 sec +[ Info: Space of x-weight at [1, 1] = Rep[TensorKitSectors.U₁](0=>2, 1=>1, -1=>1) +[ Info: SU conv 901 : dt = 1e-02, weight diff = 9.994e-09, time = 33.440 sec ```` @@ -96,44 +95,45 @@ After we reach $J_2 / J_1 = 0.5$, we gradually decrease the evolution time step a more accurately evolved PEPS: ````julia -dts = [1e-3, 1e-4] -tols = [1e-9, 1e-9] +dts = [1.0e-3, 1.0e-4] +tols = [1.0e-9, 1.0e-9] J2 = 0.5 -H = real(j1_j2_model(ComplexF64, symm, InfiniteSquare(Nr, Nc); J1, J2, sublattice=false)) +H = real(j1_j2_model(ComplexF64, symm, InfiniteSquare(Nr, Nc); J1, J2, sublattice = false)) for (dt, tol) in zip(dts, tols) alg′ = SimpleUpdate(dt, tol, maxiter, trscheme_peps) - result = simpleupdate(wpeps, H, alg′; check_interval) - global wpeps = result[1] + global peps, wts, = simpleupdate(peps, H, alg′, wts; check_interval) end ```` ```` -[ Info: Space of x-weight at [1, 1] = Rep[U₁](0=>2, 1=>1, -1=>1) -[ Info: SU iter 1 : dt = 1e-03, weight diff = 4.447e-04, time = 0.030 sec -[ Info: Space of x-weight at [1, 1] = Rep[U₁](0=>2, 1=>1, -1=>1) -[ Info: SU conv 3236 : dt = 1e-03, weight diff = 9.998e-10, time = 97.398 sec -[ Info: Space of x-weight at [1, 1] = Rep[U₁](0=>2, 1=>1, -1=>1) -[ Info: SU iter 1 : dt = 1e-04, weight diff = 4.436e-05, time = 0.031 sec -[ Info: Space of x-weight at [1, 1] = Rep[U₁](0=>2, 1=>1, -1=>1) -[ Info: SU conv 796 : dt = 1e-04, weight diff = 9.999e-10, time = 24.018 sec +[ Info: Space of x-weight at [1, 1] = Rep[TensorKitSectors.U₁](0=>2, 1=>1, -1=>1) +[ Info: SU iter 1 : dt = 1e-03, weight diff = 4.447e-04, time = 0.036 sec +[ Info: Space of x-weight at [1, 1] = Rep[TensorKitSectors.U₁](0=>2, 1=>1, -1=>1) +[ Info: SU conv 3236 : dt = 1e-03, weight diff = 9.998e-10, time = 118.922 sec +[ Info: Space of x-weight at [1, 1] = Rep[TensorKitSectors.U₁](0=>2, 1=>1, -1=>1) +[ Info: SU iter 1 : dt = 1e-04, weight diff = 4.436e-05, time = 0.036 sec +[ Info: Space of x-weight at [1, 1] = Rep[TensorKitSectors.U₁](0=>2, 1=>1, -1=>1) +[ Info: SU conv 796 : dt = 1e-04, weight diff = 9.999e-10, time = 29.313 sec ```` ## Computing the simple update energy estimate Finally, we measure the ground-state energy by converging a CTMRG environment and computing -the expectation value, where we make sure to normalize by the unit cell size: +the expectation value, where we first normalize tensors in the PEPS: ````julia -peps = InfinitePEPS(wpeps) -normalize!.(peps.A, Inf) ## normalize PEPS with absorbed weights by largest element +normalize!.(peps.A, Inf) ## normalize each PEPS tensor by largest element +χenv = 32 +trscheme_env = truncerr(1.0e-10) & truncdim(χenv) +Espace = Vect[U1Irrep](0 => χenv ÷ 2, 1 // 2 => χenv ÷ 4, -1 // 2 => χenv ÷ 4) env₀ = CTMRGEnv(rand, Float64, peps, Espace) -env, = leading_boundary(env₀, peps; tol=1e-10, alg=:sequential, trscheme=trscheme_env); +env, = leading_boundary(env₀, peps; tol = 1.0e-10, alg = :sequential, trscheme = trscheme_env); E = expectation_value(peps, H, env) / (Nr * Nc) ```` ```` --0.4908482949688868 +-0.4908482949689091 ```` Let us compare that estimate with benchmark data obtained from the @@ -146,7 +146,7 @@ E_ref = -0.49425 ```` ```` -(E - E_ref) / abs(E_ref) = 0.0068825594964354074 +(E - E_ref) / abs(E_ref) = 0.00688255949639037 ```` @@ -165,96 +165,96 @@ symmetry can be advantageous for obtaining lower energies.) using MPSKit: randomize! noise_peps = InfinitePEPS(randomize!.(deepcopy(peps.A))) -peps₀ = peps + 1e-1noise_peps +peps₀ = peps + 1.0e-1noise_peps peps_opt, env_opt, E_opt, = fixedpoint( - H, peps₀, env; optimizer_alg=(; tol=1e-4, maxiter=80) + H, peps₀, env; optimizer_alg = (; tol = 1.0e-4, maxiter = 80) ); ```` ```` ┌ Warning: the provided real environment was converted to a complex environment since :fixed mode generally produces complex gauges; use :diffgauge mode instead by passing gradient_alg=(; iterscheme=:diffgauge) to the fixedpoint keyword arguments to work with purely real environments -└ @ PEPSKit ~/repos/PEPSKit.jl/src/algorithms/optimization/peps_optimization.jl:219 +└ @ PEPSKit ~/PEPSKit.jl/src/algorithms/optimization/peps_optimization.jl:204 [ Info: LBFGS: initializing with f = -1.906213849448, ‖∇f‖ = 7.1073e-01 -[ Info: LBFGS: iter 1, time 11.81 s: f = -1.912844704482, ‖∇f‖ = 6.1629e-01, α = 1.00e+00, m = 0, nfg = 1 -[ Info: LBFGS: iter 2, time 16.75 s: f = -1.937956267904, ‖∇f‖ = 2.9827e-01, α = 1.00e+00, m = 1, nfg = 1 -[ Info: LBFGS: iter 3, time 21.80 s: f = -1.943097546791, ‖∇f‖ = 2.0511e-01, α = 1.00e+00, m = 2, nfg = 1 -[ Info: LBFGS: iter 4, time 26.69 s: f = -1.951025946434, ‖∇f‖ = 1.4073e-01, α = 1.00e+00, m = 3, nfg = 1 -[ Info: LBFGS: iter 5, time 31.77 s: f = -1.955168800010, ‖∇f‖ = 1.2051e-01, α = 1.00e+00, m = 4, nfg = 1 -[ Info: LBFGS: iter 6, time 36.87 s: f = -1.960117968919, ‖∇f‖ = 1.1611e-01, α = 1.00e+00, m = 5, nfg = 1 -[ Info: LBFGS: iter 7, time 42.26 s: f = -1.961216587562, ‖∇f‖ = 1.6042e-01, α = 1.00e+00, m = 6, nfg = 1 -[ Info: LBFGS: iter 8, time 47.58 s: f = -1.963394830132, ‖∇f‖ = 7.0500e-02, α = 1.00e+00, m = 7, nfg = 1 -[ Info: LBFGS: iter 9, time 52.76 s: f = -1.964678528654, ‖∇f‖ = 4.8767e-02, α = 1.00e+00, m = 8, nfg = 1 -[ Info: LBFGS: iter 10, time 58.23 s: f = -1.965924377851, ‖∇f‖ = 6.0609e-02, α = 1.00e+00, m = 9, nfg = 1 -[ Info: LBFGS: iter 11, time 64.25 s: f = -1.968120624918, ‖∇f‖ = 7.1520e-02, α = 1.00e+00, m = 10, nfg = 1 -[ Info: LBFGS: iter 12, time 70.40 s: f = -1.969562421458, ‖∇f‖ = 9.5064e-02, α = 1.00e+00, m = 11, nfg = 1 -[ Info: LBFGS: iter 13, time 76.48 s: f = -1.970581981978, ‖∇f‖ = 6.1731e-02, α = 1.00e+00, m = 12, nfg = 1 -[ Info: LBFGS: iter 14, time 82.38 s: f = -1.971121190048, ‖∇f‖ = 3.2138e-02, α = 1.00e+00, m = 13, nfg = 1 -[ Info: LBFGS: iter 15, time 88.28 s: f = -1.971554447655, ‖∇f‖ = 2.5404e-02, α = 1.00e+00, m = 14, nfg = 1 -[ Info: LBFGS: iter 16, time 94.48 s: f = -1.972190046057, ‖∇f‖ = 3.2651e-02, α = 1.00e+00, m = 15, nfg = 1 -[ Info: LBFGS: iter 17, time 100.54 s: f = -1.972856179552, ‖∇f‖ = 3.0426e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 18, time 106.47 s: f = -1.973765629052, ‖∇f‖ = 3.2210e-02, α = 1.00e+00, m = 17, nfg = 1 -[ Info: LBFGS: iter 19, time 112.59 s: f = -1.974162050742, ‖∇f‖ = 3.5505e-02, α = 1.00e+00, m = 18, nfg = 1 -[ Info: LBFGS: iter 20, time 118.60 s: f = -1.974478515407, ‖∇f‖ = 1.8647e-02, α = 1.00e+00, m = 19, nfg = 1 -[ Info: LBFGS: iter 21, time 124.39 s: f = -1.974711840147, ‖∇f‖ = 1.5939e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 22, time 130.52 s: f = -1.974976992882, ‖∇f‖ = 2.3561e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 23, time 136.50 s: f = -1.975198552395, ‖∇f‖ = 2.8074e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 24, time 141.91 s: f = -1.975397188154, ‖∇f‖ = 2.4018e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 25, time 147.64 s: f = -1.975511606909, ‖∇f‖ = 3.1378e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 26, time 153.26 s: f = -1.975619359852, ‖∇f‖ = 1.7031e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 27, time 158.40 s: f = -1.975706047066, ‖∇f‖ = 1.5318e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 28, time 163.89 s: f = -1.975792908561, ‖∇f‖ = 1.3145e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 29, time 169.21 s: f = -1.975874444762, ‖∇f‖ = 2.0056e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 30, time 174.74 s: f = -1.975957400077, ‖∇f‖ = 1.2628e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 31, time 179.85 s: f = -1.976016647203, ‖∇f‖ = 1.0550e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 32, time 185.40 s: f = -1.976101267437, ‖∇f‖ = 1.0041e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 33, time 190.83 s: f = -1.976173093824, ‖∇f‖ = 1.4127e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 34, time 196.38 s: f = -1.976232003564, ‖∇f‖ = 9.3789e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 35, time 201.98 s: f = -1.976279429987, ‖∇f‖ = 9.6660e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 36, time 207.59 s: f = -1.976319807091, ‖∇f‖ = 1.2942e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 37, time 212.95 s: f = -1.976360454958, ‖∇f‖ = 8.8852e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 38, time 218.74 s: f = -1.976400234179, ‖∇f‖ = 6.9115e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 39, time 224.19 s: f = -1.976428915464, ‖∇f‖ = 7.0766e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 40, time 229.67 s: f = -1.976468131930, ‖∇f‖ = 7.3518e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 41, time 235.18 s: f = -1.976524294633, ‖∇f‖ = 1.0581e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 42, time 240.74 s: f = -1.976526983977, ‖∇f‖ = 1.6104e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 43, time 246.33 s: f = -1.976576416539, ‖∇f‖ = 6.5034e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 44, time 251.74 s: f = -1.976601737265, ‖∇f‖ = 5.8912e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 45, time 257.37 s: f = -1.976637886122, ‖∇f‖ = 8.4756e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 46, time 262.96 s: f = -1.976694292720, ‖∇f‖ = 9.7710e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 47, time 274.56 s: f = -1.976719690626, ‖∇f‖ = 1.9617e-02, α = 2.83e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 48, time 279.89 s: f = -1.976757180903, ‖∇f‖ = 9.0902e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 49, time 285.45 s: f = -1.976778896839, ‖∇f‖ = 8.4485e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 50, time 290.77 s: f = -1.976801887998, ‖∇f‖ = 1.3765e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 51, time 296.25 s: f = -1.976830529576, ‖∇f‖ = 1.8017e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 52, time 301.90 s: f = -1.976861162991, ‖∇f‖ = 2.6927e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 53, time 307.18 s: f = -1.976929533535, ‖∇f‖ = 1.0242e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 54, time 312.67 s: f = -1.976973353625, ‖∇f‖ = 7.1802e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 55, time 317.85 s: f = -1.976993717783, ‖∇f‖ = 8.8958e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 56, time 323.48 s: f = -1.977060306915, ‖∇f‖ = 1.1556e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 57, time 334.45 s: f = -1.977091448236, ‖∇f‖ = 1.6192e-02, α = 3.03e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 58, time 339.98 s: f = -1.977138624322, ‖∇f‖ = 1.0354e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 59, time 345.41 s: f = -1.977208179209, ‖∇f‖ = 8.7382e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 60, time 351.07 s: f = -1.977244959697, ‖∇f‖ = 1.7905e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 61, time 356.49 s: f = -1.977290172079, ‖∇f‖ = 1.1535e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 62, time 361.80 s: f = -1.977346829138, ‖∇f‖ = 9.3061e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 63, time 367.29 s: f = -1.977390173782, ‖∇f‖ = 1.0691e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 64, time 372.77 s: f = -1.977406788841, ‖∇f‖ = 2.4206e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 65, time 378.41 s: f = -1.977475388304, ‖∇f‖ = 8.1223e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 66, time 383.66 s: f = -1.977496756947, ‖∇f‖ = 6.2713e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 67, time 389.41 s: f = -1.977538498943, ‖∇f‖ = 8.1518e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 68, time 394.85 s: f = -1.977582944207, ‖∇f‖ = 1.2523e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 69, time 406.53 s: f = -1.977612439512, ‖∇f‖ = 1.7582e-02, α = 3.89e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 70, time 412.07 s: f = -1.977652248007, ‖∇f‖ = 9.1652e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 71, time 417.85 s: f = -1.977681403489, ‖∇f‖ = 8.3683e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 72, time 423.98 s: f = -1.977721141239, ‖∇f‖ = 9.4541e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 73, time 429.73 s: f = -1.977775043848, ‖∇f‖ = 1.1036e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 74, time 435.11 s: f = -1.977818026910, ‖∇f‖ = 1.2406e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 75, time 440.76 s: f = -1.977848105077, ‖∇f‖ = 1.1495e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 76, time 446.06 s: f = -1.977873438780, ‖∇f‖ = 5.9210e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 77, time 451.54 s: f = -1.977888581900, ‖∇f‖ = 6.3137e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 78, time 456.92 s: f = -1.977922415140, ‖∇f‖ = 1.1600e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 79, time 462.53 s: f = -1.977946751759, ‖∇f‖ = 1.2523e-02, α = 1.00e+00, m = 20, nfg = 1 -┌ Warning: LBFGS: not converged to requested tol after 80 iterations and time 468.13 s: f = -1.977972943430, ‖∇f‖ = 7.7636e-03 +[ Info: LBFGS: iter 1, time 652.92 s: f = -1.912844704754, ‖∇f‖ = 6.1629e-01, α = 1.00e+00, m = 0, nfg = 1 +[ Info: LBFGS: iter 2, time 664.36 s: f = -1.937956278406, ‖∇f‖ = 2.9827e-01, α = 1.00e+00, m = 1, nfg = 1 +[ Info: LBFGS: iter 3, time 674.98 s: f = -1.943097558049, ‖∇f‖ = 2.0511e-01, α = 1.00e+00, m = 2, nfg = 1 +[ Info: LBFGS: iter 4, time 686.77 s: f = -1.951025956511, ‖∇f‖ = 1.4073e-01, α = 1.00e+00, m = 3, nfg = 1 +[ Info: LBFGS: iter 5, time 697.58 s: f = -1.955168827774, ‖∇f‖ = 1.2051e-01, α = 1.00e+00, m = 4, nfg = 1 +[ Info: LBFGS: iter 6, time 708.82 s: f = -1.960117970278, ‖∇f‖ = 1.1611e-01, α = 1.00e+00, m = 5, nfg = 1 +[ Info: LBFGS: iter 7, time 720.26 s: f = -1.961216550036, ‖∇f‖ = 1.6042e-01, α = 1.00e+00, m = 6, nfg = 1 +[ Info: LBFGS: iter 8, time 731.38 s: f = -1.963394812594, ‖∇f‖ = 7.0500e-02, α = 1.00e+00, m = 7, nfg = 1 +[ Info: LBFGS: iter 9, time 742.56 s: f = -1.964678496250, ‖∇f‖ = 4.8767e-02, α = 1.00e+00, m = 8, nfg = 1 +[ Info: LBFGS: iter 10, time 755.02 s: f = -1.965924354920, ‖∇f‖ = 6.0609e-02, α = 1.00e+00, m = 9, nfg = 1 +[ Info: LBFGS: iter 11, time 767.32 s: f = -1.968120587109, ‖∇f‖ = 7.1520e-02, α = 1.00e+00, m = 10, nfg = 1 +[ Info: LBFGS: iter 12, time 780.79 s: f = -1.969562403653, ‖∇f‖ = 9.5065e-02, α = 1.00e+00, m = 11, nfg = 1 +[ Info: LBFGS: iter 13, time 793.16 s: f = -1.970582005143, ‖∇f‖ = 6.1728e-02, α = 1.00e+00, m = 12, nfg = 1 +[ Info: LBFGS: iter 14, time 805.31 s: f = -1.971121191726, ‖∇f‖ = 3.2137e-02, α = 1.00e+00, m = 13, nfg = 1 +[ Info: LBFGS: iter 15, time 818.38 s: f = -1.971554453753, ‖∇f‖ = 2.5404e-02, α = 1.00e+00, m = 14, nfg = 1 +[ Info: LBFGS: iter 16, time 831.96 s: f = -1.972190061011, ‖∇f‖ = 3.2651e-02, α = 1.00e+00, m = 15, nfg = 1 +[ Info: LBFGS: iter 17, time 844.26 s: f = -1.972856212899, ‖∇f‖ = 3.0425e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 18, time 857.72 s: f = -1.973765750218, ‖∇f‖ = 3.2201e-02, α = 1.00e+00, m = 17, nfg = 1 +[ Info: LBFGS: iter 19, time 870.23 s: f = -1.974161602591, ‖∇f‖ = 3.5568e-02, α = 1.00e+00, m = 18, nfg = 1 +[ Info: LBFGS: iter 20, time 883.37 s: f = -1.974478336877, ‖∇f‖ = 1.8682e-02, α = 1.00e+00, m = 19, nfg = 1 +[ Info: LBFGS: iter 21, time 895.17 s: f = -1.974710833057, ‖∇f‖ = 1.5936e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 22, time 908.28 s: f = -1.974975741077, ‖∇f‖ = 2.3555e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 23, time 920.27 s: f = -1.975198522454, ‖∇f‖ = 2.7962e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 24, time 932.03 s: f = -1.975394248410, ‖∇f‖ = 2.5314e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 25, time 944.70 s: f = -1.975512455006, ‖∇f‖ = 2.9518e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 26, time 956.37 s: f = -1.975616686676, ‖∇f‖ = 1.6802e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 27, time 967.76 s: f = -1.975710241181, ‖∇f‖ = 1.5024e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 28, time 978.98 s: f = -1.975795271168, ‖∇f‖ = 1.2833e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 29, time 989.49 s: f = -1.975865143335, ‖∇f‖ = 2.3418e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 30, time 1002.34 s: f = -1.975957427509, ‖∇f‖ = 1.1381e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 31, time 1013.66 s: f = -1.976015850153, ‖∇f‖ = 1.0083e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 32, time 1024.96 s: f = -1.976080164930, ‖∇f‖ = 1.3119e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 33, time 1037.67 s: f = -1.976152913537, ‖∇f‖ = 1.4611e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 34, time 1048.69 s: f = -1.976198207069, ‖∇f‖ = 9.6971e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 35, time 1061.48 s: f = -1.976250601632, ‖∇f‖ = 9.3909e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 36, time 1073.15 s: f = -1.976291935078, ‖∇f‖ = 1.4028e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 37, time 1084.60 s: f = -1.976340224013, ‖∇f‖ = 1.0472e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 38, time 1097.26 s: f = -1.976377344626, ‖∇f‖ = 6.9713e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 39, time 1109.15 s: f = -1.976411251633, ‖∇f‖ = 6.5882e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 40, time 1122.25 s: f = -1.976451966987, ‖∇f‖ = 7.7535e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 41, time 1133.98 s: f = -1.976491819091, ‖∇f‖ = 1.1597e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 42, time 1145.62 s: f = -1.976529574561, ‖∇f‖ = 8.6643e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 43, time 1158.08 s: f = -1.976564683972, ‖∇f‖ = 7.6509e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 44, time 1168.84 s: f = -1.976599313000, ‖∇f‖ = 7.3612e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 45, time 1181.74 s: f = -1.976636515361, ‖∇f‖ = 1.8259e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 46, time 1193.53 s: f = -1.976680292934, ‖∇f‖ = 9.8005e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 47, time 1205.13 s: f = -1.976709176062, ‖∇f‖ = 8.4490e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 48, time 1216.87 s: f = -1.976735409874, ‖∇f‖ = 1.5557e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 49, time 1228.56 s: f = -1.976776133103, ‖∇f‖ = 1.3263e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 50, time 1241.43 s: f = -1.976811137668, ‖∇f‖ = 1.1320e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 51, time 1265.73 s: f = -1.976843854259, ‖∇f‖ = 1.4911e-02, α = 5.24e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 52, time 1278.46 s: f = -1.976923448868, ‖∇f‖ = 9.7919e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 53, time 1289.71 s: f = -1.976965559297, ‖∇f‖ = 7.7472e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 54, time 1301.37 s: f = -1.977044614238, ‖∇f‖ = 1.3785e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 55, time 1313.26 s: f = -1.977075753938, ‖∇f‖ = 2.0809e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 56, time 1325.74 s: f = -1.977139445975, ‖∇f‖ = 9.3821e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 57, time 1336.75 s: f = -1.977165276657, ‖∇f‖ = 7.5268e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 58, time 1348.24 s: f = -1.977219450466, ‖∇f‖ = 1.1473e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 59, time 1359.70 s: f = -1.977275314249, ‖∇f‖ = 1.9030e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 60, time 1372.04 s: f = -1.977335522183, ‖∇f‖ = 1.1000e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 61, time 1383.33 s: f = -1.977385273141, ‖∇f‖ = 9.0696e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 62, time 1394.84 s: f = -1.977430128301, ‖∇f‖ = 1.1553e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 63, time 1406.33 s: f = -1.977469892558, ‖∇f‖ = 8.2877e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 64, time 1418.79 s: f = -1.977495288994, ‖∇f‖ = 7.9121e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 65, time 1430.48 s: f = -1.977553209211, ‖∇f‖ = 8.8664e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 66, time 1443.25 s: f = -1.977597458477, ‖∇f‖ = 1.9052e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 67, time 1453.49 s: f = -1.977660134707, ‖∇f‖ = 1.1063e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 68, time 1465.98 s: f = -1.977685405419, ‖∇f‖ = 2.0774e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 69, time 1476.58 s: f = -1.977717638754, ‖∇f‖ = 8.7390e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 70, time 1488.80 s: f = -1.977730883236, ‖∇f‖ = 7.0000e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 71, time 1500.40 s: f = -1.977768669053, ‖∇f‖ = 8.1853e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 72, time 1511.94 s: f = -1.977810913385, ‖∇f‖ = 1.0740e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 73, time 1523.64 s: f = -1.977817034893, ‖∇f‖ = 1.7372e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 74, time 1535.46 s: f = -1.977859790789, ‖∇f‖ = 6.3128e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 75, time 1547.05 s: f = -1.977877604524, ‖∇f‖ = 5.9647e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 76, time 1559.50 s: f = -1.977904920943, ‖∇f‖ = 8.3968e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 77, time 1571.15 s: f = -1.977943608891, ‖∇f‖ = 1.1579e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 78, time 1582.92 s: f = -1.977960278758, ‖∇f‖ = 1.3388e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 79, time 1595.75 s: f = -1.977963135797, ‖∇f‖ = 1.0697e-02, α = 1.00e+00, m = 20, nfg = 1 +┌ Warning: LBFGS: not converged to requested tol after 80 iterations and time 1606.72 s: f = -1.977988611344, ‖∇f‖ = 1.6698e-02 └ @ OptimKit ~/.julia/packages/OptimKit/G6i79/src/lbfgs.jl:197 ```` @@ -270,8 +270,8 @@ E_opt /= (Nr * Nc) ```` ```` -E_opt = -0.49449323585738636 -(E_opt - E_ref) / abs(E_ref) = -0.0004921312238469133 +E_opt = -0.4944971528359841 +(E_opt - E_ref) / abs(E_ref) = -0.0005000563196440829 ```` diff --git a/docs/src/examples/j1j2_su/main.ipynb b/docs/src/examples/j1j2_su/main.ipynb index 457e1c3c2..90b989f23 100644 --- a/docs/src/examples/j1j2_su/main.ipynb +++ b/docs/src/examples/j1j2_su/main.ipynb @@ -47,10 +47,11 @@ "source": [ "## Simple updating a challenging phase\n", "\n", - "Let's start by initializing an `InfiniteWeightPEPS` for which we set the required parameters\n", - "as well as physical and virtual vector spaces. We use the minimal unit cell size\n", - "($2 \\times 2$) required by the simple update algorithm for Hamiltonians with\n", - "next-nearest-neighbour interactions:" + "Let's start by initializing an `InfinitePEPS` for which we set the required parameters\n", + "as well as physical and virtual vector spaces.\n", + "The `SUWeight` used by simple update will be initialized to identity matrices.\n", + "We use the minimal unit cell size ($2 \\times 2$) required by the simple update algorithm\n", + "for Hamiltonians with next-nearest-neighbour interactions:" ], "metadata": {} }, @@ -58,15 +59,14 @@ "outputs": [], "cell_type": "code", "source": [ - "Dbond, χenv, symm = 4, 32, U1Irrep\n", - "trscheme_env = truncerr(1e-10) & truncdim(χenv)\n", + "Dbond, symm = 4, U1Irrep\n", "Nr, Nc, J1 = 2, 2, 1.0\n", "\n", - "# random initialization of 2x2 iPEPS with weights and CTMRGEnv (using real numbers)\n", - "Pspace = Vect[U1Irrep](1//2 => 1, -1//2 => 1)\n", - "Vspace = Vect[U1Irrep](0 => 2, 1//2 => 1, -1//2 => 1)\n", - "Espace = Vect[U1Irrep](0 => χenv ÷ 2, 1//2 => χenv ÷ 4, -1//2 => χenv ÷ 4)\n", - "wpeps = InfiniteWeightPEPS(rand, Float64, Pspace, Vspace; unitcell=(Nr, Nc));" + "# random initialization of 2x2 iPEPS (using real numbers) and SUWeight\n", + "Pspace = Vect[U1Irrep](1 // 2 => 1, -1 // 2 => 1)\n", + "Vspace = Vect[U1Irrep](0 => 2, 1 // 2 => 1, -1 // 2 => 1)\n", + "peps = InfinitePEPS(rand, Float64, Pspace, Vspace; unitcell = (Nr, Nc));\n", + "wts = SUWeight(peps);" ], "metadata": {}, "execution_count": null @@ -85,16 +85,15 @@ "outputs": [], "cell_type": "code", "source": [ - "dt, tol, maxiter = 1e-2, 1e-8, 30000\n", + "dt, tol, maxiter = 1.0e-2, 1.0e-8, 30000\n", "check_interval = 4000\n", - "trscheme_peps = truncerr(1e-10) & truncdim(Dbond)\n", + "trscheme_peps = truncerr(1.0e-10) & truncdim(Dbond)\n", "alg = SimpleUpdate(dt, tol, maxiter, trscheme_peps)\n", "for J2 in 0.1:0.1:0.5\n", " H = real( ## convert Hamiltonian `LocalOperator` to real floats\n", - " j1_j2_model(ComplexF64, symm, InfiniteSquare(Nr, Nc); J1, J2, sublattice=false),\n", + " j1_j2_model(ComplexF64, symm, InfiniteSquare(Nr, Nc); J1, J2, sublattice = false),\n", " )\n", - " result = simpleupdate(wpeps, H, alg; check_interval)\n", - " global wpeps = result[1]\n", + " global peps, wts, = simpleupdate(peps, H, alg, wts; check_interval)\n", "end" ], "metadata": {}, @@ -112,14 +111,13 @@ "outputs": [], "cell_type": "code", "source": [ - "dts = [1e-3, 1e-4]\n", - "tols = [1e-9, 1e-9]\n", + "dts = [1.0e-3, 1.0e-4]\n", + "tols = [1.0e-9, 1.0e-9]\n", "J2 = 0.5\n", - "H = real(j1_j2_model(ComplexF64, symm, InfiniteSquare(Nr, Nc); J1, J2, sublattice=false))\n", + "H = real(j1_j2_model(ComplexF64, symm, InfiniteSquare(Nr, Nc); J1, J2, sublattice = false))\n", "for (dt, tol) in zip(dts, tols)\n", " alg′ = SimpleUpdate(dt, tol, maxiter, trscheme_peps)\n", - " result = simpleupdate(wpeps, H, alg′; check_interval)\n", - " global wpeps = result[1]\n", + " global peps, wts, = simpleupdate(peps, H, alg′, wts; check_interval)\n", "end" ], "metadata": {}, @@ -131,7 +129,7 @@ "## Computing the simple update energy estimate\n", "\n", "Finally, we measure the ground-state energy by converging a CTMRG environment and computing\n", - "the expectation value, where we make sure to normalize by the unit cell size:" + "the expectation value, where we first normalize tensors in the PEPS:" ], "metadata": {} }, @@ -139,10 +137,12 @@ "outputs": [], "cell_type": "code", "source": [ - "peps = InfinitePEPS(wpeps)\n", - "normalize!.(peps.A, Inf) ## normalize PEPS with absorbed weights by largest element\n", + "normalize!.(peps.A, Inf) ## normalize each PEPS tensor by largest element\n", + "χenv = 32\n", + "trscheme_env = truncerr(1.0e-10) & truncdim(χenv)\n", + "Espace = Vect[U1Irrep](0 => χenv ÷ 2, 1 // 2 => χenv ÷ 4, -1 // 2 => χenv ÷ 4)\n", "env₀ = CTMRGEnv(rand, Float64, peps, Espace)\n", - "env, = leading_boundary(env₀, peps; tol=1e-10, alg=:sequential, trscheme=trscheme_env);\n", + "env, = leading_boundary(env₀, peps; tol = 1.0e-10, alg = :sequential, trscheme = trscheme_env);\n", "E = expectation_value(peps, H, env) / (Nr * Nc)" ], "metadata": {}, @@ -190,9 +190,9 @@ "using MPSKit: randomize!\n", "\n", "noise_peps = InfinitePEPS(randomize!.(deepcopy(peps.A)))\n", - "peps₀ = peps + 1e-1noise_peps\n", + "peps₀ = peps + 1.0e-1noise_peps\n", "peps_opt, env_opt, E_opt, = fixedpoint(\n", - " H, peps₀, env; optimizer_alg=(; tol=1e-4, maxiter=80)\n", + " H, peps₀, env; optimizer_alg = (; tol = 1.0e-4, maxiter = 80)\n", ");" ], "metadata": {}, diff --git a/docs/src/examples/xxz/index.md b/docs/src/examples/xxz/index.md index be4197b93..1f4cd9f82 100644 --- a/docs/src/examples/xxz/index.md +++ b/docs/src/examples/xxz/index.md @@ -38,7 +38,7 @@ parameters: ````julia J = 1.0 Delta = 1.0 -spin = 1//2 +spin = 1 // 2 symmetry = U1Irrep lattice = InfiniteSquare(2, 2) H₀ = heisenberg_XXZ(ComplexF64, symmetry, lattice; J, Delta, spin); @@ -50,8 +50,8 @@ charges: ````julia S_aux = [ - U1Irrep(-1//2) U1Irrep(1//2) - U1Irrep(1//2) U1Irrep(-1//2) + U1Irrep(-1 // 2) U1Irrep(1 // 2) + U1Irrep(1 // 2) U1Irrep(-1 // 2) ] H = add_physical_charge(H₀, S_aux); ```` @@ -84,9 +84,9 @@ From this point onwards it's business as usual: Create an initial PEPS and envir (using the symmetric spaces), specify the algorithmic parameters and optimize: ````julia -boundary_alg = (; tol=1e-8, alg=:simultaneous, trscheme=(; alg=:fixedspace)) -gradient_alg = (; tol=1e-6, alg=:eigsolver, maxiter=10, iterscheme=:diffgauge) -optimizer_alg = (; tol=1e-4, alg=:lbfgs, maxiter=85, ls_maxiter=3, ls_maxfg=3) +boundary_alg = (; tol = 1.0e-8, alg = :simultaneous, trscheme = (; alg = :fixedspace)) +gradient_alg = (; tol = 1.0e-6, alg = :eigsolver, maxiter = 10, iterscheme = :diffgauge) +optimizer_alg = (; tol = 1.0e-4, alg = :lbfgs, maxiter = 85, ls_maxiter = 3, ls_maxfg = 3) peps₀ = InfinitePEPS(randn, ComplexF64, physical_spaces, virtual_spaces) env₀, = leading_boundary(CTMRGEnv(peps₀, V_env), peps₀; boundary_alg...); @@ -94,7 +94,7 @@ env₀, = leading_boundary(CTMRGEnv(peps₀, V_env), peps₀; boundary_alg...); ```` [ Info: CTMRG init: obj = -2.356413456811e+03 +3.307968169629e+02im err = 1.0000e+00 -[ Info: CTMRG conv 30: obj = +6.245129734283e+03 -4.010098564322e-08im err = 5.3638617277e-09 time = 0.92 sec +[ Info: CTMRG conv 30: obj = +6.245129734283e+03 -4.009734766441e-08im err = 5.3638613489e-09 time = 3.81 sec ```` @@ -105,7 +105,7 @@ and environment dimensions): ````julia peps, env, E, info = fixedpoint( - H, peps₀, env₀; boundary_alg, gradient_alg, optimizer_alg, verbosity=3 + H, peps₀, env₀; boundary_alg, gradient_alg, optimizer_alg, verbosity = 3 ) @show E; ```` @@ -115,96 +115,96 @@ peps, env, E, info = fixedpoint( ┌ Warning: Linesearch not converged after 1 iterations and 4 function evaluations: │ α = 2.50e+01, dϕ = -6.00e-03, ϕ - ϕ₀ = -1.13e-01 └ @ OptimKit ~/.julia/packages/OptimKit/G6i79/src/linesearches.jl:148 -[ Info: LBFGS: iter 1, time 200.41 s: f = -0.147314472246, ‖∇f‖ = 9.2219e-01, α = 2.50e+01, m = 0, nfg = 4 +[ Info: LBFGS: iter 1, time 106.06 s: f = -0.147314472246, ‖∇f‖ = 9.2219e-01, α = 2.50e+01, m = 0, nfg = 4 ┌ Warning: Linesearch not converged after 1 iterations and 4 function evaluations: │ α = 2.50e+01, dϕ = -1.99e-03, ϕ - ϕ₀ = -3.80e-01 └ @ OptimKit ~/.julia/packages/OptimKit/G6i79/src/linesearches.jl:148 -[ Info: LBFGS: iter 2, time 269.67 s: f = -0.527654857567, ‖∇f‖ = 7.5002e-01, α = 2.50e+01, m = 0, nfg = 4 -[ Info: LBFGS: iter 3, time 286.74 s: f = -0.552751928887, ‖∇f‖ = 3.6310e-01, α = 1.00e+00, m = 1, nfg = 1 -[ Info: LBFGS: iter 4, time 337.91 s: f = -0.617206129929, ‖∇f‖ = 3.0891e-01, α = 3.20e+00, m = 2, nfg = 3 -[ Info: LBFGS: iter 5, time 354.97 s: f = -0.632819487274, ‖∇f‖ = 4.0073e-01, α = 1.00e+00, m = 3, nfg = 1 -[ Info: LBFGS: iter 6, time 370.30 s: f = -0.653138513637, ‖∇f‖ = 1.0717e-01, α = 1.00e+00, m = 4, nfg = 1 -[ Info: LBFGS: iter 7, time 381.55 s: f = -0.655569926077, ‖∇f‖ = 4.7861e-02, α = 1.00e+00, m = 5, nfg = 1 -[ Info: LBFGS: iter 8, time 392.14 s: f = -0.656621018321, ‖∇f‖ = 4.3322e-02, α = 1.00e+00, m = 6, nfg = 1 -[ Info: LBFGS: iter 9, time 402.41 s: f = -0.657996751278, ‖∇f‖ = 4.6277e-02, α = 1.00e+00, m = 7, nfg = 1 -[ Info: LBFGS: iter 10, time 412.44 s: f = -0.659837382098, ‖∇f‖ = 4.8930e-02, α = 1.00e+00, m = 8, nfg = 1 -[ Info: LBFGS: iter 11, time 421.91 s: f = -0.661058228215, ‖∇f‖ = 4.1864e-02, α = 1.00e+00, m = 9, nfg = 1 -[ Info: LBFGS: iter 12, time 431.77 s: f = -0.661633890101, ‖∇f‖ = 1.7067e-02, α = 1.00e+00, m = 10, nfg = 1 -[ Info: LBFGS: iter 13, time 440.37 s: f = -0.661839831812, ‖∇f‖ = 1.4709e-02, α = 1.00e+00, m = 11, nfg = 1 -[ Info: LBFGS: iter 14, time 449.27 s: f = -0.662134636143, ‖∇f‖ = 1.7065e-02, α = 1.00e+00, m = 12, nfg = 1 -[ Info: LBFGS: iter 15, time 458.85 s: f = -0.662532716659, ‖∇f‖ = 1.7719e-02, α = 1.00e+00, m = 13, nfg = 1 -[ Info: LBFGS: iter 16, time 467.98 s: f = -0.662996909612, ‖∇f‖ = 2.0543e-02, α = 1.00e+00, m = 14, nfg = 1 -[ Info: LBFGS: iter 17, time 477.51 s: f = -0.663439633406, ‖∇f‖ = 2.6049e-02, α = 1.00e+00, m = 15, nfg = 1 -[ Info: LBFGS: iter 18, time 486.45 s: f = -0.663855589525, ‖∇f‖ = 3.2567e-02, α = 1.00e+00, m = 16, nfg = 1 -[ Info: LBFGS: iter 19, time 495.46 s: f = -0.664450880841, ‖∇f‖ = 2.3691e-02, α = 1.00e+00, m = 17, nfg = 1 -[ Info: LBFGS: iter 20, time 505.64 s: f = -0.664917088518, ‖∇f‖ = 1.8281e-02, α = 1.00e+00, m = 18, nfg = 1 -[ Info: LBFGS: iter 21, time 514.58 s: f = -0.665079077676, ‖∇f‖ = 1.2380e-02, α = 1.00e+00, m = 19, nfg = 1 -[ Info: LBFGS: iter 22, time 523.59 s: f = -0.665287463007, ‖∇f‖ = 1.7237e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 23, time 533.23 s: f = -0.665717355832, ‖∇f‖ = 2.9356e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 24, time 543.00 s: f = -0.666166129443, ‖∇f‖ = 3.2946e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 25, time 562.76 s: f = -0.666407108756, ‖∇f‖ = 2.6211e-02, α = 4.29e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 26, time 573.09 s: f = -0.666612715340, ‖∇f‖ = 1.1288e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 27, time 582.76 s: f = -0.666709056953, ‖∇f‖ = 1.2143e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 28, time 592.05 s: f = -0.666869683924, ‖∇f‖ = 1.8077e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 29, time 602.27 s: f = -0.667130274911, ‖∇f‖ = 2.1430e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 30, time 622.23 s: f = -0.667250996806, ‖∇f‖ = 2.4838e-02, α = 4.17e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 31, time 631.86 s: f = -0.667422880816, ‖∇f‖ = 1.0123e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 32, time 641.47 s: f = -0.667499816879, ‖∇f‖ = 7.8017e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 33, time 651.74 s: f = -0.667576990274, ‖∇f‖ = 1.2346e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 34, time 661.42 s: f = -0.667710803542, ‖∇f‖ = 1.5052e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 35, time 680.14 s: f = -0.667785707694, ‖∇f‖ = 1.7863e-02, α = 5.54e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 36, time 689.37 s: f = -0.667885903685, ‖∇f‖ = 9.0771e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 37, time 698.32 s: f = -0.667941746884, ‖∇f‖ = 7.0177e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 38, time 708.15 s: f = -0.667974884585, ‖∇f‖ = 8.8422e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 39, time 716.81 s: f = -0.668048817152, ‖∇f‖ = 1.1324e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 40, time 725.46 s: f = -0.668123278247, ‖∇f‖ = 1.3967e-02, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 41, time 735.36 s: f = -0.668188420240, ‖∇f‖ = 5.1732e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 42, time 744.40 s: f = -0.668212525320, ‖∇f‖ = 5.1150e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 43, time 754.13 s: f = -0.668245117146, ‖∇f‖ = 5.9778e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 44, time 763.24 s: f = -0.668321415567, ‖∇f‖ = 7.7043e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 45, time 781.85 s: f = -0.668349419497, ‖∇f‖ = 8.7093e-03, α = 3.23e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 46, time 790.85 s: f = -0.668394232920, ‖∇f‖ = 4.9490e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 47, time 799.85 s: f = -0.668423902729, ‖∇f‖ = 4.4315e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 48, time 809.56 s: f = -0.668453519413, ‖∇f‖ = 6.6590e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 49, time 818.73 s: f = -0.668482512627, ‖∇f‖ = 4.7810e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 50, time 827.88 s: f = -0.668522432273, ‖∇f‖ = 4.7205e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 51, time 842.27 s: f = -0.668536269464, ‖∇f‖ = 8.2957e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 52, time 851.35 s: f = -0.668554701367, ‖∇f‖ = 3.4938e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 53, time 860.86 s: f = -0.668564624860, ‖∇f‖ = 3.0996e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 54, time 870.08 s: f = -0.668580402016, ‖∇f‖ = 4.3886e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 55, time 879.06 s: f = -0.668603907003, ‖∇f‖ = 5.3988e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 56, time 897.98 s: f = -0.668617246170, ‖∇f‖ = 5.8694e-03, α = 4.99e-01, m = 20, nfg = 2 -[ Info: LBFGS: iter 57, time 907.72 s: f = -0.668632724020, ‖∇f‖ = 3.2358e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 58, time 917.01 s: f = -0.668645126493, ‖∇f‖ = 3.1763e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 59, time 926.33 s: f = -0.668655398082, ‖∇f‖ = 4.2974e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 60, time 936.00 s: f = -0.668669899756, ‖∇f‖ = 4.4860e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 61, time 945.03 s: f = -0.668685368558, ‖∇f‖ = 3.1222e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 62, time 954.24 s: f = -0.668694965356, ‖∇f‖ = 4.0039e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 63, time 963.47 s: f = -0.668703207321, ‖∇f‖ = 3.3668e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 64, time 972.78 s: f = -0.668712392397, ‖∇f‖ = 3.4980e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 65, time 981.96 s: f = -0.668728646271, ‖∇f‖ = 6.7104e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 66, time 991.59 s: f = -0.668739676361, ‖∇f‖ = 3.7165e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 67, time 1000.90 s: f = -0.668745430589, ‖∇f‖ = 2.1495e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 68, time 1010.57 s: f = -0.668751516160, ‖∇f‖ = 2.0809e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 69, time 1019.38 s: f = -0.668760790802, ‖∇f‖ = 2.5898e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 70, time 1028.31 s: f = -0.668768119147, ‖∇f‖ = 7.2679e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 71, time 1038.11 s: f = -0.668784264566, ‖∇f‖ = 2.6529e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 72, time 1047.35 s: f = -0.668789170375, ‖∇f‖ = 1.8137e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 73, time 1056.72 s: f = -0.668795881546, ‖∇f‖ = 2.0901e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 74, time 1066.35 s: f = -0.668799081816, ‖∇f‖ = 6.5956e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 75, time 1075.63 s: f = -0.668808063181, ‖∇f‖ = 2.8612e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 76, time 1085.30 s: f = -0.668814364081, ‖∇f‖ = 1.5758e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 77, time 1094.40 s: f = -0.668817946829, ‖∇f‖ = 1.9178e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 78, time 1103.72 s: f = -0.668824278385, ‖∇f‖ = 2.2613e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 79, time 1113.67 s: f = -0.668828126813, ‖∇f‖ = 4.6442e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 80, time 1123.07 s: f = -0.668835065826, ‖∇f‖ = 1.5939e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 81, time 1132.41 s: f = -0.668837215645, ‖∇f‖ = 2.3238e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 82, time 1142.13 s: f = -0.668837926114, ‖∇f‖ = 2.8015e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 83, time 1151.39 s: f = -0.668842788932, ‖∇f‖ = 1.8642e-03, α = 1.00e+00, m = 20, nfg = 1 -[ Info: LBFGS: iter 84, time 1160.72 s: f = -0.668846748527, ‖∇f‖ = 1.3959e-03, α = 1.00e+00, m = 20, nfg = 1 -┌ Warning: LBFGS: not converged to requested tol after 85 iterations and time 1170.53 s: f = -0.668849701358, ‖∇f‖ = 2.0170e-03 +[ Info: LBFGS: iter 2, time 181.45 s: f = -0.527654857567, ‖∇f‖ = 7.5002e-01, α = 2.50e+01, m = 0, nfg = 4 +[ Info: LBFGS: iter 3, time 199.44 s: f = -0.552751928887, ‖∇f‖ = 3.6310e-01, α = 1.00e+00, m = 1, nfg = 1 +[ Info: LBFGS: iter 4, time 253.43 s: f = -0.617206129929, ‖∇f‖ = 3.0891e-01, α = 3.20e+00, m = 2, nfg = 3 +[ Info: LBFGS: iter 5, time 272.00 s: f = -0.632819487274, ‖∇f‖ = 4.0073e-01, α = 1.00e+00, m = 3, nfg = 1 +[ Info: LBFGS: iter 6, time 288.78 s: f = -0.653138513637, ‖∇f‖ = 1.0717e-01, α = 1.00e+00, m = 4, nfg = 1 +[ Info: LBFGS: iter 7, time 298.89 s: f = -0.655569926077, ‖∇f‖ = 4.7861e-02, α = 1.00e+00, m = 5, nfg = 1 +[ Info: LBFGS: iter 8, time 310.29 s: f = -0.656621018321, ‖∇f‖ = 4.3322e-02, α = 1.00e+00, m = 6, nfg = 1 +[ Info: LBFGS: iter 9, time 320.40 s: f = -0.657996751278, ‖∇f‖ = 4.6277e-02, α = 1.00e+00, m = 7, nfg = 1 +[ Info: LBFGS: iter 10, time 329.76 s: f = -0.659837382098, ‖∇f‖ = 4.8930e-02, α = 1.00e+00, m = 8, nfg = 1 +[ Info: LBFGS: iter 11, time 340.25 s: f = -0.661058228215, ‖∇f‖ = 4.1864e-02, α = 1.00e+00, m = 9, nfg = 1 +[ Info: LBFGS: iter 12, time 349.38 s: f = -0.661633890101, ‖∇f‖ = 1.7067e-02, α = 1.00e+00, m = 10, nfg = 1 +[ Info: LBFGS: iter 13, time 357.68 s: f = -0.661839831812, ‖∇f‖ = 1.4709e-02, α = 1.00e+00, m = 11, nfg = 1 +[ Info: LBFGS: iter 14, time 367.25 s: f = -0.662134636143, ‖∇f‖ = 1.7065e-02, α = 1.00e+00, m = 12, nfg = 1 +[ Info: LBFGS: iter 15, time 375.64 s: f = -0.662532716659, ‖∇f‖ = 1.7719e-02, α = 1.00e+00, m = 13, nfg = 1 +[ Info: LBFGS: iter 16, time 383.89 s: f = -0.662996909612, ‖∇f‖ = 2.0543e-02, α = 1.00e+00, m = 14, nfg = 1 +[ Info: LBFGS: iter 17, time 393.35 s: f = -0.663439633406, ‖∇f‖ = 2.6049e-02, α = 1.00e+00, m = 15, nfg = 1 +[ Info: LBFGS: iter 18, time 401.54 s: f = -0.663855589525, ‖∇f‖ = 3.2567e-02, α = 1.00e+00, m = 16, nfg = 1 +[ Info: LBFGS: iter 19, time 409.75 s: f = -0.664450880841, ‖∇f‖ = 2.3691e-02, α = 1.00e+00, m = 17, nfg = 1 +[ Info: LBFGS: iter 20, time 419.86 s: f = -0.664917088518, ‖∇f‖ = 1.8281e-02, α = 1.00e+00, m = 18, nfg = 1 +[ Info: LBFGS: iter 21, time 428.21 s: f = -0.665079077676, ‖∇f‖ = 1.2380e-02, α = 1.00e+00, m = 19, nfg = 1 +[ Info: LBFGS: iter 22, time 436.46 s: f = -0.665287463007, ‖∇f‖ = 1.7237e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 23, time 445.88 s: f = -0.665717355832, ‖∇f‖ = 2.9356e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 24, time 454.89 s: f = -0.666166129443, ‖∇f‖ = 3.2946e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 25, time 474.33 s: f = -0.666407108755, ‖∇f‖ = 2.6211e-02, α = 4.29e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 26, time 483.35 s: f = -0.666612715340, ‖∇f‖ = 1.1288e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 27, time 492.43 s: f = -0.666709056953, ‖∇f‖ = 1.2143e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 28, time 502.05 s: f = -0.666869683924, ‖∇f‖ = 1.8077e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 29, time 511.17 s: f = -0.667130274911, ‖∇f‖ = 2.1430e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 30, time 530.62 s: f = -0.667250996806, ‖∇f‖ = 2.4838e-02, α = 4.17e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 31, time 539.67 s: f = -0.667422880816, ‖∇f‖ = 1.0123e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 32, time 548.64 s: f = -0.667499816879, ‖∇f‖ = 7.8017e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 33, time 558.89 s: f = -0.667576990274, ‖∇f‖ = 1.2346e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 34, time 568.08 s: f = -0.667710803542, ‖∇f‖ = 1.5052e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 35, time 586.23 s: f = -0.667785707694, ‖∇f‖ = 1.7863e-02, α = 5.54e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 36, time 594.68 s: f = -0.667885903685, ‖∇f‖ = 9.0771e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 37, time 603.14 s: f = -0.667941746884, ‖∇f‖ = 7.0177e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 38, time 612.88 s: f = -0.667974884585, ‖∇f‖ = 8.8422e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 39, time 621.44 s: f = -0.668048817152, ‖∇f‖ = 1.1324e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 40, time 630.01 s: f = -0.668123278247, ‖∇f‖ = 1.3967e-02, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 41, time 639.72 s: f = -0.668188420240, ‖∇f‖ = 5.1732e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 42, time 648.20 s: f = -0.668212525320, ‖∇f‖ = 5.1150e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 43, time 656.80 s: f = -0.668245117146, ‖∇f‖ = 5.9778e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 44, time 666.45 s: f = -0.668321415567, ‖∇f‖ = 7.7043e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 45, time 683.91 s: f = -0.668349419497, ‖∇f‖ = 8.7093e-03, α = 3.23e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 46, time 693.71 s: f = -0.668394232920, ‖∇f‖ = 4.9490e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 47, time 702.37 s: f = -0.668423902729, ‖∇f‖ = 4.4315e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 48, time 711.06 s: f = -0.668453519414, ‖∇f‖ = 6.6590e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 49, time 720.88 s: f = -0.668482512627, ‖∇f‖ = 4.7810e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 50, time 729.57 s: f = -0.668522432273, ‖∇f‖ = 4.7205e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 51, time 744.60 s: f = -0.668536269464, ‖∇f‖ = 8.2957e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 52, time 754.55 s: f = -0.668554701367, ‖∇f‖ = 3.4938e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 53, time 763.10 s: f = -0.668564624860, ‖∇f‖ = 3.0996e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 54, time 771.72 s: f = -0.668580402015, ‖∇f‖ = 4.3886e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 55, time 781.60 s: f = -0.668603907002, ‖∇f‖ = 5.3988e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 56, time 799.28 s: f = -0.668617246170, ‖∇f‖ = 5.8694e-03, α = 4.99e-01, m = 20, nfg = 2 +[ Info: LBFGS: iter 57, time 809.22 s: f = -0.668632724020, ‖∇f‖ = 3.2358e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 58, time 817.86 s: f = -0.668645126493, ‖∇f‖ = 3.1763e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 59, time 826.48 s: f = -0.668655398082, ‖∇f‖ = 4.2974e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 60, time 836.41 s: f = -0.668669899756, ‖∇f‖ = 4.4860e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 61, time 845.29 s: f = -0.668685368558, ‖∇f‖ = 3.1222e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 62, time 854.05 s: f = -0.668694965356, ‖∇f‖ = 4.0039e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 63, time 864.05 s: f = -0.668703207322, ‖∇f‖ = 3.3668e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 64, time 872.74 s: f = -0.668712392397, ‖∇f‖ = 3.4980e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 65, time 881.52 s: f = -0.668728646277, ‖∇f‖ = 6.7104e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 66, time 891.65 s: f = -0.668739676358, ‖∇f‖ = 3.7164e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 67, time 900.41 s: f = -0.668745430593, ‖∇f‖ = 2.1495e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 68, time 909.04 s: f = -0.668751516168, ‖∇f‖ = 2.0809e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 69, time 918.90 s: f = -0.668760790816, ‖∇f‖ = 2.5898e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 70, time 927.79 s: f = -0.668768119255, ‖∇f‖ = 7.2679e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 71, time 936.79 s: f = -0.668784264577, ‖∇f‖ = 2.6529e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 72, time 946.72 s: f = -0.668789170407, ‖∇f‖ = 1.8137e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 73, time 955.52 s: f = -0.668795881540, ‖∇f‖ = 2.0901e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 74, time 964.44 s: f = -0.668799082134, ‖∇f‖ = 6.5955e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 75, time 974.47 s: f = -0.668808063314, ‖∇f‖ = 2.8612e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 76, time 983.39 s: f = -0.668814364357, ‖∇f‖ = 1.5758e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 77, time 992.33 s: f = -0.668817946985, ‖∇f‖ = 1.9177e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 78, time 1002.50 s: f = -0.668824278695, ‖∇f‖ = 2.2613e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 79, time 1011.45 s: f = -0.668828127692, ‖∇f‖ = 4.6437e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 80, time 1020.26 s: f = -0.668835066382, ‖∇f‖ = 1.5939e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 81, time 1030.51 s: f = -0.668837216668, ‖∇f‖ = 2.3232e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 82, time 1039.35 s: f = -0.668837924470, ‖∇f‖ = 2.8024e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 83, time 1048.22 s: f = -0.668842790098, ‖∇f‖ = 1.8645e-03, α = 1.00e+00, m = 20, nfg = 1 +[ Info: LBFGS: iter 84, time 1058.49 s: f = -0.668846749446, ‖∇f‖ = 1.3957e-03, α = 1.00e+00, m = 20, nfg = 1 +┌ Warning: LBFGS: not converged to requested tol after 85 iterations and time 1067.39 s: f = -0.668849701737, ‖∇f‖ = 2.0164e-03 └ @ OptimKit ~/.julia/packages/OptimKit/G6i79/src/lbfgs.jl:197 -E = -0.6688497013575809 +E = -0.668849701737108 ```` diff --git a/docs/src/examples/xxz/main.ipynb b/docs/src/examples/xxz/main.ipynb index 144e444c3..8152d1ec3 100644 --- a/docs/src/examples/xxz/main.ipynb +++ b/docs/src/examples/xxz/main.ipynb @@ -58,7 +58,7 @@ "source": [ "J = 1.0\n", "Delta = 1.0\n", - "spin = 1//2\n", + "spin = 1 // 2\n", "symmetry = U1Irrep\n", "lattice = InfiniteSquare(2, 2)\n", "H₀ = heisenberg_XXZ(ComplexF64, symmetry, lattice; J, Delta, spin);" @@ -80,8 +80,8 @@ "cell_type": "code", "source": [ "S_aux = [\n", - " U1Irrep(-1//2) U1Irrep(1//2)\n", - " U1Irrep(1//2) U1Irrep(-1//2)\n", + " U1Irrep(-1 // 2) U1Irrep(1 // 2)\n", + " U1Irrep(1 // 2) U1Irrep(-1 // 2)\n", "]\n", "H = add_physical_charge(H₀, S_aux);" ], @@ -128,9 +128,9 @@ "outputs": [], "cell_type": "code", "source": [ - "boundary_alg = (; tol=1e-8, alg=:simultaneous, trscheme=(; alg=:fixedspace))\n", - "gradient_alg = (; tol=1e-6, alg=:eigsolver, maxiter=10, iterscheme=:diffgauge)\n", - "optimizer_alg = (; tol=1e-4, alg=:lbfgs, maxiter=85, ls_maxiter=3, ls_maxfg=3)\n", + "boundary_alg = (; tol = 1.0e-8, alg = :simultaneous, trscheme = (; alg = :fixedspace))\n", + "gradient_alg = (; tol = 1.0e-6, alg = :eigsolver, maxiter = 10, iterscheme = :diffgauge)\n", + "optimizer_alg = (; tol = 1.0e-4, alg = :lbfgs, maxiter = 85, ls_maxiter = 3, ls_maxfg = 3)\n", "\n", "peps₀ = InfinitePEPS(randn, ComplexF64, physical_spaces, virtual_spaces)\n", "env₀, = leading_boundary(CTMRGEnv(peps₀, V_env), peps₀; boundary_alg...);" @@ -153,7 +153,7 @@ "cell_type": "code", "source": [ "peps, env, E, info = fixedpoint(\n", - " H, peps₀, env₀; boundary_alg, gradient_alg, optimizer_alg, verbosity=3\n", + " H, peps₀, env₀; boundary_alg, gradient_alg, optimizer_alg, verbosity = 3\n", ")\n", "@show E;" ], diff --git a/examples/Cache.toml b/examples/Cache.toml index c761fe45a..141189480 100644 --- a/examples/Cache.toml +++ b/examples/Cache.toml @@ -1,10 +1,10 @@ -bose_hubbard = "918635ca8e256252637bbdbc50ef909f93b2e7eec2275ba3bf662cb529f3988d" -hubbard_su = "d0e20c521ba1965d1db0e38d828512890e0409bc18ea2a92b0abe21767ea0baf" -2d_ising_partition_function = "86bb41ebdc876c1c10b01dfde934c6888fd7025ccafdee921c02039c3b601d3b" -3d_ising_partition_function = "0555e05299dbe1f7abd403d845b84141684fd5dfc483d560de53850d94ad11a7" -boundary_mps = "7b944fd76d58dad280302d3693fee61bbef3fdf1768ebe21525bb2742d932efe" -heisenberg_su = "01257e88355dd4822bfb380ee1b3ce79b5fea9862f4bee130e89a0d9805e1f3d" -xxz = "80e537be77aabf93835dfe721dacc36b96a64142346c26771ebbb65a1c8f2bac" -fermi_hubbard = "5836dda79371470b21347ad6952a875b4d48195f28ded9af4a1fa0e5b8f04c82" -j1j2_su = "fa3a2389e8dcac62e8477cba85a60236e72402045f1d8658fdf94f17d4d96f2e" -heisenberg = "daa4ba5deb5e47a6357312ac7dd8f97bce5e40cf751284dec03e6b61a7150b21" +bose_hubbard = "527a4eb6a5b6d02c59062ed621493d5332cf5ff4f2f7b4cd14fb15c9efdc51c4" +hubbard_su = "95a78abdd94af8ce2219cee2453a74d81f90a8316536c482faebf20563855793" +2d_ising_partition_function = "043e1b0b97197ed611559f4a4683cb8f166c01af82a97f71364f2f5421abe3d2" +3d_ising_partition_function = "baf05623f2b0c496393892be1dfe5c7f72af94ac8c1158db9af5c1aae816c264" +boundary_mps = "430db112b38b4ef30215728f994692e63faa50d085f5c69aad1ee7a7b743431d" +heisenberg_su = "4cedc6a2784417266c007b7ea871c32434e9b837982f846f867a50613f25b15f" +xxz = "1a9b920e4b525b70c5d2b42356f9fd65097eca1845e4642c8b2646f0fe966364" +fermi_hubbard = "217d3df2e606e898599dc7c461e04436800f60804add75b0ec5fb5b18d8dcdbf" +j1j2_su = "ccde4117531a26bf679d5a97bcd002974307989fdcc718966ea69a68644d655c" +heisenberg = "136757a5ba5c7a49a803c49395150d1df6bc1fb6eecb29cc20cd968b3d1bf97d" diff --git a/examples/heisenberg_su/main.jl b/examples/heisenberg_su/main.jl index 29b2c02e1..18d266bbb 100644 --- a/examples/heisenberg_su/main.jl +++ b/examples/heisenberg_su/main.jl @@ -28,7 +28,7 @@ md""" To construct the Heisenberg Hamiltonian as just discussed, we'll use `heisenberg_XYZ` and, in addition, make it real (`real` and `imag` works for `LocalOperator`s) since we want to use PEPS and environments with real entries. We can either initialize the Hamiltonian with -no internal symmetries (`symm = Trivial`) or use the global $U(1)$ symmetry +no internal symmetries (`symm = Trivial`) or use the global spin $U(1)$ symmetry (`symm = U1Irrep`): """ @@ -39,8 +39,9 @@ H = real(heisenberg_XYZ(ComplexF64, symm, InfiniteSquare(Nr, Nc); Jx = 1, Jy = 1 md""" ## Simple updating -We proceed by initializing a random weighted PEPS that will be evolved. First though, we -need to define the appropriate (symmetric) spaces: +We proceed by initializing a random PEPS that will be evolved. +The weights used for simple update are initialized as identity matrices. +First though, we need to define the appropriate (symmetric) spaces: """ Dbond = 4 @@ -57,7 +58,8 @@ else error("not implemented") end -wpeps = InfiniteWeightPEPS(rand, Float64, physical_space, bond_space; unitcell = (Nr, Nc)); +peps = InfinitePEPS(rand, Float64, physical_space, bond_space; unitcell = (Nr, Nc)); +wts = SUWeight(peps); md""" Next, we can start the `SimpleUpdate` routine, successively decreasing the time intervals @@ -73,8 +75,7 @@ trscheme_peps = truncerr(1.0e-10) & truncdim(Dbond) for (dt, tol) in zip(dts, tols) alg = SimpleUpdate(dt, tol, maxiter, trscheme_peps) - result = simpleupdate(wpeps, H, alg; bipartite = true) - global wpeps = result[1] + global peps, wts, = simpleupdate(peps, H, alg, wts; bipartite = true) end md""" @@ -83,8 +84,7 @@ md""" In order to compute observable expectation values, we need to converge a CTMRG environment on the evolved PEPS. Let's do so: """ - -peps = InfinitePEPS(wpeps) ## absorb the weights +normalize!.(peps.A, Inf) env₀ = CTMRGEnv(rand, Float64, peps, env_space) trscheme_env = truncerr(1.0e-10) & truncdim(χenv) env, = leading_boundary( @@ -136,5 +136,5 @@ well as finite bond dimension effects and a lacking extrapolation: E_ref = -0.6675 M_ref = 0.3767 -@show (E - E_ref) / E_ref -@show (mean(M_norms) - M_ref) / E_ref; +@show (E - E_ref) / abs(E_ref) +@show (mean(M_norms) - M_ref) / M_ref; diff --git a/examples/hubbard_su/main.jl b/examples/hubbard_su/main.jl index 3308b6505..d178c16aa 100644 --- a/examples/hubbard_su/main.jl +++ b/examples/hubbard_su/main.jl @@ -32,47 +32,46 @@ t = 1 U = 6 Nr, Nc = 2, 2 H = hubbard_model(Float64, Trivial, Trivial, InfiniteSquare(Nr, Nc); t, U, mu = U / 2); +physical_space = Vect[fℤ₂](0 => 2, 1 => 2); md""" ## Running the simple update algorithm -Next, we'll specify the virtual PEPS bond dimension and define the fermionic physical and -virtual spaces. The simple update algorithm evolves an infinite PEPS with weights on the -virtual bonds, so we here need to intialize an [`InfiniteWeightPEPS`](@ref). By default, -the bond weights will be identity. Unlike in the other examples, we here use tensors with -real `Float64` entries: +Suppose the goal is to use imaginary-time simple update to optimize a PEPS +with bond dimension D = 8, and $2 \times 2$ unit cells. +For a challenging model like the Hubbard model, a naive evolution starting from a +random PEPS at D = 8 will almost always produce a sub-optimal state. +In this example, we shall demonstrate some common practices to improve SU result. + +First, we shall use a small D for the random PEPS initialization, which is chosen as 4 here. +For convenience, here we work with real tensors with `Float64` entries. +The bond weights are still initialized as identity matrices. """ -Dbond = 8 -physical_space = Vect[fℤ₂](0 => 2, 1 => 2) -virtual_space = Vect[fℤ₂](0 => Dbond / 2, 1 => Dbond / 2) -wpeps = InfiniteWeightPEPS(rand, Float64, physical_space, virtual_space; unitcell = (Nr, Nc)); +virtual_space = Vect[fℤ₂](0 => 2, 1 => 2) +peps = InfinitePEPS(rand, Float64, physical_space, virtual_space; unitcell = (Nr, Nc)); +wts = SUWeight(peps); md""" -Let's set the algorithm parameters: The plan is to successively decrease the time interval of -the Trotter-Suzuki as well as the convergence tolerance such that we obtain a more accurate -result at each iteration. To run the simple update, we call [`simpleupdate`](@ref) where we -use the keyword `bipartite=false` - meaning that we use the full $2 \times 2$ unit cell -without assuming a bipartite structure. Thus, we can start evolving: +Starting from the random state, we first use a relatively large evolution time step +`dt = 1e-2`. After convergence at D = 4, to avoid stucking at some bad local minimum, +we first increase D to 12, and drop it back to D = 8 after a while. +Afterwards, we keep D = 8 and gradually decrease `dt` to `1e-4` to improve convergence. """ -dts = [1.0e-2, 1.0e-3, 4.0e-4, 1.0e-4] -tols = [1.0e-6, 1.0e-8, 1.0e-8, 1.0e-8] +dts = [1.0e-2, 1.0e-2, 1.0e-3, 4.0e-4, 1.0e-4] +tols = [1.0e-7, 1.0e-7, 1.0e-8, 1.0e-8, 1.0e-8] +Ds = [4, 12, 8, 8, 8] maxiter = 20000 -for (n, (dt, tol)) in enumerate(zip(dts, tols)) +for (dt, tol, Dbond) in zip(dts, tols, Ds) trscheme = truncerr(1.0e-10) & truncdim(Dbond) alg = SimpleUpdate(dt, tol, maxiter, trscheme) - global wpeps, = simpleupdate(wpeps, H, alg; bipartite = false) + global peps, wts, = simpleupdate( + peps, H, alg, wts; bipartite = false, check_interval = 2000 + ) end -md""" -To obtain the evolved `InfiniteWeightPEPS` as an actual PEPS without weights on the bonds, -we can just call the following constructor: -""" - -peps = InfinitePEPS(wpeps); - md""" ## Computing the ground-state energy @@ -85,11 +84,11 @@ run: χenv₀, χenv = 6, 16 env_space = Vect[fℤ₂](0 => χenv₀ / 2, 1 => χenv₀ / 2) - +normalize!.(peps.A, Inf) env = CTMRGEnv(rand, Float64, peps, env_space) for χ in [χenv₀, χenv] global env, = leading_boundary( - env, peps; alg = :sequential, tol = 1.0e-5, trscheme = truncdim(χ) + env, peps; alg = :sequential, tol = 1.0e-8, maxiter = 50, trscheme = truncdim(χ) ) end @@ -109,4 +108,4 @@ agree: Es_exact = Dict(0 => -1.62, 2 => -0.176, 4 => 0.8603, 6 => -0.6567, 8 => -0.5243) E_exact = Es_exact[U] - U / 2 -@show (E - E_exact) / E_exact; +@show (E - E_exact) / abs(E_exact); diff --git a/examples/j1j2_su/main.jl b/examples/j1j2_su/main.jl index 4bb7b8d5f..8d1b00307 100644 --- a/examples/j1j2_su/main.jl +++ b/examples/j1j2_su/main.jl @@ -25,21 +25,21 @@ Random.seed!(29385293); md""" ## Simple updating a challenging phase -Let's start by initializing an `InfiniteWeightPEPS` for which we set the required parameters -as well as physical and virtual vector spaces. We use the minimal unit cell size -($2 \times 2$) required by the simple update algorithm for Hamiltonians with -next-nearest-neighbour interactions: +Let's start by initializing an `InfinitePEPS` for which we set the required parameters +as well as physical and virtual vector spaces. +The `SUWeight` used by simple update will be initialized to identity matrices. +We use the minimal unit cell size ($2 \times 2$) required by the simple update algorithm +for Hamiltonians with next-nearest-neighbour interactions: """ -Dbond, χenv, symm = 4, 32, U1Irrep -trscheme_env = truncerr(1.0e-10) & truncdim(χenv) +Dbond, symm = 4, U1Irrep Nr, Nc, J1 = 2, 2, 1.0 -## random initialization of 2x2 iPEPS with weights and CTMRGEnv (using real numbers) +## random initialization of 2x2 iPEPS (using real numbers) and SUWeight Pspace = Vect[U1Irrep](1 // 2 => 1, -1 // 2 => 1) Vspace = Vect[U1Irrep](0 => 2, 1 // 2 => 1, -1 // 2 => 1) -Espace = Vect[U1Irrep](0 => χenv ÷ 2, 1 // 2 => χenv ÷ 4, -1 // 2 => χenv ÷ 4) -wpeps = InfiniteWeightPEPS(rand, Float64, Pspace, Vspace; unitcell = (Nr, Nc)); +peps = InfinitePEPS(rand, Float64, Pspace, Vspace; unitcell = (Nr, Nc)); +wts = SUWeight(peps); md""" The value $J_2 / J_1 = 0.5$ corresponds to a [possible spin liquid phase](@cite liu_gapless_2022), @@ -56,8 +56,7 @@ for J2 in 0.1:0.1:0.5 H = real( ## convert Hamiltonian `LocalOperator` to real floats j1_j2_model(ComplexF64, symm, InfiniteSquare(Nr, Nc); J1, J2, sublattice = false), ) - result = simpleupdate(wpeps, H, alg; check_interval) - global wpeps = result[1] + global peps, wts, = simpleupdate(peps, H, alg, wts; check_interval) end md""" @@ -71,19 +70,20 @@ J2 = 0.5 H = real(j1_j2_model(ComplexF64, symm, InfiniteSquare(Nr, Nc); J1, J2, sublattice = false)) for (dt, tol) in zip(dts, tols) alg′ = SimpleUpdate(dt, tol, maxiter, trscheme_peps) - result = simpleupdate(wpeps, H, alg′; check_interval) - global wpeps = result[1] + global peps, wts, = simpleupdate(peps, H, alg′, wts; check_interval) end md""" ## Computing the simple update energy estimate Finally, we measure the ground-state energy by converging a CTMRG environment and computing -the expectation value, where we make sure to normalize by the unit cell size: +the expectation value, where we first normalize tensors in the PEPS: """ -peps = InfinitePEPS(wpeps) -normalize!.(peps.A, Inf) ## normalize PEPS with absorbed weights by largest element +normalize!.(peps.A, Inf) ## normalize each PEPS tensor by largest element +χenv = 32 +trscheme_env = truncerr(1.0e-10) & truncdim(χenv) +Espace = Vect[U1Irrep](0 => χenv ÷ 2, 1 // 2 => χenv ÷ 4, -1 // 2 => χenv ÷ 4) env₀ = CTMRGEnv(rand, Float64, peps, Espace) env, = leading_boundary(env₀, peps; tol = 1.0e-10, alg = :sequential, trscheme = trscheme_env); E = expectation_value(peps, H, env) / (Nr * Nc) diff --git a/src/PEPSKit.jl b/src/PEPSKit.jl index 3231de2fd..27c09f395 100644 --- a/src/PEPSKit.jl +++ b/src/PEPSKit.jl @@ -28,7 +28,6 @@ include("utility/util.jl") include("utility/diffable_threads.jl") include("utility/svd.jl") include("utility/rotations.jl") -include("utility/mirror.jl") include("utility/hook_pullback.jl") include("utility/autoopt.jl") include("utility/retractions.jl") @@ -38,7 +37,6 @@ include("networks/local_sandwich.jl") include("networks/infinitesquarenetwork.jl") include("states/infinitepeps.jl") -include("states/infiniteweightpeps.jl") include("states/infinitepartitionfunction.jl") include("operators/infinitepepo.jl") @@ -49,6 +47,7 @@ include("operators/models.jl") include("environments/ctmrg_environments.jl") include("environments/vumps_environments.jl") +include("environments/suweight.jl") include("algorithms/contractions/ctmrg_contractions.jl") include("algorithms/contractions/localoperator.jl") @@ -104,7 +103,7 @@ export su_iter, su3site_iter, simpleupdate, SimpleUpdate export InfiniteSquareNetwork export InfinitePartitionFunction export InfinitePEPS, InfiniteTransferPEPS -export SUWeight, InfiniteWeightPEPS +export SUWeight export InfinitePEPO, InfiniteTransferPEPO export initialize_mps, initializePEPS export ReflectDepth, ReflectWidth, Rotate, RotateReflect diff --git a/src/algorithms/time_evolution/evoltools.jl b/src/algorithms/time_evolution/evoltools.jl index 2f5e53ff7..0102c7598 100644 --- a/src/algorithms/time_evolution/evoltools.jl +++ b/src/algorithms/time_evolution/evoltools.jl @@ -76,20 +76,18 @@ to get the reduced tensors ``` 2 1 | | - 5 - A ← 3 ====> 4 - X ← 2 1 ← a ← 3 + 5 - A - 3 ====> 4 - X ← 2 1 ← a - 3 | ↘ | ↘ 4 1 3 2 2 1 | | - 5 ← B - 3 ====> 1 ← b → 3 4 → Y - 2 + 5 - B - 3 ====> 1 - b → 3 4 → Y - 2 | ↘ ↘ | 4 1 2 3 ``` """ function _qr_bond(A::PEPSTensor, B::PEPSTensor) - # TODO: relax dual requirement on the bonds - @assert isdual(space(A, 3)) # currently only allow A ← B X, a = leftorth(A, ((2, 4, 5), (1, 3))) Y, b = leftorth(B, ((2, 3, 4), (1, 5))) @assert !isdual(space(a, 1)) @@ -124,7 +122,7 @@ $(SIGNATURES) Apply 2-site `gate` on the reduced matrices `a`, `b` ``` - -1← a -← 3 -← b ← -4 + -1← a --- 3 --- b ← -4 ↓ ↓ 1 2 ↓ ↓ @@ -134,18 +132,21 @@ Apply 2-site `gate` on the reduced matrices `a`, `b` ``` """ function _apply_gate( - a::AbstractTensorMap{T, S}, b::AbstractTensorMap{T, S}, + a::AbstractTensorMap{T, S}, + b::AbstractTensorMap{T, S}, gate::AbstractTensorMap{T, S, 2, 2}, trscheme::TruncationScheme, ) where {T <: Number, S <: ElementarySpace} + V = space(b, 1) + need_flip = isdual(V) @tensor a2b2[-1 -2; -3 -4] := gate[-2 -3; 1 2] * a[-1 1 3] * b[3 2 -4] - trunc = if trscheme isa FixedSpaceTruncation - V = space(b, 1) - truncspace(isdual(V) ? V' : V) - else - trscheme + trunc = (trscheme isa FixedSpaceTruncation) ? truncspace(V) : trscheme + a, s, b, ϵ = tsvd!(a2b2; trunc, alg = TensorKit.SVD()) + a, b = absorb_s(a, s, b) + if need_flip + a, s, b = flip_svd(a, s, b) end - return tsvd!(a2b2; trunc, alg = TensorKit.SVD()) + return a, s, b, ϵ end """ diff --git a/src/algorithms/time_evolution/simpleupdate.jl b/src/algorithms/time_evolution/simpleupdate.jl index 3a095ea1c..c37845b52 100644 --- a/src/algorithms/time_evolution/simpleupdate.jl +++ b/src/algorithms/time_evolution/simpleupdate.jl @@ -19,124 +19,159 @@ end """ $(SIGNATURES) -Simple update of the x-bond `peps.weights[1,r,c]`. +Simple update of the x-bond between `[r,c]` and `[r,c+1]`. ``` - [2,r,c] [2,r,c+1] - ↓ ↓ - [1,r,c-1] ← T[r,c] ← [1,r,c] ←- T[r,c+1] ← [1,r,c+1] - ↓ ↓ - [2,r+1,c] [2,r+1,c+1] + | | + -- T[r,c] -- T[r,c+1] -- + | | ``` """ function _su_xbond!( - row::Int, col::Int, - gate::AbstractTensorMap{T, S, 2, 2}, peps::InfiniteWeightPEPS, + peps::InfinitePEPS, + gate::AbstractTensorMap{T, S, 2, 2}, + env::SUWeight, + row::Int, + col::Int, trscheme::TruncationScheme, ) where {T <: Number, S <: ElementarySpace} Nr, Nc = size(peps) @assert 1 <= row <= Nr && 1 <= col <= Nc cp1 = _next(col, Nc) # absorb environment weights - A, B = peps.vertices[row, col], peps.vertices[row, cp1] - sqrtsA = ntuple(dir -> (dir == EAST), 4) - sqrtsB = ntuple(dir -> (dir == WEST), 4) - A = _absorb_weights(A, peps.weights, row, col, Tuple(1:4), sqrtsA, false) - B = _absorb_weights(B, peps.weights, row, cp1, Tuple(1:4), sqrtsB, false) + A, B = peps.A[row, col], peps.A[row, cp1] + A = absorb_weight(A, env, row, col, (NORTH, SOUTH, WEST); inv = false) + B = absorb_weight(B, env, row, cp1, (NORTH, SOUTH, EAST); inv = false) + normalize!(A, Inf) + normalize!(B, Inf) # apply gate X, a, b, Y = _qr_bond(A, B) a, s, b, ϵ = _apply_gate(a, b, gate, trscheme) A, B = _qr_bond_undo(X, a, b, Y) # remove environment weights - _allfalse = ntuple(Returns(false), 3) - A = _absorb_weights(A, peps.weights, row, col, (NORTH, SOUTH, WEST), _allfalse, true) - B = _absorb_weights(B, peps.weights, row, cp1, (NORTH, SOUTH, EAST), _allfalse, true) + A = absorb_weight(A, env, row, col, (NORTH, SOUTH, WEST); inv = true) + B = absorb_weight(B, env, row, cp1, (NORTH, SOUTH, EAST); inv = true) + normalize!(A, Inf) + normalize!(B, Inf) + normalize!(s, Inf) # update tensor dict and weight on current bond - # (max element of weight is normalized to 1) - peps.vertices[row, col], peps.vertices[row, cp1] = A, B - peps.weights[1, row, col] = s / norm(s, Inf) + peps.A[row, col], peps.A[row, cp1] = A, B + env.data[1, row, col] = s return ϵ end """ - su_iter(gate::LocalOperator, peps::InfiniteWeightPEPS, alg::SimpleUpdate; bipartite::Bool=false) +Simple update of the y-bond between `[r,c]` and `[r-1,c]`. +``` + | + --T[r-1,c] -- + | + -- T[r,c] --- + | +``` +""" +function _su_ybond!( + peps::InfinitePEPS, + gate::AbstractTensorMap{T, S, 2, 2}, + env::SUWeight, + row::Int, + col::Int, + trscheme::TruncationScheme, + ) where {T <: Number, S <: ElementarySpace} + Nr, Nc = size(peps) + @assert 1 <= row <= Nr && 1 <= col <= Nc + rm1 = _prev(row, Nr) + # absorb environment weights + A, B = peps.A[row, col], peps.A[rm1, col] + A = absorb_weight(A, env, row, col, (EAST, SOUTH, WEST); inv = false) + B = absorb_weight(B, env, rm1, col, (NORTH, EAST, WEST); inv = false) + normalize!(A, Inf) + normalize!(B, Inf) + # apply gate + X, a, b, Y = _qr_bond(rotr90(A), rotr90(B)) + a, s, b, ϵ = _apply_gate(a, b, gate, trscheme) + A, B = rotl90.(_qr_bond_undo(X, a, b, Y)) + # remove environment weights + A = absorb_weight(A, env, row, col, (EAST, SOUTH, WEST); inv = true) + B = absorb_weight(B, env, rm1, col, (NORTH, EAST, WEST); inv = true) + # update tensor dict and weight on current bond + normalize!(A, Inf) + normalize!(B, Inf) + normalize!(s, Inf) + peps.A[row, col], peps.A[rm1, col] = A, B + env.data[2, row, col] = s + return ϵ +end + +""" + su_iter(peps::InfinitePEPS, gate::LocalOperator, alg::SimpleUpdate, env::SUWeight; bipartite::Bool=false) One round of simple update on `peps` applying the nearest neighbor `gate`. When the input `peps` has a unit cell size of (2, 2), one can set `bipartite = true` to enforce the bipartite structure. """ function su_iter( - gate::LocalOperator, peps::InfiniteWeightPEPS, alg::SimpleUpdate; bipartite::Bool = false + peps::InfinitePEPS, + gate::LocalOperator, + alg::SimpleUpdate, + env::SUWeight; + bipartite::Bool = false, ) @assert size(gate.lattice) == size(peps) Nr, Nc = size(peps) - if bipartite - @assert Nr == Nc == 2 - end + bipartite && (@assert Nr == Nc == 2) (Nr >= 2 && Nc >= 2) || throw( ArgumentError("iPEPS unit cell size for simple update should be no smaller than (2, 2)."), ) - peps2 = deepcopy(peps) - gate_mirrored = mirror_antidiag(gate) - for direction in 1:2 - # mirror the y-weights to x-direction - # to update them using code for x-weights - if direction == 2 - peps2 = mirror_antidiag(peps2) - trscheme = mirror_antidiag(alg.trscheme) - else - trscheme = alg.trscheme - end + peps2, env2 = deepcopy(peps), deepcopy(env) + for r in 1:Nr, c in 1:Nc + term = get_gateterm(gate, (CartesianIndex(r, c), CartesianIndex(r, c + 1))) + trscheme = truncation_scheme(alg.trscheme, 1, r, c) + _su_xbond!(peps2, term, env2, r, c, trscheme) if bipartite - for r in 1:2 - rp1 = _next(r, 2) - term = get_gateterm( - direction == 1 ? gate : gate_mirrored, - (CartesianIndex(r, 1), CartesianIndex(r, 2)), - ) - ϵ = _su_xbond!(r, 1, term, peps2, truncation_scheme(trscheme, 1, r, 1)) - peps2.vertices[rp1, 2] = deepcopy(peps2.vertices[r, 1]) - peps2.vertices[rp1, 1] = deepcopy(peps2.vertices[r, 2]) - peps2.weights[1, rp1, 2] = deepcopy(peps2.weights[1, r, 1]) - end - else - for site in CartesianIndices(peps2.vertices) - r, c = Tuple(site) - term = get_gateterm( - direction == 1 ? gate : gate_mirrored, - (CartesianIndex(r, c), CartesianIndex(r, c + 1)), - ) - ϵ = _su_xbond!(r, c, term, peps2, truncation_scheme(trscheme, 1, r, c)) - end + rp1, cp1 = _next(r, Nr), _next(c, Nc) + peps2.A[rp1, cp1] = deepcopy(peps2.A[r, c]) + peps2.A[rp1, c] = deepcopy(peps2.A[r, cp1]) + env2.data[1, rp1, cp1] = deepcopy(env2.data[1, r, c]) end - if direction == 2 - peps2 = mirror_antidiag(peps2) + term = get_gateterm(gate, (CartesianIndex(r, c), CartesianIndex(r - 1, c))) + trscheme = truncation_scheme(alg.trscheme, 2, r, c) + _su_ybond!(peps2, term, env2, r, c, trscheme) + if bipartite + rm1, cm1 = _prev(r, Nr), _prev(c, Nc) + peps2.A[rm1, cm1] = deepcopy(peps2.A[r, c]) + peps2.A[r, cm1] = deepcopy(peps2.A[rm1, c]) + env2.data[2, rm1, cm1] = deepcopy(env2.data[2, r, c]) end end - return peps2 + return peps2, env2 end """ Perform simple update with Hamiltonian `ham` containing up to nearest neighbor interaction terms. """ function _simpleupdate2site( - peps::InfiniteWeightPEPS, ham::LocalOperator, alg::SimpleUpdate; - bipartite::Bool = false, check_interval::Int = 500, + peps::InfinitePEPS, + ham::LocalOperator, + alg::SimpleUpdate, + env::SUWeight; + bipartite::Bool = false, + check_interval::Int = 500, ) time_start = time() # exponentiating the 2-site Hamiltonian gate gate = get_expham(ham, alg.dt) wtdiff = 1.0 - wts0 = deepcopy(peps.weights) + env0 = deepcopy(env) for count in 1:(alg.maxiter) time0 = time() - peps = su_iter(gate, peps, alg; bipartite) - wtdiff = compare_weights(peps.weights, wts0) + peps, env = su_iter(peps, gate, alg, env; bipartite) + wtdiff = compare_weights(env, env0) converge = (wtdiff < alg.tol) cancel = (count == alg.maxiter) - wts0 = deepcopy(peps.weights) + env0 = deepcopy(env) time1 = time() if ((count == 1) || (count % check_interval == 0) || converge || cancel) - @info "Space of x-weight at [1, 1] = $(space(peps.weights[1, 1, 1], 1))" + @info "Space of x-weight at [1, 1] = $(space(env[1, 1, 1], 1))" label = (converge ? "conv" : (cancel ? "cancel" : "iter")) message = @sprintf( "SU %s %-7d: dt = %.0e, weight diff = %.3e, time = %.3f sec\n", @@ -146,11 +181,11 @@ function _simpleupdate2site( end converge && break end - return peps, wtdiff + return peps, env, wtdiff end """ - simpleupdate(peps::InfiniteWeightPEPS, ham::LocalOperator, alg::SimpleUpdate; + simpleupdate(peps::InfinitePEPS, ham::LocalOperator, alg::SimpleUpdate, env::SUWeight; bipartite::Bool=false, force_3site::Bool=false, check_interval::Int=500) Perform a simple update on the infinite PEPS (`peps`) using the Hamiltonian `ham`, which can contain up to next-nearest-neighbor interaction terms. @@ -166,8 +201,13 @@ Perform a simple update on the infinite PEPS (`peps`) using the Hamiltonian `ham - The 3-site simple update algorithm is incompatible with a bipartite PEPS. Using `bipartite = true` with either `force_3site = true` or a `ham` with next-nearest neighbor terms is not allowed. """ function simpleupdate( - peps::InfiniteWeightPEPS, ham::LocalOperator, alg::SimpleUpdate; - bipartite::Bool = false, force_3site::Bool = false, check_interval::Int = 500, + peps::InfinitePEPS, + ham::LocalOperator, + alg::SimpleUpdate, + env::SUWeight; + bipartite::Bool = false, + force_3site::Bool = false, + check_interval::Int = 500, ) # determine if Hamiltonian contains nearest neighbor terms only nnonly = is_nearest_neighbour(ham) @@ -175,8 +215,8 @@ function simpleupdate( @assert !(bipartite && use_3site) "3-site simple update is incompatible with bipartite lattice." # TODO: check SiteDependentTruncation is compatible with bipartite structure if use_3site - return _simpleupdate3site(peps, ham, alg; check_interval) + return _simpleupdate3site(peps, ham, alg, env; check_interval) else - return _simpleupdate2site(peps, ham, alg; bipartite, check_interval) + return _simpleupdate2site(peps, ham, alg, env; bipartite, check_interval) end end diff --git a/src/algorithms/time_evolution/simpleupdate3site.jl b/src/algorithms/time_evolution/simpleupdate3site.jl index 3c2d2b17f..cc97b3ebe 100644 --- a/src/algorithms/time_evolution/simpleupdate3site.jl +++ b/src/algorithms/time_evolution/simpleupdate3site.jl @@ -205,10 +205,10 @@ such that the contraction of `Pa`, `s`, `Pb` is identity when `trunc = notrunc`, The arrows between `Pa`, `s`, `Pb` are ``` - rev = false: - Pa ← s ← Pb - + rev = false: - Pa --←-- Pb - 1 ← s ← 2 - rev = true: - Pa → s → Pb - + rev = true: - Pa --→-- Pb - 2 → s → 1 ``` """ @@ -221,12 +221,10 @@ function _proj_from_RL( rl = r * l @assert isdual(domain(rl, 1)) == isdual(codomain(rl, 1)) u, s, vh, ϵ = tsvd!(rl; trunc) - sinv = PEPSKit.sdiag_pow(s, -1) + sinv = PEPSKit.sdiag_pow(s, -1 / 2) Pa, Pb = l * vh' * sinv, sinv * u' * r if rev Pa, s, Pb = flip_svd(Pa, s, Pb) - s = permute(s, ((2,), (1,))) - @assert all(s.data .>= 0.0) end return Pa, s, Pb, ϵ end @@ -242,8 +240,7 @@ function _get_allprojs( @assert length(trschemes) == N - 1 projs_errs = map(1:(N - 1)) do i trunc = if isa(trschemes[i], FixedSpaceTruncation) - V = space(Ms[i + 1], 1) - truncspace(isdual(V) ? V' : V) + truncspace(space(Ms[i + 1], 1)) else trschemes[i] end @@ -329,14 +326,12 @@ function apply_gatempo!( ) where {T1 <: PEPSTensor, T2 <: AbstractTensorMap, E <: TruncationScheme} @assert length(Ms) == length(gs) revs = [isdual(space(M, 1)) for M in Ms[2:end]] - @assert !all(revs) _apply_gatempo!(Ms, gs) wts, ϵs, = _cluster_truncate!(Ms, trschemes, revs) return wts, ϵs end const openaxs_se = [(NORTH, SOUTH, WEST), (EAST, SOUTH), (NORTH, EAST, WEST)] -const sqrtwts_se = [ntuple(dir -> !(dir in idxs), 4) for idxs in openaxs_se] const invperms_se = [((2,), (3, 5, 4, 1)), ((2,), (5, 3, 4, 1)), ((2,), (5, 3, 1, 4))] const perms_se = [ begin @@ -354,56 +349,60 @@ Obtain the following 3-site cluster c c+1 ``` """ -function get_3site_se(peps::InfiniteWeightPEPS, row::Int, col::Int) +function get_3site_se(peps::InfinitePEPS, env::SUWeight, row::Int, col::Int) Nr, Nc = size(peps) rm1, cp1 = _prev(row, Nr), _next(col, Nc) coords_se = [(row, col), (row, cp1), (rm1, cp1)] cluster = collect( permute( - _absorb_weights( - peps.vertices[CartesianIndex(coord)], peps.weights, - coord[1], coord[2], Tuple(1:4), sqrtwts, false, + absorb_weight( + peps.A[CartesianIndex(coord)], env, coord[1], coord[2], openaxs; inv = false ), perm, - ) for (coord, sqrtwts, perm) in zip(coords_se, sqrtwts_se, perms_se) + ) for (coord, openaxs, perm) in zip(coords_se, openaxs_se, perms_se) ) return cluster end function _su3site_se!( - row::Int, col::Int, gs::Vector{T}, peps::InfiniteWeightPEPS, trschemes::Vector{E} + peps::InfinitePEPS, + gs::Vector{T}, + env::SUWeight, + row::Int, + col::Int, + trschemes::Vector{E}, ) where {T <: AbstractTensorMap, E <: TruncationScheme} Nr, Nc = size(peps) @assert 1 <= row <= Nr && 1 <= col <= Nc rm1, cp1 = _prev(row, Nr), _next(col, Nc) # southwest 3-site cluster - Ms = get_3site_se(peps, row, col) + Ms = get_3site_se(peps, env, row, col) + normalize!.(Ms, Inf) # sites in the cluster coords = ((row, col), (row, cp1), (rm1, cp1)) # weights in the cluster wt_idxs = ((1, row, col), (2, row, cp1)) wts, ϵ = apply_gatempo!(Ms, gs; trschemes) for (wt, wt_idx) in zip(wts, wt_idxs) - peps.weights[CartesianIndex(wt_idx)] = wt / norm(wt, Inf) + env[CartesianIndex(wt_idx)] = normalize(wt, Inf) end - for (M, coord, invperm, axs) in zip(Ms, coords, invperms_se, openaxs_se) + for (M, coord, invperm, openaxs) in zip(Ms, coords, invperms_se, openaxs_se) # restore original axes order M = permute(M, invperm) # remove weights on open axes of the cluster - _allfalse = ntuple(Returns(false), length(axs)) - M = _absorb_weights(M, peps.weights, coord[1], coord[2], axs, _allfalse, true) - peps.vertices[CartesianIndex(coord)] = M * (100.0 / norm(M, Inf)) + M = absorb_weight(M, env, coord[1], coord[2], openaxs; inv = true) + peps.A[CartesianIndex(coord)] = normalize(M, Inf) end return nothing end """ - su3site_iter(gatempos, peps::InfiniteWeightPEPS, alg::SimpleUpdate) + su3site_iter(peps::InfinitePEPS, gatempos, alg::SimpleUpdate, env::SUWeight) One round of 3-site simple update. """ function su3site_iter( - gatempos::Vector{G}, peps::InfiniteWeightPEPS, alg::SimpleUpdate + peps::InfinitePEPS, gatempos::Vector{G}, alg::SimpleUpdate, env::SUWeight ) where {G <: AbstractMatrix} Nr, Nc = size(peps) (Nr >= 2 && Nc >= 2) || throw( @@ -411,29 +410,33 @@ function su3site_iter( "iPEPS unit cell size for simple update should be no smaller than (2, 2)." ), ) - peps2 = deepcopy(peps) + peps2, env2 = deepcopy(peps), deepcopy(env) trscheme = alg.trscheme for i in 1:4 - for site in CartesianIndices(peps2.vertices) + for site in CartesianIndices(peps2.A) r, c = site[1], site[2] gs = gatempos[i][r, c] trschemes = [ truncation_scheme(trscheme, 1, r, c) truncation_scheme(trscheme, 2, r, _next(c, size(peps2)[2])) ] - _su3site_se!(r, c, gs, peps2, trschemes) + _su3site_se!(peps2, gs, env2, r, c, trschemes) end - peps2 = rotl90(peps2) + peps2, env2 = rotl90(peps2), rotl90(env2) trscheme = rotl90(trscheme) end - return peps2 + return peps2, env2 end """ Perform 3-site simple update for Hamiltonian `ham`. """ function _simpleupdate3site( - peps::InfiniteWeightPEPS, ham::LocalOperator, alg::SimpleUpdate; check_interval::Int = 500 + peps::InfinitePEPS, + ham::LocalOperator, + alg::SimpleUpdate, + env::SUWeight; + check_interval::Int = 500, ) time_start = time() # convert Hamiltonian to 3-site exponentiated gate MPOs @@ -444,17 +447,17 @@ function _simpleupdate3site( _get_gatempos_se(rotr90(ham), alg.dt), ] wtdiff = 1.0 - wts0 = deepcopy(peps.weights) + env0 = deepcopy(env) for count in 1:(alg.maxiter) time0 = time() - peps = su3site_iter(gatempos, peps, alg) - wtdiff = compare_weights(peps.weights, wts0) + peps, env = su3site_iter(peps, gatempos, alg, env) + wtdiff = compare_weights(env, env0) converge = (wtdiff < alg.tol) cancel = (count == alg.maxiter) - wts0 = deepcopy(peps.weights) + env0 = deepcopy(env) time1 = time() if ((count == 1) || (count % check_interval == 0) || converge || cancel) - @info "Space of x-weight at [1, 1] = $(space(peps.weights[1, 1, 1], 1))" + @info "Space of x-weight at [1, 1] = $(space(env[1, 1, 1], 1))" label = (converge ? "conv" : (cancel ? "cancel" : "iter")) message = @sprintf( "SU %s %-7d: dt = %.0e, weight diff = %.3e, time = %.3f sec\n", @@ -464,5 +467,5 @@ function _simpleupdate3site( end converge && break end - return peps, wtdiff + return peps, env, wtdiff end diff --git a/src/algorithms/truncation/truncationschemes.jl b/src/algorithms/truncation/truncationschemes.jl index a7e70265c..f3b77a02a 100644 --- a/src/algorithms/truncation/truncationschemes.jl +++ b/src/algorithms/truncation/truncationschemes.jl @@ -43,35 +43,6 @@ function truncation_scheme( return trscheme.trschemes[direction, row, col] end -# Mirror a TruncationScheme by its anti-diagonal line. -# When the number of directions is 2, it swaps the first and second direction, consistent with xbonds and ybonds, respectively. -# When the number of directions is 4, it swaps the first and second, and third and fourth directions, consistent with the order NORTH, EAST, SOUTH, WEST. -mirror_antidiag(trscheme::TruncationScheme) = trscheme -function mirror_antidiag(trscheme::SiteDependentTruncation) - directions = size(trscheme.trschemes)[1] - if directions == 2 - trschemes_mirrored = stack( - ( - mirror_antidiag(trscheme.trschemes[EAST, :, :]), - mirror_antidiag(trscheme.trschemes[NORTH, :, :]), - ); - dims = 1, - ) - elseif directions == 4 - trschemes_mirrored = stack( - ( - mirror_antidiag(trscheme.trschemes[EAST, :, :]), - mirror_antidiag(trscheme.trschemes[NORTH, :, :]), - mirror_antidiag(trscheme.trschemes[WEST, :, :]), - mirror_antidiag(trscheme.trschemes[SOUTH, :, :]), - ) - ) - else - error("Unsupported number of directions for mirror_antidiag: $directions") - end - return SiteDependentTruncation(trschemes_mirrored) -end - # TODO: type piracy Base.rotl90(trscheme::TruncationScheme) = trscheme diff --git a/src/environments/suweight.jl b/src/environments/suweight.jl new file mode 100644 index 000000000..2dbaa3415 --- /dev/null +++ b/src/environments/suweight.jl @@ -0,0 +1,354 @@ +""" + const PEPSWeight + +Default type for PEPS bond weights with 2 virtual indices. +""" +const PEPSWeight{T, S} = AbstractTensorMap{T, S, 1, 1} + +""" + struct SUWeight{E<:PEPSWeight} + +Schmidt bond weights used in simple/cluster update. +Weight elements are always real and non-negative. +The domain and codomain of each weight matrix must be an un-dualed `ElementarySpace`. + +For a square lattice InfinitePEPS, the weights are placed as +``` + | + -T[r-1,c]- + | + wt[2,r,c] + | | + --T[r,c]--wt[1,r,c]--T[r,c+1]-- + | | +``` + +Axis order of each weight matrix is +``` + x-weights: + 1 ← x ← 2 or 2 → x → 1 + + y-weights: + 2 1 + ↓ ↑ + y or y + ↓ ↑ + 1 2 +``` + +## Fields + +$(TYPEDFIELDS) + +## Constructors + + SUWeight(wts_mats::AbstractMatrix{E}...) where {E<:PEPSWeight} +""" +struct SUWeight{E <: PEPSWeight} + data::Array{E, 3} + SUWeight{E}(data::Array{E, 3}) where {E} = new{E}(data) +end + +function SUWeight(data::Array{E, 3}) where {E <: PEPSWeight} + scalartype(data) <: Real || error("Weight elements must be real numbers.") + for wt in data + isa(wt, DiagonalTensorMap) || + error("Each weight matrix should be a DiagonalTensorMap") + domain(wt, 1) == codomain(wt, 1) || + error("Domain and codomain of each weight matrix must be the same.") + !isdual(codomain(wt, 1)) || + error("Domain and codomain of each weight matrix cannot be a dual space.") + all(wt.data .>= 0) || error("Weight elements must be non-negative.") + end + return SUWeight{E}(data) +end + +function SUWeight(wts_mats::AbstractMatrix{E}...) where {E <: PEPSWeight} + n_mat = length(wts_mats) + Nr, Nc = size(wts_mats[1]) + @assert all((Nr, Nc) == size(wts_mat) for wts_mat in wts_mats) + weights = collect( + wts_mats[d][r, c] for (d, r, c) in Iterators.product(1:n_mat, 1:Nr, 1:Nc) + ) + return SUWeight(weights) +end + +""" + SUWeight(Nspaces::M, [Espaces::M]) where {M<:AbstractMatrix{<:Union{Int,ElementarySpace}}} + +Create an SUWeight by specifying the vertical (north) or horizontal (east) virtual bond spaces. +Each individual space can be specified as either an `Int` or an `ElementarySpace`. +The weights are initialized as identity matrices of element type `Float64`. +""" +function SUWeight( + Nspaces::M, Espaces::M = Nspaces + ) where {M <: AbstractMatrix{<:Union{Int, ElementarySpace}}} + @assert all(!isdual, Nspaces) + @assert all(!isdual, Espaces) + @assert size(Nspaces) == size(Espaces) + Nr, Nc = size(Nspaces) + weights = map(Iterators.product(1:2, 1:Nr, 1:Nc)) do (d, r, c) + V = (d == 1 ? Espaces[r, c] : Nspaces[r, c]) + DiagonalTensorMap(ones(reduceddim(V)), V) + end + return SUWeight(weights) +end + +""" + SUWeight(Nspace::S, Espace::S=Nspace; unitcell::Tuple{Int,Int}=(1, 1)) where {S<:ElementarySpace} + +Create an SUWeight by specifying its vertical (north) and horizontal (east) +as `ElementarySpace`s) and unit cell size. +The weights are initialized as identity matrices of element type `Float64`. +""" +function SUWeight( + Nspace::S, Espace::S = Nspace; unitcell::Tuple{Int, Int} = (1, 1) + ) where {S <: ElementarySpace} + return SUWeight(fill(Nspace, unitcell), fill(Espace, unitcell)) +end + +""" + SUWeight(peps::InfinitePEPS) + +Create an SUWeight for a given InfinitePEPS. +The weights are initialized as identity matrices of element type `Float64`. +""" +function SUWeight(peps::InfinitePEPS) + Nspaces = map(peps.A) do t + V = domain(t, NORTH) + isdual(V) ? V' : V + end + Espaces = map(peps.A) do t + V = domain(t, EAST) + isdual(V) ? V' : V + end + return SUWeight(Nspaces, Espaces) +end + +## Shape and size +Base.size(W::SUWeight) = size(W.data) +Base.size(W::SUWeight, i) = size(W.data, i) +Base.length(W::SUWeight) = length(W.data) +Base.eltype(W::SUWeight) = eltype(typeof(W)) +Base.eltype(::Type{SUWeight{E}}) where {E} = E +VI.scalartype(::Type{T}) where {T <: SUWeight} = scalartype(eltype(T)) + +Base.getindex(W::SUWeight, args...) = Base.getindex(W.data, args...) +Base.setindex!(W::SUWeight, args...) = (Base.setindex!(W.data, args...); W) +Base.axes(W::SUWeight, args...) = axes(W.data, args...) +Base.iterate(W::SUWeight, args...) = iterate(W.data, args...) + +## spaces +TensorKit.spacetype(w::SUWeight) = spacetype(typeof(w)) +TensorKit.spacetype(::Type{T}) where {E, T <: SUWeight{E}} = spacetype(E) +TensorKit.sectortype(w::SUWeight) = sectortype(typeof(w)) +TensorKit.sectortype(::Type{<:SUWeight{T}}) where {T} = sectortype(spacetype(T)) + +## (Approximate) equality +function Base.:(==)(wts1::SUWeight, wts2::SUWeight) + return wts1.data == wts2.data +end +function Base.isapprox(wts1::SUWeight, wts2::SUWeight; kwargs...) + for (wt1, wt2) in zip(wts1, wts2) + !isapprox(wt1, wt2; kwargs...) && return false + end + return true +end + +function compare_weights(wts1::SUWeight, wts2::SUWeight) + @assert size(wts1) == size(wts2) + return sum(_singular_value_distance, zip(wts1.data, wts2.data)) / length(wts1) +end + +function Base.show(io::IO, ::MIME"text/plain", wts::SUWeight) + println(io, typeof(wts)) + for idx in CartesianIndices(wts.data) + println(io, Tuple(idx), ":") + for (k, b) in blocks(wts.data[idx]) + println(io, k, " = ", diag(b)) + end + end + return nothing +end + +""" + absorb_weight(t::PEPSTensor, weights::SUWeight, row::Int, col::Int, ax::Int; inv::Bool=false) + absorb_weight(t::PEPSTensor, weights::SUWeight, row::Int, col::Int, ax::NTuple{N,Int}; inv::Bool=false) + +Absorb or remove environment weight on an axis of vertex tensor `t` known to be located at +position (`row`, `col`) in the unit cell. Weights around the tensor at `(row, col)` are +``` + | + [2,r,c] + | + - [1,r,c-1] - T[r,c] - [1,r,c] - + | + [1,r+1,c] + | +``` + +## Arguments + +- `t::T` : The vertex tensor to which the weight will be absorbed. The first axis of `t` should be the physical axis. +- `weights::SUWeight` : All simple update weights. +- `row::Int` : The row index specifying the position in the tensor network. +- `col::Int` : The column index specifying the position in the tensor network. +- `ax::Int` : The axis into which the weight is absorbed, taking values from 1 to 4, standing for north, east, south, west respectively. + +## Keyword arguments + +- `inv::Bool=false` : If `true`, the inverse square root of the weight is absorbed. + +## Examples + +```julia +# Absorb the weight into the north axis of tensor at position (2, 3) +absorb_weight(t, weights, 2, 3, 1) + +# Absorb the inverse of (i.e. remove) the weight into the east axis +absorb_weight(t, weights, 2, 3, 2; inv=true) +``` +""" +function absorb_weight( + t::PEPSTensor, weights::SUWeight, row::Int, col::Int, ax::Int; inv::Bool = false + ) + Nr, Nc = size(weights)[2:end] + @assert 1 <= row <= Nr && 1 <= col <= Nc + @assert 1 <= ax <= 4 + pow = inv ? -1 / 2 : 1 / 2 + wt = sdiag_pow( + if ax == NORTH + weights[2, row, col] + elseif ax == EAST + weights[1, row, col] + elseif ax == SOUTH + weights[2, _next(row, Nr), col] + else # WEST + weights[1, row, _prev(col, Nc)] + end, + pow, + ) + axp1 = ax + 1 + t_idx = collect((n - 1 == ax) ? 1 : -n for n in 1:5) + wt_idx = if isdual(space(t, ax + 1)) + [1, -axp1] # t ← wt + else + [-axp1, 1] # t → wt + end + return permute(ncon((t, wt), (t_idx, wt_idx)), ((1,), Tuple(2:5))) +end +function absorb_weight( + t::PEPSTensor, + weights::SUWeight, + row::Int, + col::Int, + ax::NTuple{N, Int}; + inv::Bool = false, + ) where {N} + t2 = copy(t) + for a in ax + t2 = absorb_weight(t2, weights, row, col, a; inv) + end + return t2 +end + +#= Rotation of SUWeight. Example: 3 x 3 network + +- Original + ``` + | | | + y₁₁ y₁₂ y₁₃ + | | | + ..x₁₃...┼---x₁₁---┼---x₁₂---┼---x₁₃--- + | | | + y₂₁ y₂₂ y₂₃ | + | | | y + ..x₂₃...┼---x₂₁---┼---x₂₂---┼---x₂₃--- | + | | | + y₃₁ y₃₂ y₃₃ -- x -- + | | | + ..x₃₃...┼---x₃₁---┼---x₃₂---┼---x₃₃--- + : : : + y₁₁ y₁₂ y₁₃ + : : : + ``` + +- `rotl90`: + ``` + | | | + x₁₃ x₂₃ x₃₃ + | | | + --y₁₃---┼---y₂₃---┼---y₃₃---┼...y₁₃... + | | | + x₁₂ x₂₂ x₃₂ | + | | | x + --y₁₂---┼---y₂₂---┼---y₃₂---┼...y₁₂... | + | | | + x₁₁ x₂₁ x₃₁ -- y -- + | | | + --y₁₁---┼---y₂₁---┼---y₃₁---┼...y₁₁... + : : : + x₁₃ x₂₃ x₃₃ + : : : + ``` + - x/y-weights are exchanged. + - need to further move 1st column of x-weights to the last column. + +- `rotr90`: + ``` + : : : + x₃₃ x₂₃ x₁₃ + : : : + ..y₁₁...┼---y₃₁---┼---y₂₁---┼---y₁₁--- + | | | + x₃₁ x₂₁ x₁₁ -- y -- + | | | + ..y₁₂...┼---y₃₂---┼---y₂₂---┼---y₁₂--- | + | | | x + x₃₂ x₂₂ x₁₂ | + | | | + ..y₁₃...┼---y₃₃---┼---y₂₃---┼---y₁₃--- + | | | + x₃₃ x₂₃ x₁₃ + | | | + ``` + - x/y-weights are exchanged. + - need to further move last row of y-weights to the 1st row. + +- `rot180`: + ``` + : : : + y₁₃ y₁₂ y₁₁ + : : : + --x₃₃---┼---x₃₂---┼---x₃₁---┼...x₃₃... + | | | + y₃₃ y₃₂ y₃₁ -- x -- + | | | + --x₂₃---┼---x₂₂---┼---x₂₁---┼...x₂₃... | + | | | y + y₂₃ y₂₂ y₂₁ | + | | | + --x₁₃---┼---x₁₂---┼---x₁₁---┼...x₁₃... + | | | + y₁₃ y₁₂ y₁₁ + | | | + ``` + - need to move 1st column of x-weights to the last column. + - need to move last row of y-weights to the 1st row. +=# + +function Base.rotl90(wts::SUWeight) + wts_x = circshift(rotl90(wts[2, :, :]), (0, -1)) + wts_y = rotl90(wts[1, :, :]) + return SUWeight(wts_x, wts_y) +end +function Base.rotr90(wts::SUWeight) + wts_x = rotr90(wts[2, :, :]) + wts_y = circshift(rotr90(wts[1, :, :]), (1, 0)) + return SUWeight(wts_x, wts_y) +end +function Base.rot180(wts::SUWeight) + wts_x = circshift(rot180(wts[1, :, :]), (0, -1)) + wts_y = circshift(rot180(wts[2, :, :]), (1, 0)) + return SUWeight(wts_x, wts_y) +end diff --git a/src/networks/tensors.jl b/src/networks/tensors.jl index 055dc374a..53a9ed7ed 100644 --- a/src/networks/tensors.jl +++ b/src/networks/tensors.jl @@ -78,7 +78,6 @@ function PEPSTensor( return f(T, ℂ^Pspace ← ℂ^Nspace ⊗ ℂ^Espace ⊗ (ℂ^Sspace)' ⊗ (ℂ^Wspace)') end -mirror_antidiag(t::PEPSTensor) = permute(t, ((1,), (3, 2, 5, 4))) Base.rotl90(t::PEPSTensor) = permute(t, ((1,), (3, 4, 5, 2))) Base.rotr90(t::PEPSTensor) = permute(t, ((1,), (5, 2, 3, 4))) Base.rot180(t::PEPSTensor) = permute(t, ((1,), (4, 5, 2, 3))) diff --git a/src/operators/localoperator.jl b/src/operators/localoperator.jl index ede181afd..d7eb727f2 100644 --- a/src/operators/localoperator.jl +++ b/src/operators/localoperator.jl @@ -134,39 +134,15 @@ end Base.:-(O::LocalOperator) = -1 * O Base.:-(O1::LocalOperator, O2::LocalOperator) = O1 + (-O2) -# Rotation and mirroring +# Rotation # ---------------------- -""" - mirror_antidiag(site::CartesianIndex{2}, (Nrow, Ncol)::NTuple{2,Int}) - -Get the position of `site` after reflection about -the anti-diagonal line of a unit cell of size `(Nrow, Ncol)`. -""" -function mirror_antidiag(site::CartesianIndex{2}, (Nrow, Ncol)::NTuple{2, Int}) - r, c = site[1], site[2] - return CartesianIndex(Ncol - c + 1, Nrow - r + 1) -end - # rotation of a lattice site +# TODO: type piracy Base.rotl90(site::CartesianIndex{2}) = CartesianIndex(2 - site[2], site[1]) Base.rotr90(site::CartesianIndex{2}) = CartesianIndex(site[2], 2 - site[1]) Base.rot180(site::CartesianIndex{2}) = CartesianIndex(2 - site[1], 2 - site[2]) -""" - mirror_antidiag(H::LocalOperator) - -Mirror a `LocalOperator` across the anti-diagonal axis of its lattice. -""" -function mirror_antidiag(H::LocalOperator) - lattice2 = mirror_antidiag(physicalspace(H)) - terms2 = ( - (Tuple(mirror_antidiag(site, size(H.lattice)) for site in sites) => op) for - (sites, op) in H.terms - ) - return LocalOperator(lattice2, terms2...) -end - function Base.rotr90(H::LocalOperator) lattice2 = rotr90(H.lattice) terms2 = ((Tuple(rotr90(site) for site in sites) => op) for (sites, op) in H.terms) diff --git a/src/states/infiniteweightpeps.jl b/src/states/infiniteweightpeps.jl deleted file mode 100644 index 93f86b4b5..000000000 --- a/src/states/infiniteweightpeps.jl +++ /dev/null @@ -1,538 +0,0 @@ -""" - const PEPSWeight - -Default type for PEPS bond weights with 2 virtual indices, conventionally ordered as: ``wt : WS ← EN``. -`WS`, `EN` denote the west/south, east/north spaces for x/y-weights on the square lattice, respectively. -""" -const PEPSWeight{T, S} = AbstractTensorMap{T, S, 1, 1} - -""" - struct SUWeight{E<:PEPSWeight} - -Schmidt bond weights used in simple/cluster update. -Weight elements are always real and non-negative. -The domain and codomain of each weight matrix -must be an un-dualed `ElementarySapce`. - -## Fields - -$(TYPEDFIELDS) - -## Constructors - - SUWeight(wts_mats::AbstractMatrix{E}...) where {E<:PEPSWeight} -""" -struct SUWeight{E <: PEPSWeight} - data::Array{E, 3} - SUWeight{E}(data::Array{E, 3}) where {E} = new{E}(data) -end - -function SUWeight(data::Array{E, 3}) where {E <: PEPSWeight} - scalartype(data) <: Real || error("Weight elements must be real numbers.") - for wt in data - isa(wt, DiagonalTensorMap) || - error("Each weight matrix should be a DiagonalTensorMap") - domain(wt, 1) == codomain(wt, 1) || - error("Domain and codomain of each weight matrix must be the same.") - !isdual(codomain(wt, 1)) || - error("Domain and codomain of each weight matrix cannot be a dual space.") - all(wt.data .>= 0) || error("Weight elements must be non-negative.") - end - return SUWeight{E}(data) -end - -function SUWeight(wts_mats::AbstractMatrix{E}...) where {E <: PEPSWeight} - n_mat = length(wts_mats) - Nr, Nc = size(wts_mats[1]) - @assert all((Nr, Nc) == size(wts_mat) for wts_mat in wts_mats) - weights = collect( - wts_mats[d][r, c] for (d, r, c) in Iterators.product(1:n_mat, 1:Nr, 1:Nc) - ) - return SUWeight(weights) -end - -## Shape and size -Base.size(W::SUWeight) = size(W.data) -Base.size(W::SUWeight, i) = size(W.data, i) -Base.length(W::SUWeight) = length(W.data) -Base.eltype(W::SUWeight) = eltype(typeof(W)) -Base.eltype(::Type{SUWeight{E}}) where {E} = E -VI.scalartype(::Type{T}) where {T <: SUWeight} = scalartype(eltype(T)) - -Base.getindex(W::SUWeight, args...) = Base.getindex(W.data, args...) -Base.setindex!(W::SUWeight, args...) = (Base.setindex!(W.data, args...); W) -Base.axes(W::SUWeight, args...) = axes(W.data, args...) -Base.iterate(W::SUWeight, args...) = iterate(W.data, args...) - -## spaces -TensorKit.spacetype(::Type{T}) where {E, T <: SUWeight{E}} = spacetype(E) - -## (Approximate) equality -function Base.:(==)(wts1::SUWeight, wts2::SUWeight) - return wts1.data == wts2.data -end -function Base.isapprox(wts1::SUWeight, wts2::SUWeight; kwargs...) - for (wt1, wt2) in zip(wts1, wts2) - !isapprox(wt1, wt2; kwargs...) && return false - end - return true -end - -function compare_weights(wts1::SUWeight, wts2::SUWeight) - @assert size(wts1) == size(wts2) - return sum(_singular_value_distance, zip(wts1.data, wts2.data)) / length(wts1) -end - -function Base.show(io::IO, ::MIME"text/plain", wts::SUWeight) - println(io, typeof(wts)) - for idx in CartesianIndices(wts.data) - println(io, Tuple(idx), ":") - for (k, b) in blocks(wts.data[idx]) - println(io, k, " = ", diag(b)) - end - end - return nothing -end - -""" - struct InfiniteWeightPEPS{T<:PEPSTensor,E<:PEPSWeight} - -Represents an infinite projected entangled-pair state on a 2D square lattice -consisting of vertex tensors and bond weights. -The vertex tensor, x-weight and y-weight at row `i`, column `j` -are defined as (the numbers show the axis order) -``` - 2 - ↓ - yᵢⱼ - ↓ - 1 - 2 - ↓ - 5←-Tᵢⱼ←-3 1←-xᵢⱼ←-2 - ↓ ↘ - 4 1 -``` - -## Fields - -$(TYPEDFIELDS) - -## Constructors - - InfiniteWeightPEPS(vertices::Matrix{T}, weight_mats::Matrix{E}...) where {T<:PEPSTensor,E<:PEPSWeight} - InfiniteWeightPEPS([f=randn, T=ComplexF64,] Pspaces::M, Nspaces::M, [Espaces::M]) where {M<:AbstractMatrix{<:Union{Int,ElementarySpace}}} - InfiniteWeightPEPS([f=randn, T=ComplexF64,] Pspace::S, Nspace::S, Espace::S=Nspace; unitcell::Tuple{Int,Int}=(1, 1)) where {S<:ElementarySpace} -""" -struct InfiniteWeightPEPS{T <: PEPSTensor, E <: PEPSWeight} - vertices::Matrix{T} - weights::SUWeight{E} - - function InfiniteWeightPEPS( - vertices::Matrix{T}, weights::SUWeight{E} - ) where {T <: PEPSTensor, E <: PEPSWeight} - @assert size(vertices) == size(weights)[2:end] - Nr, Nc = size(vertices) - # check space matching between vertex tensors and weight matrices - for (r, c) in Iterators.product(1:Nr, 1:Nc) - space(weights[2, r, c], 1)' == space(vertices[r, c], 2) || throw( - SpaceMismatch("South space of bond weight y$((r, c)) does not match.") - ) - space(weights[2, r, c], 2)' == space(vertices[_prev(r, Nr), c], 4) || throw( - SpaceMismatch("North space of bond weight y$((r, c)) does not match.") - ) - space(weights[1, r, c], 1)' == space(vertices[r, c], 3) || - throw(SpaceMismatch("West space of bond weight x$((r, c)) does not match.")) - space(weights[1, r, c], 2)' == space(vertices[r, _next(c, Nc)], 5) || - throw(SpaceMismatch("East space of bond weight x$((r, c)) does not match.")) - end - return new{T, E}(vertices, weights) - end -end - -""" - InfiniteWeightPEPS(vertices::Matrix{T}, weight_mats::Matrix{E}...) where {T<:PEPSTensor,E<:PEPSWeight} - -Create an InfiniteWeightPEPS from matrices of vertex tensors, -and separate matrices of weights on each type of bond at all locations in the unit cell. -""" -function InfiniteWeightPEPS( - vertices::Matrix{T}, weight_mats::Matrix{E}... - ) where {T <: PEPSTensor, E <: PEPSWeight} - return InfiniteWeightPEPS(vertices, SUWeight(weight_mats...)) -end - -""" - InfiniteWeightPEPS([f=randn, T=ComplexF64,] Pspaces::M, Nspaces::M, [Espaces::M]) where {M<:AbstractMatrix{<:Union{Int,ElementarySpace}}} - -Create an InfiniteWeightPEPS by specifying the physical, north virtual and east virtual spaces -of the PEPS vertex tensor at each site in the unit cell as a matrix. -Each individual space can be specified as either an `Int` or an `ElementarySpace`. -Bond weights are initialized as identity matrices of element type `Float64`. -""" -function InfiniteWeightPEPS( - Pspaces::M, Nspaces::M, Espaces::M - ) where {M <: AbstractMatrix{<:Union{Int, ElementarySpace}}} - return InfiniteWeightPEPS(randn, ComplexF64, Pspaces, Nspaces, Espaces) -end -function InfiniteWeightPEPS( - f, T, Pspaces::M, Nspaces::M, Espaces::M = Nspaces - ) where {M <: AbstractMatrix{<:Union{Int, ElementarySpace}}} - @assert all(!isdual, Pspaces) - @assert all(!isdual, Nspaces) - @assert all(!isdual, Espaces) - vertices = InfinitePEPS(f, T, Pspaces, Nspaces, Espaces).A - Nr, Nc = size(vertices) - weights = map(Iterators.product(1:2, 1:Nr, 1:Nc)) do (d, r, c) - V = (d == 1 ? Espaces[r, c] : Nspaces[r, c]) - DiagonalTensorMap(ones(reduceddim(V)), V) - end - return InfiniteWeightPEPS(vertices, SUWeight(weights)) -end - -""" - InfiniteWeightPEPS([f=randn, T=ComplexF64,] Pspace::S, Nspace::S, Espace::S=Nspace; unitcell::Tuple{Int,Int}=(1, 1)) where {S<:ElementarySpace} - -Create an InfiniteWeightPEPS by specifying its physical, north and east spaces (as `ElementarySpace`s) and unit cell size. -Use `T` to specify the element type of the vertex tensors. -Bond weights are initialized as identity matrices of element type `Float64`. -""" -function InfiniteWeightPEPS(Pspaces::S, Nspaces::S, Espaces::S) where {S <: ElementarySpace} - return InfiniteWeightPEPS(randn, ComplexF64, Pspaces, Nspaces, Espaces) -end -function InfiniteWeightPEPS( - f, T, Pspace::S, Nspace::S, Espace::S = Nspace; unitcell::Tuple{Int, Int} = (1, 1) - ) where {S <: ElementarySpace} - return InfiniteWeightPEPS( - f, T, fill(Pspace, unitcell), fill(Nspace, unitcell), fill(Espace, unitcell) - ) -end - -function Base.size(peps::InfiniteWeightPEPS) - return size(peps.vertices) -end - -TensorKit.spacetype(::Type{T}) where {E, T <: InfiniteWeightPEPS{E}} = spacetype(E) - -function _absorb_weights( - t::PEPSTensor, weights::SUWeight, - row::Int, col::Int, axs::NTuple{N, Int}, sqrtwts::NTuple{N, Bool}, invwt::Bool, - ) where {N} - Nr, Nc = size(weights)[2:end] - @assert 1 <= row <= Nr && 1 <= col <= Nc - @assert 1 <= N <= 4 - tensors = Vector{AbstractTensorMap}() - indices = Vector{Vector{Int}}() - indices_t = collect(-1:-1:-5) - for (ax, sqrtwt) in zip(axs, sqrtwts) - @assert 1 <= ax <= 4 - axp1 = ax + 1 - indices_t[axp1] *= -1 - wt = if ax == NORTH - weights[2, row, col] - elseif ax == EAST - weights[1, row, col] - elseif ax == SOUTH - weights[2, _next(row, Nr), col] - else # WEST - weights[1, row, _prev(col, Nc)] - end - # TODO: remove the dual constraint - @assert !isdual(space(wt, 1)) && isdual(space(wt, 2)) - if (!sqrtwt && !invwt) - push!(tensors, wt) - else - pow = (sqrtwt ? 1 / 2 : 1) * (invwt ? -1 : 1) - push!(tensors, sdiag_pow(wt, pow)) - end - push!(indices, (ax in (NORTH, EAST) ? [axp1, -axp1] : [-axp1, axp1])) - end - push!(tensors, t) - push!(indices, indices_t) - t2 = permute(ncon(tensors, indices), ((1,), Tuple(2:5))) - return t2 -end - -""" - absorb_weight(t::PEPSTensor, row::Int, col::Int, ax::Int, weights::SUWeight; sqrtwt::Bool=false, invwt::Bool=false) - -Absorb or remove environment weight on an axis of vertex tensor `t` known to be located at -position (`row`, `col`) in the unit cell. Weights around the tensor at `(row, col)` are -``` - ↓ - [2,r,c] - ↓ - ← [1,r,c-1] ← T[r,c] ← [1,r,c] ← - ↓ - [1,r+1,c] - ↓ -``` - -## Arguments - -- `t::T` : The vertex tensor to which the weight will be absorbed. The first axis of `t` should be the physical axis. -- `row::Int` : The row index specifying the position in the tensor network. -- `col::Int` : The column index specifying the position in the tensor network. -- `ax::Int` : The axis into which the weight is absorbed, taking values from 1 to 4, standing for north, east, south, west respectively. -- `weights::SUWeight` : The weight object to absorb into the tensor. - -## Keyword arguments - -- `sqrtwt::Bool=false` : If `true`, the square root of the weight is absorbed. -- `invwt::Bool=false` : If `true`, the inverse of the weight is absorbed. - -## Examples - -```julia -# Absorb the weight into the north axis of tensor at position (2, 3) -absorb_weight(t, 2, 3, 1, weights) - -# Absorb the square root of the weight into the south axis -absorb_weight(t, 2, 3, 3, weights; sqrtwt=true) - -# Absorb the inverse of (i.e. remove) the weight into the east axis -absorb_weight(t, 2, 3, 2, weights; invwt=true) -``` -""" -function absorb_weight( - t::PEPSTensor, - row::Int, - col::Int, - ax::Int, - weights::SUWeight; - sqrtwt::Bool = false, - invwt::Bool = false, - ) - return _absorb_weights(t, weights, row, col, (ax,), (sqrtwt,), invwt) -end - -""" - InfinitePEPS(peps::InfiniteWeightPEPS) - -Create `InfinitePEPS` from `InfiniteWeightPEPS` by absorbing bond weights into vertex tensors. -""" -function InfinitePEPS(peps::InfiniteWeightPEPS) - Nr, Nc = size(peps) - axs = Tuple(1:4) - _alltrue = ntuple(Returns(true), 4) - return InfinitePEPS( - collect( - _absorb_weights(peps.vertices[r, c], peps.weights, r, c, axs, _alltrue, false) - for r in 1:Nr, c in 1:Nc - ), - ) -end - -""" - InfiniteWeightPEPS(peps::InfinitePEPS) - -Create `InfiniteWeightPEPS` from `InfinitePEPS` by initializing the bond weights as identity matrices of element type `Float64`. -""" -function InfiniteWeightPEPS(peps::InfinitePEPS) - Nr, Nc = size(peps) - weights = map(Iterators.product(1:2, 1:Nr, 1:Nc)) do (d, r, c) - V = (d == 1 ? domain(peps[r, c])[2] : domain(peps[r, c])[1]) - @assert !isdual(V) - DiagonalTensorMap(ones(reduceddim(V)), V) - end - return InfiniteWeightPEPS(peps.A, SUWeight(weights)) -end - -## (Approximate) equality (gauge freedom is not allowed) -function Base.:(==)(peps1::InfiniteWeightPEPS, peps2::InfiniteWeightPEPS) - return peps1.vertices == peps2.vertices && peps1.weights == peps2.weights -end -function Base.isapprox(peps1::InfiniteWeightPEPS, peps2::InfiniteWeightPEPS; kwargs...) - for (v1, v2) in zip(peps1.vertices, peps2.vertices) - !isapprox(v1, v2; kwargs...) && return false - end - !isapprox(peps1.weights, peps2.weights; kwargs...) && return false - return true -end - -# Mirroring and rotation -#= Example: 3 x 3 network - -- Original - ``` - | | | - y₁₁ y₁₂ y₁₃ - | | | - ..x₁₃...┼---x₁₁---┼---x₁₂---┼---x₁₃--- - | | | 2 - y₂₁ y₂₂ y₂₃ ↓ - | | | y - ..x₂₃...┼---x₂₁---┼---x₂₂---┼---x₂₃--- ↓ - | | | 1 - y₃₁ y₃₂ y₃₃ - | | | 1 ←- x ←- 2 - ..x₃₃...┼---x₃₁---┼---x₃₂---┼---x₃₃--- - : : : - y₁₁ y₁₂ y₁₃ - : : : - ``` - -- After `mirror_antidiag`, x/y-weights are exchanged. - ``` - | | | - x₃₃ x₂₃ x₁₃ - | | | - ..y₁₃...┼---y₃₃---┼---y₂₃---┼---y₁₃--- - | | | 2 - x₃₂ x₂₂ x₁₂ ↓ - | | | x - ..y₁₂...┼---y₃₂---┼---y₂₂---┼---y₁₂--- ↓ - | | | 1 - x₃₁ x₂₁ x₁₁ - | | | 1 ←- y ←- 2 - ..y₁₁...┼---y₃₁---┼---y₂₁---┼---y₁₁--- - : : : - x₃₃ x₂₃ x₁₃ - : : : - ``` - No further operations are needed. - -- After `rotl90`, x/y-weights are exchanged. - ``` - | | | - x₁₃ x₂₃ x₃₃ - | | | - --y₁₃---┼---y₂₃---┼---y₃₃---┼...y₁₃... - | | | 2 - x₁₂ x₂₂ x₃₂ ↓ - | | | x - --y₁₂---┼---y₂₂---┼---y₃₂---┼...y₁₂... ↓ - | | | 1 - x₁₁ x₂₁ x₃₁ - | | | 2 -→ y -→ 1 - --y₁₁---┼---y₂₁---┼---y₃₁---┼...y₁₁... - : : : - x₁₃ x₂₃ x₃₃ - : : : - ``` - We need to further: - - Move 1st column of x-weights to the last column. - - Permute axes of x-weights. - - Flip x-arrows from → to ←. - -- After `rotr90`, x/y-weights are exchanged. - ``` - : : : - x₃₃ x₂₃ x₁₃ - : : : - ..y₁₁...┼---y₃₁---┼---y₂₁---┼---y₁₁--- - | | | 1 ←- y ←- 2 - x₃₁ x₂₁ x₁₁ - | | | 1 - ..y₁₂...┼---y₃₂---┼---y₂₂---┼---y₁₂--- ↑ - | | | x - x₃₂ x₂₂ x₁₂ ↑ - | | | 2 - ..y₁₃...┼---y₃₃---┼---y₂₃---┼---y₁₃--- - | | | - x₃₃ x₂₃ x₁₃ - | | | - ``` - We need to further: - - Move last row of y-weights to the 1st row. - - Permute axes of y-weights. - - Flip y-arrows from ↑ to ↓. - -After `rot180`, x/y-weights are not exchanged. - ``` - : : : - y₁₃ y₁₂ y₁₁ - : : : - --x₃₃---┼---x₃₂---┼---x₃₁---┼...x₃₃... - | | | 2 -→ x -→ 1 - y₃₃ y₃₂ y₃₁ - | | | 1 - --x₂₃---┼---x₂₂---┼---x₂₁---┼...x₂₃... ↑ - | | | y - y₂₃ y₂₂ y₂₁ ↑ - | | | 2 - --x₁₃---┼---x₁₂---┼---x₁₁---┼...x₁₃... - | | | - y₁₃ y₁₂ y₁₁ - | | | - ``` - We need to further: - - Move 1st column of x-weights to the last column. - - Move last row of y-weights to the 1st row. - - Permute axes of all weights and twist their axis 1. - - Flip x-arrows from → to ←, and y-arrows from ↑ to ↓. -=# - -""" -Mirror an `SUWeight` by its anti-diagonal line. -""" -function mirror_antidiag(wts::SUWeight) - weights2_x = mirror_antidiag(wts[2, :, :]) - weights2_y = mirror_antidiag(wts[1, :, :]) - return SUWeight(weights2_x, weights2_y) -end -function Base.rotl90(wts::SUWeight) - wts_x = circshift(rotl90(wts[2, :, :]), (0, -1)) - for (i, wt) in enumerate(wts_x) - wts_x[i] = DiagonalTensorMap(flip(permute(wt, ((2,), (1,))), (1, 2))) - end - wts_y = rotl90(wts[1, :, :]) - return SUWeight(wts_x, wts_y) -end -function Base.rotr90(wts::SUWeight) - wts_x = rotr90(wts[2, :, :]) - wts_y = circshift(rotr90(wts[1, :, :]), (1, 0)) - for (i, wt) in enumerate(wts_y) - wts_y[i] = DiagonalTensorMap(flip(permute(wt, ((2,), (1,))), (1, 2))) - end - return SUWeight(wts_x, wts_y) -end -function Base.rot180(wts::SUWeight) - wts_x = circshift(rot180(wts[1, :, :]), (0, -1)) - wts_y = circshift(rot180(wts[2, :, :]), (1, 0)) - for (i, wt) in enumerate(wts_x) - wts_x[i] = DiagonalTensorMap(flip(permute(wt, ((2,), (1,))), (1, 2))) - end - for (i, wt) in enumerate(wts_y) - wts_y[i] = DiagonalTensorMap(flip(permute(wt, ((2,), (1,))), (1, 2))) - end - return SUWeight(wts_x, wts_y) -end - -""" - mirror_antidiag(peps::InfiniteWeightPEPS) - -Mirror an `InfiniteWeightPEPS` by its anti-diagonal line. -""" -function mirror_antidiag(peps::InfiniteWeightPEPS) - vertices2 = mirror_antidiag(peps.vertices) - for (i, t) in enumerate(vertices2) - vertices2[i] = mirror_antidiag(t) - end - weights2 = mirror_antidiag(peps.weights) - return InfiniteWeightPEPS(vertices2, weights2) -end -function Base.rotl90(peps::InfiniteWeightPEPS) - vertices2 = rotl90(peps.vertices) - for (i, t) in enumerate(vertices2) - vertices2[i] = flip(rotl90(t), (3, 5)) - end - weights2 = rotl90(peps.weights) - return InfiniteWeightPEPS(vertices2, weights2) -end -function Base.rotr90(peps::InfiniteWeightPEPS) - vertices2 = rotr90(peps.vertices) - for (i, t) in enumerate(vertices2) - vertices2[i] = flip(rotr90(t), (2, 4)) - end - weights2 = rotr90(peps.weights) - return InfiniteWeightPEPS(vertices2, weights2) -end -function Base.rot180(peps::InfiniteWeightPEPS) - vertices2 = rot180(peps.vertices) - for (i, t) in enumerate(vertices2) - vertices2[i] = flip(rot180(t), Tuple(2:5)) - end - weights2 = rot180(peps.weights) - return InfiniteWeightPEPS(vertices2, weights2) -end diff --git a/src/utility/mirror.jl b/src/utility/mirror.jl deleted file mode 100644 index 406262131..000000000 --- a/src/utility/mirror.jl +++ /dev/null @@ -1,12 +0,0 @@ -""" - mirror_antidiag(arr::AbstractMatrix) - -Mirror a matrix by its anti-diagonal line (the 45 degree line through the lower-left corner). - -The element originally at [r, c] is moved [Nc-c+1, Nr-r+1], i.e. the element now at [r, c] -was originally at [Nr-c+1, Nc-r+1] -""" -function mirror_antidiag(arr::AbstractMatrix) - Nr, Nc = size(arr) - return collect(arr[Nr - c + 1, Nc - r + 1] for (r, c) in Iterators.product(1:Nc, 1:Nr)) -end diff --git a/src/utility/util.jl b/src/utility/util.jl index 4cfdb2541..bb7020fbc 100644 --- a/src/utility/util.jl +++ b/src/utility/util.jl @@ -106,11 +106,17 @@ end Given `tsvd` result `u ← s ← vh`, flip the arrow between the three tensors to `u2 → s2 → vh2` such that ``` - u * s * vh = (@tensor t2[-1; -2] := u2[-1; 1] * s2[1; 2] * vh2[2; -2]) + u * s * vh = (@tensor t2[-1, ...; -2, ...] := u2[-1, ...; 2] * s2[1; 2] * vh2[1; -2, ...]) +``` +The axis orders for `s`, `s2` are +``` + 1 ← s ← 2 2 → s2 → 1 ``` """ function flip_svd(u::AbstractTensorMap, s::DiagonalTensorMap, vh::AbstractTensorMap) - return flip(u, 2), DiagonalTensorMap(flip(s, (1, 2))), flip(vh, 1) + return flip(u, numind(u)), + permute(DiagonalTensorMap(flip(s, (1, 2))), ((2,), (1,))), + flip(vh, 1) end """ diff --git a/test/bondenv/benv_fu.jl b/test/bondenv/benv_fu.jl index 7e444bb7e..d6a374a8b 100644 --- a/test/bondenv/benv_fu.jl +++ b/test/bondenv/benv_fu.jl @@ -11,10 +11,10 @@ Nr, Nc = 2, 2 function get_hubbard_state(t::Float64 = 1.0, U::Float64 = 8.0) H = hubbard_model(ComplexF64, Trivial, U1Irrep, InfiniteSquare(Nr, Nc); t, U, mu = U / 2) Vphy = Vect[FermionParity ⊠ U1Irrep]((0, 0) => 2, (1, 1 // 2) => 1, (1, -1 // 2) => 1) - wpeps = InfiniteWeightPEPS(rand, ComplexF64, Vphy, Vphy; unitcell = (Nr, Nc)) + peps = InfinitePEPS(rand, ComplexF64, Vphy, Vphy; unitcell = (Nr, Nc)) + wts = SUWeight(peps) alg = SimpleUpdate(1.0e-2, 1.0e-8, 10000, truncerr(1.0e-10) & truncdim(4)) - wpeps, = simpleupdate(wpeps, H, alg; bipartite = false, check_interval = 2000) - peps = InfinitePEPS(wpeps) + peps, = simpleupdate(peps, H, alg, wts; bipartite = false, check_interval = 2000) normalize!.(peps.A, Inf) return peps end diff --git a/test/examples/heisenberg.jl b/test/examples/heisenberg.jl index b92f12a0f..1c109913c 100644 --- a/test/examples/heisenberg.jl +++ b/test/examples/heisenberg.jl @@ -52,13 +52,11 @@ end Pspace = ℂ^2 Vspace = ℂ^Dbond Espace = ℂ^χenv - wpeps = InfiniteWeightPEPS(rand, Float64, Pspace, Vspace; unitcell = (N1, N2)) - ctmrg_tol = 1.0e-6 + ctmrg_tol = 1.0e-8 + peps = InfinitePEPS(rand, Float64, Pspace, Vspace; unitcell = (N1, N2)) + wts = SUWeight(peps) + normalize!.(peps.A, Inf) - # normalize vertex tensors - for ind in CartesianIndices(wpeps.vertices) - wpeps.vertices[ind] /= norm(wpeps.vertices[ind], Inf) - end # Heisenberg model Hamiltonian ham = heisenberg_XYZ(InfiniteSquare(N1, N2); Jx = 1.0, Jy = 1.0, Jz = 1.0) # assert imaginary part is zero @@ -73,15 +71,12 @@ end Dbond2 = (n == 2) ? Dbond + 2 : Dbond trscheme = truncerr(1.0e-10) & truncdim(Dbond2) alg = SimpleUpdate(dt, tol, maxiter, trscheme) - result = simpleupdate(wpeps, ham, alg; bipartite = false) - wpeps = result[1] + peps, wts, = simpleupdate(peps, ham, alg, wts; bipartite = false) end - # absorb weight into site tensors and CTMRG - peps = InfinitePEPS(wpeps) + # measure physical quantities with CTMRG + normalize!.(peps.A, Inf) env, = leading_boundary(CTMRGEnv(rand, Float64, peps, Espace), peps; tol = ctmrg_tol) - - # measure physical quantities e_site = cost_function(peps, env, ham) / (N1 * N2) @info "Simple update energy = $e_site" # benchmark data from Phys. Rev. B 94, 035133 (2016) diff --git a/test/runtests.jl b/test/runtests.jl index 4f5f9ea56..1c96ecd85 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -81,8 +81,8 @@ end @time @safetestset "Norm-preserving retractions" begin include("utility/retractions.jl") end - @time @safetestset "Rotation of InfiniteWeightPEPS" begin - include("utility/iwpeps_rotation.jl") + @time @safetestset "Rotation of SUWeight" begin + include("utility/suweight_rotation.jl") end @time @safetestset "Correlators" begin include("utility/correlator.jl") diff --git a/test/timeevol/cluster_projectors.jl b/test/timeevol/cluster_projectors.jl index 69826dee6..3055cbe47 100644 --- a/test/timeevol/cluster_projectors.jl +++ b/test/timeevol/cluster_projectors.jl @@ -7,9 +7,12 @@ import MPSKitModels: hubbard_space using PEPSKit: sdiag_pow, _cluster_truncate! include("cluster_tools.jl") -nrm = 20 Vspaces = [ - (ℂ^2, ℂ^4, (ℂ^12)'), + ( + U1Space(0 => 1, 1 => 1, -1 => 1), + U1Space(0 => 1, 1 => 2, -1 => 1)', + U1Space(0 => 4, 1 => 5, -1 => 6)', + ), ( Vect[FermionParity](0 => 1, 1 => 1), Vect[FermionParity](0 => 2, 1 => 2), @@ -25,17 +28,15 @@ Vspaces = [ Vvirs[n + 1] = V Ms1 = map(1:N) do i Vw, Ve = Vvirs[i], Vvirs[i + 1] - return rand(Vw ← Vphy' ⊗ Vns ⊗ Vns' ⊗ Ve) / nrm + return rand(Vw ← Vphy' ⊗ Vns ⊗ Vns' ⊗ Ve) end + normalize!.(Ms1, Inf) revs = [isdual(space(M, 1)) for M in Ms1[2:end]] # no truncation Ms2 = deepcopy(Ms1) wts2, ϵs, = _cluster_truncate!(Ms2, fill(FixedSpaceTruncation(), N - 1), revs) @test all((ϵ == 0) for ϵ in ϵs) - absorb_wts_cluster!(Ms2, wts2) - for (i, M) in enumerate(Ms2) - Ms2[i] *= 0.05 / norm(M, Inf) - end + normalize!.(Ms2, Inf) @test fidelity_cluster(Ms1, Ms2) ≈ 1.0 lorths, rorths = verify_cluster_orth(Ms2, wts2) @test all(lorths) && all(rorths) @@ -43,10 +44,7 @@ Vspaces = [ Ms3 = deepcopy(Ms1) wts3, ϵs, = _cluster_truncate!(Ms3, fill(truncspace(Vns), N - 1), revs) @test all((i == n) || (ϵ == 0) for (i, ϵ) in enumerate(ϵs)) - absorb_wts_cluster!(Ms3, wts3) - for (i, M) in enumerate(Ms3) - Ms3[i] *= 0.05 / norm(M, Inf) - end + normalize!.(Ms3, Inf) ϵ = ϵs[n] wt2, wt3 = wts2[n], wts3[n] fid3, fid3_ = fidelity_cluster(Ms1, Ms3), fidelity_cluster(Ms2, Ms3) @@ -64,7 +62,7 @@ end Vvirs[n + 1] = V Ms1 = map(1:N) do i Vw, Ve = Vvirs[i], Vvirs[i + 1] - return rand(Vw ← Vphy' ⊗ Vns ⊗ Vns' ⊗ Ve) / nrm + return normalize(rand(Vw ← Vphy' ⊗ Vns ⊗ Vns' ⊗ Ve), Inf) end unit = id(Vphy) gate = reduce(⊗, fill(unit, 3)) @@ -86,9 +84,12 @@ end Vspace = Vect[FermionParity ⊠ U1Irrep]((0, 0) => 2, (1, 1 // 2) => 1, (1, -1 // 2) => 1) Espace = Vect[FermionParity ⊠ U1Irrep]((0, 0) => 8, (1, 1 // 2) => 4, (1, -1 // 2) => 4) trscheme_env = truncerr(1.0e-12) & truncdim(16) - wpeps = InfiniteWeightPEPS(rand, Float64, Pspace, Vspace; unitcell = (Nr, Nc)) + peps = InfinitePEPS(rand, Float64, Pspace, Vspace; unitcell = (Nr, Nc)) + wts = SUWeight(peps) ham = real( - hubbard_model(ComplexF64, Trivial, U1Irrep, InfiniteSquare(Nr, Nc); t = 1.0, U = 8.0) + hubbard_model( + ComplexF64, Trivial, U1Irrep, InfiniteSquare(Nr, Nc); t = 1.0, U = 8.0, mu = 0.0 + ), ) # usual 2-site simple update, and measure energy dts = [1.0e-2, 1.0e-2, 5.0e-3] @@ -97,10 +98,8 @@ end for (n, (dt, tol)) in enumerate(zip(dts, tols)) trscheme = truncerr(1.0e-10) & truncdim(n == 1 ? 4 : 2) alg = SimpleUpdate(dt, tol, maxiter, trscheme) - result = simpleupdate(wpeps, ham, alg; bipartite = true, check_interval = 1000) - wpeps = result[1] + peps, wts, = simpleupdate(peps, ham, alg, wts; bipartite = true, check_interval = 1000) end - peps = InfinitePEPS(wpeps) normalize!.(peps.A, Inf) env = CTMRGEnv(rand, Float64, peps, Espace) env, = leading_boundary(env, peps; tol = ctmrg_tol, trscheme = trscheme_env) @@ -112,10 +111,10 @@ end trscheme = truncerr(1.0e-10) & truncdim(2) for (n, (dt, tol)) in enumerate(zip(dts, tols)) alg = SimpleUpdate(dt, tol, maxiter, trscheme) - result = simpleupdate(wpeps, ham, alg; check_interval = 1000, force_3site = true) - wpeps = result[1] + peps, wts, = simpleupdate( + peps, ham, alg, wts; check_interval = 1000, force_3site = true + ) end - peps = InfinitePEPS(wpeps) normalize!.(peps.A, Inf) env, = leading_boundary(env, peps; tol = ctmrg_tol, trscheme = trscheme_env) e_site2 = cost_function(peps, env, ham) / (Nr * Nc) diff --git a/test/timeevol/cluster_tools.jl b/test/timeevol/cluster_tools.jl index 7e99380ae..ac7adaca9 100644 --- a/test/timeevol/cluster_tools.jl +++ b/test/timeevol/cluster_tools.jl @@ -104,23 +104,6 @@ function inner_prod_cluster( return @tensor res[1 2] * M[1 2] end -function absorb_wts_cluster!( - Ms::Vector{T1}, wts::Vector{T2} - ) where {T1 <: AbstractTensorMap, T2 <: AbstractTensorMap} - revs = [isdual(space(M, 1)) for M in Ms[2:end]] - for (i, (wt, rev)) in enumerate(zip(wts, revs)) - wtsqrt = sdiag_pow(wt, 0.5) - if rev - wtsqrt = permute(wtsqrt, ((2,), (1,))) - end - @tensor begin - Ms[i][-1; -2 -3 -4 -5] = Ms[i][-1; -2 -3 -4 1] * wtsqrt[1; -5] - Ms[i + 1][-1; -2 -3 -4 -5] = wtsqrt[-1; 1] * Ms[i + 1][1; -2 -3 -4 -5] - end - end - return -end - function fidelity_cluster( Ms1::Vector{T1}, Ms2::Vector{T2} ) where {T1 <: AbstractTensorMap, T2 <: AbstractTensorMap} diff --git a/test/timeevol/sitedep_truncation.jl b/test/timeevol/sitedep_truncation.jl index dcef94e5f..13f3e1c12 100644 --- a/test/timeevol/sitedep_truncation.jl +++ b/test/timeevol/sitedep_truncation.jl @@ -5,9 +5,15 @@ using TensorKit using PEPSKit using PEPSKit: NORTH, EAST -function get_bonddims(wpeps::InfiniteWeightPEPS) - xdims = collect(dim(domain(t, EAST)) for t in wpeps.vertices) - ydims = collect(dim(domain(t, NORTH)) for t in wpeps.vertices) +function get_bonddims(peps::InfinitePEPS) + xdims = collect(dim(domain(t, EAST)) for t in peps.A) + ydims = collect(dim(domain(t, NORTH)) for t in peps.A) + return stack([xdims, ydims]; dims = 1) +end + +function get_bonddims(wts::SUWeight) + xdims = collect(dim(space(wt, 1)) for wt in wts[1, :, :]) + ydims = collect(dim(space(wt, 1)) for wt in wts[2, :, :]) return stack([xdims, ydims]; dims = 1) end @@ -15,21 +21,23 @@ end Nr, Nc = 2, 2 ham = real(heisenberg_XYZ(InfiniteSquare(Nr, Nc); Jx = 1.0, Jy = 1.0, Jz = 1.0)) Random.seed!(100) - wpeps0 = InfiniteWeightPEPS(rand, Float64, ℂ^2, ℂ^10; unitcell = (Nr, Nc)) - normalize!.(wpeps0.vertices, Inf) + peps0 = InfinitePEPS(rand, Float64, ℂ^2, ℂ^10; unitcell = (Nr, Nc)) + env0 = SUWeight(peps0) + normalize!.(peps0.A, Inf) # set trscheme to be compatible with bipartite structure bonddims = stack([[6 4; 4 6], [5 7; 7 5]]; dims = 1) trscheme = SiteDependentTruncation(collect(truncdim(d) for d in bonddims)) alg = SimpleUpdate(1.0e-2, 1.0e-14, 4, trscheme) - wpeps, = simpleupdate(wpeps0, ham, alg; bipartite = true) - @test get_bonddims(wpeps) == bonddims + peps, env, = simpleupdate(peps0, ham, alg, env0; bipartite = true) + @test get_bonddims(peps) == bonddims + @test get_bonddims(env) == bonddims # check bipartite structure is preserved for col in 1:2 cp1 = PEPSKit._next(col, 2) @test ( - wpeps.vertices[1, col] == wpeps.vertices[2, cp1] && - wpeps.weights[1, 1, col] == wpeps.weights[1, 2, cp1] && - wpeps.weights[2, 1, col] == wpeps.weights[2, 2, cp1] + peps.A[1, col] == peps.A[2, cp1] && + env[1, 1, col] == env[1, 2, cp1] && + env[2, 1, col] == env[2, 2, cp1] ) end end @@ -38,17 +46,20 @@ end Nr, Nc = 3, 4 ham = real(heisenberg_XYZ(InfiniteSquare(Nr, Nc); Jx = 1.0, Jy = 1.0, Jz = 1.0)) Random.seed!(100) - wpeps0 = InfiniteWeightPEPS(rand, Float64, ℂ^2, ℂ^10; unitcell = (Nr, Nc)) - normalize!.(wpeps0.vertices, Inf) + peps0 = InfinitePEPS(rand, Float64, ℂ^2, ℂ^10; unitcell = (Nr, Nc)) + normalize!.(peps0.A, Inf) + env0 = SUWeight(peps0) # Site dependent truncation bonddims = rand(2:8, 2, Nr, Nc) @show bonddims trscheme = SiteDependentTruncation(collect(truncdim(d) for d in bonddims)) alg = SimpleUpdate(1.0e-2, 1.0e-14, 2, trscheme) # 2-site SU - wpeps, = simpleupdate(wpeps0, ham, alg; bipartite = false) - @test get_bonddims(wpeps) == bonddims + peps, env, = simpleupdate(peps0, ham, alg, env0; bipartite = false) + @test get_bonddims(peps) == bonddims + @test get_bonddims(env) == bonddims # 3-site SU - wpeps, = simpleupdate(wpeps0, ham, alg; bipartite = false, force_3site = true) - @test get_bonddims(wpeps) == bonddims + peps, env, = simpleupdate(peps0, ham, alg, env0; bipartite = false, force_3site = true) + @test get_bonddims(peps) == bonddims + @test get_bonddims(env) == bonddims end diff --git a/test/utility/iwpeps_rotation.jl b/test/utility/iwpeps_rotation.jl deleted file mode 100644 index 0ff43a70a..000000000 --- a/test/utility/iwpeps_rotation.jl +++ /dev/null @@ -1,86 +0,0 @@ -using Test -using TensorKit -using PEPSKit - -function compose_n(f, n) - n == 0 && return identity - return f ∘ compose_n(f, n - 1) -end - -function test_rotation(wts::SUWeight) - @test compose_n(rotl90, 2)(wts) ≈ compose_n(rotr90, 2)(wts) - @test compose_n(rotr90, 2)(wts) ≈ rot180(wts) - @test (rotl90 ∘ rotr90)(wts) ≈ wts - @test (rotr90 ∘ rotl90)(wts) ≈ wts - @test compose_n(rotl90, 4)(wts) ≈ wts - @test compose_n(rotl90, 4)(wts) ≈ wts - @test compose_n(rot180, 2)(wts) ≈ wts - return nothing -end - -function flip_twice(a::AbstractTensorMap, idx; inv::Bool = false) - _flip(a) = flip(a, idx; inv) - return (_flip ∘ _flip)(a) -end - -function test_rotation(psi::InfiniteWeightPEPS) - peps = InfinitePEPS(psi) - @test compose_n(rotl90, 2)(psi) ≈ compose_n(rotr90, 2)(psi) - @test compose_n(rotr90, 2)(psi) ≈ rot180(psi) - psi_lr = (rotl90 ∘ rotr90)(psi) - psi_rl = (rotr90 ∘ rotl90)(psi) - @test psi_lr.weights ≈ psi_rl.weights ≈ psi.weights - @test all( - flip_twice(v1, (3, 5); inv = true) ≈ v2 for - (v1, v2) in zip(psi_lr.vertices, psi.vertices) - ) - @test all( - flip_twice(v1, (2, 4); inv = true) ≈ v2 for - (v1, v2) in zip(psi_rl.vertices, psi.vertices) - ) - psi_l4 = compose_n(rotl90, 4)(psi) - psi_r4 = compose_n(rotr90, 4)(psi) - psi_2 = compose_n(rot180, 2)(psi) - @test psi_l4 ≈ psi_r4 ≈ psi_2 - @test all( - flip_twice(v1, Tuple(2:5); inv = true) ≈ v2 for - (v1, v2) in zip(psi_2.vertices, psi.vertices) - ) - # conversion to InfinitePEPS - psi_l = rotl90(psi) - peps_l = InfinitePEPS(psi_l) - for (i, t) in enumerate(peps_l.A) - peps_l.A[i] = flip(t, (3, 5); inv = true) - end - @test peps_l ≈ rotl90(peps) - psi_r = rotr90(psi) - peps_r = InfinitePEPS(psi_r) - for (i, t) in enumerate(peps_r.A) - peps_r.A[i] = flip(t, (2, 4); inv = true) - end - @test peps_r ≈ rotr90(peps) - psi_2 = rot180(psi) - peps_2 = InfinitePEPS(psi_2) - for (i, t) in enumerate(peps_2.A) - peps_2.A[i] = flip(t, Tuple(2:5); inv = true) - end - return @test peps_2 ≈ rot180(peps) -end - -Vphy = Vect[FermionParity](0 => 1, 1 => 1) -V = Vect[FermionParity](0 => 2, 1 => 2) -Nr, Nc = 2, 3 -vertices = collect(rand(Float64, Vphy ← V ⊗ V ⊗ V' ⊗ V') for r in 1:Nr, c in 1:Nc) -weights = collect(tsvd(rand(Float64, V ← V))[2] for dir in 1:2, r in 1:Nr, c in 1:Nc) -weights = SUWeight(weights) -pepswt = InfiniteWeightPEPS(vertices, weights) - -@test sectortype(weights) === sectortype(V) -@test spacetype(weights) === spacetype(V) -@test sectortype(pepswt) === sectortype(V) -@test spacetype(pepswt) === spacetype(V) - -test_rotation(weights) -@static if pkgversion(TensorKit) >= v"0.14.6" - test_rotation(pepswt) -end diff --git a/test/utility/suweight_rotation.jl b/test/utility/suweight_rotation.jl new file mode 100644 index 000000000..fc9616163 --- /dev/null +++ b/test/utility/suweight_rotation.jl @@ -0,0 +1,60 @@ +using Test +using TensorKit +using PEPSKit + +function compose_n(f, n) + n == 0 && return identity + return f ∘ compose_n(f, n - 1) +end + +function test_rotation(wts::SUWeight) + @test compose_n(rotl90, 2)(wts) ≈ compose_n(rotr90, 2)(wts) + @test compose_n(rotr90, 2)(wts) ≈ rot180(wts) + @test (rotl90 ∘ rotr90)(wts) ≈ wts + @test (rotr90 ∘ rotl90)(wts) ≈ wts + @test compose_n(rotl90, 4)(wts) ≈ wts + @test compose_n(rotl90, 4)(wts) ≈ wts + @test compose_n(rot180, 2)(wts) ≈ wts + return nothing +end + +function test_rotation(peps::InfinitePEPS, wts::SUWeight) + for n in 1:4 + rot = compose_n(rotl90, n) + A1 = InfinitePEPS( + collect( + absorb_weight(peps.A[idx], wts, idx[1], idx[2], Tuple(1:4)) for + idx in CartesianIndices(peps.A) + ), + ) + peps2, wts2 = rot(peps), rot(wts) + A2 = InfinitePEPS( + collect( + absorb_weight(peps2.A[idx], wts2, idx[1], idx[2], Tuple(1:4)) for + idx in CartesianIndices(peps2.A) + ), + ) + @test A2 ≈ rot(A1) + end + return +end + +Vphy = Vect[FermionParity ⊠ U1Irrep]((0, 0) => 1, (1, 1 // 2) => 1, (1, -1 // 2) => 2) +Vs = ( + # Espace + Vect[FermionParity ⊠ U1Irrep]((0, 0) => 2, (1, 1 // 2) => 3, (1, -1 // 2) => 2), + # Nspace + Vect[FermionParity ⊠ U1Irrep]((0, 0) => 2, (1, 1 // 2) => 1, (1, -1 // 2) => 4), +) +Nr, Nc = 2, 3 +peps = InfinitePEPS(rand, Float64, Vphy, Vs[2], Vs[1]'; unitcell = (Nr, Nc)) +wts = collect( + tsvd(rand(Float64, Vs[dir] ← Vs[dir]))[2] for dir in 1:2, r in 1:Nr, c in 1:Nc +) +wts = SUWeight(wts) + +@test sectortype(wts) === sectortype(Vs[1]) +@test spacetype(wts) === spacetype(Vs[1]) + +test_rotation(wts) +test_rotation(peps, wts)