diff --git a/docs/src/examples/quantum1d/2.haldane/index.md b/docs/src/examples/quantum1d/2.haldane/index.md index e05a3399e..1a4a50984 100644 --- a/docs/src/examples/quantum1d/2.haldane/index.md +++ b/docs/src/examples/quantum1d/2.haldane/index.md @@ -24,7 +24,13 @@ H = -J∑_{⟨i,j⟩} (X_i X_j + Y_i Y_j + Z_i Z_j) This hamiltonian has an SU(2) symmetry, which we can enforce by using SU(2)-symmetric tensors: ````julia -H = heisenberg_XXX(ComplexF64, SU2Irrep; spin=1, J=1); +symmetry = SU2Irrep +spin = 1 +J = 1 +```` + +```` +1 ```` ## Finite size extrapolation @@ -41,9 +47,12 @@ This can be done as follows. ````julia L = 11 +chain = FiniteChain(L) +H = heisenberg_XXX(symmetry, chain; J, spin) + physical_space = SU2Space(1 => 1) virtual_space = SU2Space(0 => 12, 1 => 12, 2 => 5, 3 => 3) -ψ₀ = FiniteMPS(rand, ComplexF64, L, physical_space, virtual_space) +ψ₀ = FiniteMPS(L, physical_space, virtual_space) ψ, envs, delta = find_groundstate(ψ₀, H, DMRG(; verbosity=0)) E₀ = real(expectation_value(ψ, H)) En_1, st_1 = excitations(H, QuasiparticleAnsatz(), ψ, envs; sector=SU2Irrep(1)) @@ -52,7 +61,7 @@ En_2, st_2 = excitations(H, QuasiparticleAnsatz(), ψ, envs; sector=SU2Irrep(2)) ```` ```` -0.7989253589480483 +0.7989253589480536 ```` We can go even further and doublecheck the claim that ``S = 1`` is an edge excitation, by plotting the energy density. @@ -74,51 +83,51 @@ plot!(p_density, e₂; label="S = 2") - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ``` @@ -128,7 +137,8 @@ Finally, we can obtain a value for the Haldane gap by extrapolating our results Ls = 12:4:30 ΔEs = map(Ls) do L @info "computing L = $L" - ψ₀ = FiniteMPS(rand, ComplexF64, L, physical_space, virtual_space) + ψ₀ = FiniteMPS(L, physical_space, virtual_space) + H = heisenberg_XXX(symmetry, FiniteChain(L); J, spin) ψ, envs, delta = find_groundstate(ψ₀, H, DMRG(; verbosity=0)) En_1, st_1 = excitations(H, QuasiparticleAnsatz(), ψ, envs; sector=SU2Irrep(1)) En_2, st_2 = excitations(H, QuasiparticleAnsatz(), ψ, envs; sector=SU2Irrep(2)) @@ -140,7 +150,7 @@ f = fit(Ls .^ (-2), ΔEs, 1) ```` ```` -0.45173401585837447 +0.45173401585831346 ```` ````julia @@ -153,53 +163,53 @@ plot!(p_size_extrapolation, x -> f(x); label="fit") - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ``` @@ -214,6 +224,8 @@ In contrast with the finite size case, we now should specify a momentum label to This way, it is possible to scan the dispersion relation over the entire momentum space. ````julia +chain = InfiniteChain(1) +H = heisenberg_XXX(symmetry, chain; J, spin) virtual_space_inf = Rep[SU₂](1 // 2 => 16, 3 // 2 => 16, 5 // 2 => 8, 7 // 2 => 4) ψ₀_inf = InfiniteMPS([physical_space], [virtual_space_inf]) ψ_inf, envs_inf, delta_inf = find_groundstate(ψ₀_inf, H; verbosity=0) @@ -228,37 +240,23 @@ println("minimum @k = $(kspace[idx]):\t ΔE = $(ΔE)") ```` ┌ Warning: resorting to η └ @ OptimKit ~/.julia/packages/OptimKit/xpmbV/src/cg.jl:139 -┌ Warning: resorting to η -└ @ OptimKit ~/.julia/packages/OptimKit/xpmbV/src/cg.jl:139 -┌ Warning: resorting to η -└ @ OptimKit ~/.julia/packages/OptimKit/xpmbV/src/cg.jl:139 -┌ Warning: resorting to η -└ @ OptimKit ~/.julia/packages/OptimKit/xpmbV/src/cg.jl:139 -┌ Warning: resorting to η -└ @ OptimKit ~/.julia/packages/OptimKit/xpmbV/src/cg.jl:139 -┌ Warning: resorting to η -└ @ OptimKit ~/.julia/packages/OptimKit/xpmbV/src/cg.jl:139 -┌ Warning: resorting to η -└ @ OptimKit ~/.julia/packages/OptimKit/xpmbV/src/cg.jl:139 -┌ Warning: resorting to η -└ @ OptimKit ~/.julia/packages/OptimKit/xpmbV/src/cg.jl:139 -[ Info: Found excitations for momentum = 1.8849555921538759 [ Info: Found excitations for momentum = 1.6755160819145563 +[ Info: Found excitations for momentum = 1.8849555921538759 [ Info: Found excitations for momentum = 2.0943951023931953 +[ Info: Found excitations for momentum = 1.4660765716752369 [ Info: Found excitations for momentum = 0.0 [ Info: Found excitations for momentum = 0.20943951023931953 -[ Info: Found excitations for momentum = 1.4660765716752369 -[ Info: Found excitations for momentum = 2.722713633111154 +[ Info: Found excitations for momentum = 1.2566370614359172 [ Info: Found excitations for momentum = 0.41887902047863906 +[ Info: Found excitations for momentum = 2.9321531433504737 [ Info: Found excitations for momentum = 2.303834612632515 -[ Info: Found excitations for momentum = 1.2566370614359172 +[ Info: Found excitations for momentum = 2.722713633111154 [ Info: Found excitations for momentum = 2.5132741228718345 -[ Info: Found excitations for momentum = 2.9321531433504737 -[ Info: Found excitations for momentum = 0.6283185307179586 [ Info: Found excitations for momentum = 3.141592653589793 +[ Info: Found excitations for momentum = 0.6283185307179586 [ Info: Found excitations for momentum = 1.0471975511965976 [ Info: Found excitations for momentum = 0.8377580409572781 -minimum @k = 3.141592653589793: ΔE = 0.4104792658835073 +minimum @k = 3.141592653589793: ΔE = 0.4104792484203954 ```` @@ -270,47 +268,47 @@ plot(kspace, real.(Es); xaxis="momentum", yaxis="ΔE", label="S = 1") - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + ``` diff --git a/docs/src/examples/quantum1d/2.haldane/main.ipynb b/docs/src/examples/quantum1d/2.haldane/main.ipynb index a16385dd5..c6e4a4ec7 100644 --- a/docs/src/examples/quantum1d/2.haldane/main.ipynb +++ b/docs/src/examples/quantum1d/2.haldane/main.ipynb @@ -36,7 +36,9 @@ "outputs": [], "cell_type": "code", "source": [ - "H = heisenberg_XXX(ComplexF64, SU2Irrep; spin=1, J=1);" + "symmetry = SU2Irrep\n", + "spin = 1\n", + "J = 1" ], "metadata": {}, "execution_count": null @@ -63,9 +65,12 @@ "cell_type": "code", "source": [ "L = 11\n", + "chain = FiniteChain(L)\n", + "H = heisenberg_XXX(symmetry, chain; J, spin)\n", + "\n", "physical_space = SU2Space(1 => 1)\n", "virtual_space = SU2Space(0 => 12, 1 => 12, 2 => 5, 3 => 3)\n", - "ψ₀ = FiniteMPS(rand, ComplexF64, L, physical_space, virtual_space)\n", + "ψ₀ = FiniteMPS(L, physical_space, virtual_space)\n", "ψ, envs, delta = find_groundstate(ψ₀, H, DMRG(; verbosity=0))\n", "E₀ = real(expectation_value(ψ, H))\n", "En_1, st_1 = excitations(H, QuasiparticleAnsatz(), ψ, envs; sector=SU2Irrep(1))\n", @@ -114,7 +119,8 @@ "Ls = 12:4:30\n", "ΔEs = map(Ls) do L\n", " @info \"computing L = $L\"\n", - " ψ₀ = FiniteMPS(rand, ComplexF64, L, physical_space, virtual_space)\n", + " ψ₀ = FiniteMPS(L, physical_space, virtual_space)\n", + " H = heisenberg_XXX(symmetry, FiniteChain(L); J, spin)\n", " ψ, envs, delta = find_groundstate(ψ₀, H, DMRG(; verbosity=0))\n", " En_1, st_1 = excitations(H, QuasiparticleAnsatz(), ψ, envs; sector=SU2Irrep(1))\n", " En_2, st_2 = excitations(H, QuasiparticleAnsatz(), ψ, envs; sector=SU2Irrep(2))\n", @@ -149,6 +155,8 @@ "outputs": [], "cell_type": "code", "source": [ + "chain = InfiniteChain(1)\n", + "H = heisenberg_XXX(symmetry, chain; J, spin)\n", "virtual_space_inf = Rep[SU₂](1 // 2 => 16, 3 // 2 => 16, 5 // 2 => 8, 7 // 2 => 4)\n", "ψ₀_inf = InfiniteMPS([physical_space], [virtual_space_inf])\n", "ψ_inf, envs_inf, delta_inf = find_groundstate(ψ₀_inf, H; verbosity=0)\n", @@ -179,11 +187,11 @@ "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.11.1" + "version": "1.11.2" }, "kernelspec": { "name": "julia-1.11", - "display_name": "Julia 1.11.1", + "display_name": "Julia 1.11.2", "language": "julia" } }, diff --git a/examples/Cache.toml b/examples/Cache.toml index d1a7a8dd5..6593e4c55 100644 --- a/examples/Cache.toml +++ b/examples/Cache.toml @@ -2,4 +2,5 @@ "1.hard-hexagon" = "b380d99250b1908c03248a569ccb2729891f94ccad2a840dc9866af63ce98d2e" [quantum1d] +"2.haldane" = "4f3e177a30df907cf7b9a47958ddf97741e4d0398ae1876e0f4977ccb93ae651" "1.ising-cft" = "bd1253451973aa73c4fee6b64d81ee52cc2feba5b9632f87ce332eea3a05f460" diff --git a/examples/quantum1d/2.haldane/main.jl b/examples/quantum1d/2.haldane/main.jl index c21dca93b..ff2f9640f 100644 --- a/examples/quantum1d/2.haldane/main.jl +++ b/examples/quantum1d/2.haldane/main.jl @@ -17,7 +17,9 @@ H = -J∑_{⟨i,j⟩} (X_i X_j + Y_i Y_j + Z_i Z_j) This hamiltonian has an SU(2) symmetry, which we can enforce by using SU(2)-symmetric tensors: """ -H = heisenberg_XXX(ComplexF64, SU2Irrep; spin=1, J=1); +symmetry = SU2Irrep +spin = 1 +J = 1 md""" ## Finite size extrapolation @@ -34,9 +36,12 @@ This can be done as follows. """ L = 11 +chain = FiniteChain(L) +H = heisenberg_XXX(symmetry, chain; J, spin) + physical_space = SU2Space(1 => 1) virtual_space = SU2Space(0 => 12, 1 => 12, 2 => 5, 3 => 3) -ψ₀ = FiniteMPS(rand, ComplexF64, L, physical_space, virtual_space) +ψ₀ = FiniteMPS(L, physical_space, virtual_space) ψ, envs, delta = find_groundstate(ψ₀, H, DMRG(; verbosity=0)) E₀ = real(expectation_value(ψ, H)) En_1, st_1 = excitations(H, QuasiparticleAnsatz(), ψ, envs; sector=SU2Irrep(1)) @@ -65,7 +70,8 @@ Finally, we can obtain a value for the Haldane gap by extrapolating our results Ls = 12:4:30 ΔEs = map(Ls) do L @info "computing L = $L" - ψ₀ = FiniteMPS(rand, ComplexF64, L, physical_space, virtual_space) + ψ₀ = FiniteMPS(L, physical_space, virtual_space) + H = heisenberg_XXX(symmetry, FiniteChain(L); J, spin) ψ, envs, delta = find_groundstate(ψ₀, H, DMRG(; verbosity=0)) En_1, st_1 = excitations(H, QuasiparticleAnsatz(), ψ, envs; sector=SU2Irrep(1)) En_2, st_2 = excitations(H, QuasiparticleAnsatz(), ψ, envs; sector=SU2Irrep(2)) @@ -93,6 +99,8 @@ In contrast with the finite size case, we now should specify a momentum label to This way, it is possible to scan the dispersion relation over the entire momentum space. """ +chain = InfiniteChain(1) +H = heisenberg_XXX(symmetry, chain; J, spin) virtual_space_inf = Rep[SU₂](1 // 2 => 16, 3 // 2 => 16, 5 // 2 => 8, 7 // 2 => 4) ψ₀_inf = InfiniteMPS([physical_space], [virtual_space_inf]) ψ_inf, envs_inf, delta_inf = find_groundstate(ψ₀_inf, H; verbosity=0)