|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "code", |
| 5 | + "execution_count": null, |
| 6 | + "metadata": {}, |
| 7 | + "outputs": [], |
| 8 | + "source": [ |
| 9 | + "using Markdown #hide" |
| 10 | + ] |
| 11 | + }, |
| 12 | + { |
| 13 | + "cell_type": "markdown", |
| 14 | + "metadata": {}, |
| 15 | + "source": [ |
| 16 | + "# Three-site simple update for the $J_1$-$J_2$ model\n", |
| 17 | + "\n", |
| 18 | + "In this example, we will use `SimpleUpdate` imaginary time evolution to treat\n", |
| 19 | + "the two-dimensional $J_1$-$J_2$ model, which contains next-nearest-nearest neighbor interactions:\n", |
| 20 | + "\n", |
| 21 | + "$$\n", |
| 22 | + "H = J_1 \\sum_{\\langle i,j \\rangle} \\mathbf{S}_i \\cdot \\mathbf{S}_j\n", |
| 23 | + "+ J_2 \\sum_{\\langle \\langle i,j \\rangle \\rangle} \\mathbf{S}_i \\cdot \\mathbf{S}_j\n", |
| 24 | + "$$\n", |
| 25 | + "\n", |
| 26 | + "Here we will exploit the $U(1)$ spin rotation symmetry in the $J_1$-$J_2$ model. The goal\n", |
| 27 | + "will be to calculate the energy at $J_1 = 1$ and $J_2 = 1/2$, first using the simple update\n", |
| 28 | + "algorithm and then, to refine the energy estimate, using AD-based variational PEPS\n", |
| 29 | + "optimization.\n", |
| 30 | + "\n", |
| 31 | + "We first import all required modules and seed the RNG:" |
| 32 | + ] |
| 33 | + }, |
| 34 | + { |
| 35 | + "cell_type": "code", |
| 36 | + "execution_count": null, |
| 37 | + "metadata": {}, |
| 38 | + "outputs": [], |
| 39 | + "source": [ |
| 40 | + "using Random\n", |
| 41 | + "using TensorKit, PEPSKit\n", |
| 42 | + "Random.seed!(2025);" |
| 43 | + ] |
| 44 | + }, |
| 45 | + { |
| 46 | + "cell_type": "markdown", |
| 47 | + "metadata": {}, |
| 48 | + "source": [ |
| 49 | + "## Simple updating a challenging phase\n", |
| 50 | + "\n", |
| 51 | + "Let's start by initializing an `InfiniteWeightPEPS` for which we set the required parameters\n", |
| 52 | + "as well as physical and virtual vector spaces. We use the minimal unit cell size\n", |
| 53 | + "($2 \\times 2$) required by the simple update algorithm for Hamiltonians with\n", |
| 54 | + "next-nearest-neighbour interactions:" |
| 55 | + ] |
| 56 | + }, |
| 57 | + { |
| 58 | + "cell_type": "code", |
| 59 | + "execution_count": null, |
| 60 | + "metadata": {}, |
| 61 | + "outputs": [], |
| 62 | + "source": [ |
| 63 | + "Dbond, χenv, symm = 4, 32, U1Irrep\n", |
| 64 | + "trscheme_env = truncerr(1e-10) & truncdim(χenv)\n", |
| 65 | + "Nr, Nc, J1 = 2, 2, 1.0\n", |
| 66 | + "\n", |
| 67 | + "# random initialization of 2x2 iPEPS with weights and CTMRGEnv (using real numbers)\n", |
| 68 | + "Pspace = Vect[U1Irrep](1//2 => 1, -1//2 => 1)\n", |
| 69 | + "Vspace = Vect[U1Irrep](0 => 2, 1//2 => 1, -1//2 => 1)\n", |
| 70 | + "Espace = Vect[U1Irrep](0 => χenv ÷ 2, 1//2 => χenv ÷ 4, -1//2 => χenv ÷ 4)\n", |
| 71 | + "wpeps = InfiniteWeightPEPS(rand, Float64, Pspace, Vspace; unitcell=(Nr, Nc));" |
| 72 | + ] |
| 73 | + }, |
| 74 | + { |
| 75 | + "cell_type": "markdown", |
| 76 | + "metadata": {}, |
| 77 | + "source": [ |
| 78 | + "The value $J_2 / J_1 = 0.5$ corresponds to a [possible spin liquid phase](@cite liu_gapless_2022),\n", |
| 79 | + "which is challenging for SU to produce a relatively good state from random initialization.\n", |
| 80 | + "Therefore, we shall gradually increase $J_2 / J_1$ from 0.1 to 0.5, each time initializing\n", |
| 81 | + "on the previously evolved PEPS:" |
| 82 | + ] |
| 83 | + }, |
| 84 | + { |
| 85 | + "cell_type": "code", |
| 86 | + "execution_count": null, |
| 87 | + "metadata": {}, |
| 88 | + "outputs": [], |
| 89 | + "source": [ |
| 90 | + "dt, tol, maxiter = 1e-2, 1e-8, 30000\n", |
| 91 | + "check_interval = 4000\n", |
| 92 | + "trscheme_peps = truncerr(1e-10) & truncdim(Dbond)\n", |
| 93 | + "alg = SimpleUpdate(dt, tol, maxiter, trscheme_peps)\n", |
| 94 | + "for J2 in 0.1:0.1:0.5\n", |
| 95 | + " H = real( ## convert Hamiltonian `LocalOperator` to real floats\n", |
| 96 | + " j1_j2_model(ComplexF64, symm, InfiniteSquare(Nr, Nc); J1, J2, sublattice=false),\n", |
| 97 | + " )\n", |
| 98 | + " result = simpleupdate(wpeps, H, alg; check_interval)\n", |
| 99 | + " global wpeps = result[1]\n", |
| 100 | + "end" |
| 101 | + ] |
| 102 | + }, |
| 103 | + { |
| 104 | + "cell_type": "markdown", |
| 105 | + "metadata": {}, |
| 106 | + "source": [ |
| 107 | + "After we reach $J_2 / J_1 = 0.5$, we gradually decrease the evolution time step to obtain\n", |
| 108 | + "a more accurately evolved PEPS:" |
| 109 | + ] |
| 110 | + }, |
| 111 | + { |
| 112 | + "cell_type": "code", |
| 113 | + "execution_count": null, |
| 114 | + "metadata": {}, |
| 115 | + "outputs": [], |
| 116 | + "source": [ |
| 117 | + "dts = [1e-3, 1e-4]\n", |
| 118 | + "tols = [1e-9, 1e-9]\n", |
| 119 | + "J2 = 0.5\n", |
| 120 | + "H = real(j1_j2_model(ComplexF64, symm, InfiniteSquare(Nr, Nc); J1, J2, sublattice=false))\n", |
| 121 | + "for (dt, tol) in zip(dts, tols)\n", |
| 122 | + " alg′ = SimpleUpdate(dt, tol, maxiter, trscheme_peps)\n", |
| 123 | + " result = simpleupdate(wpeps, H, alg′; check_interval)\n", |
| 124 | + " global wpeps = result[1]\n", |
| 125 | + "end" |
| 126 | + ] |
| 127 | + }, |
| 128 | + { |
| 129 | + "cell_type": "markdown", |
| 130 | + "metadata": {}, |
| 131 | + "source": [ |
| 132 | + "## Computing the simple update energy estimate\n", |
| 133 | + "\n", |
| 134 | + "Finally, we measure the ground-state energy by converging a CTMRG environment and computing\n", |
| 135 | + "the expectation value, where we make sure to normalize by the unit cell size:" |
| 136 | + ] |
| 137 | + }, |
| 138 | + { |
| 139 | + "cell_type": "code", |
| 140 | + "execution_count": null, |
| 141 | + "metadata": {}, |
| 142 | + "outputs": [], |
| 143 | + "source": [ |
| 144 | + "peps = InfinitePEPS(wpeps)\n", |
| 145 | + "normalize!.(peps.A, Inf) ## normalize PEPS with absorbed weights by largest element\n", |
| 146 | + "env₀ = CTMRGEnv(rand, Float64, peps, Espace)\n", |
| 147 | + "env, = leading_boundary(env₀, peps; tol=1e-10, alg=:sequential, trscheme=trscheme_env);\n", |
| 148 | + "E = expectation_value(peps, H, env) / (Nr * Nc)" |
| 149 | + ] |
| 150 | + }, |
| 151 | + { |
| 152 | + "cell_type": "markdown", |
| 153 | + "metadata": {}, |
| 154 | + "source": [ |
| 155 | + "Let us compare that estimate with benchmark data obtained from the\n", |
| 156 | + "[YASTN/peps-torch package](https://github.com/jurajHasik/j1j2_ipeps_states/blob/ea4140fbd7da0fc1b75fac2871f75bda125189a8/single-site_pg-C4v-A1_internal-U1/j20.5/state_1s_A1_U1B_j20.5_D4_chi_opt96.dat).\n", |
| 157 | + "which utilizes AD-based PEPS optimization to find $E_\\text{ref}=-0.49425$:" |
| 158 | + ] |
| 159 | + }, |
| 160 | + { |
| 161 | + "cell_type": "code", |
| 162 | + "execution_count": null, |
| 163 | + "metadata": {}, |
| 164 | + "outputs": [], |
| 165 | + "source": [ |
| 166 | + "E_ref = -0.49425\n", |
| 167 | + "@show (E - E_ref) / abs(E_ref);" |
| 168 | + ] |
| 169 | + }, |
| 170 | + { |
| 171 | + "cell_type": "markdown", |
| 172 | + "metadata": {}, |
| 173 | + "source": [ |
| 174 | + "## Variational PEPS optimization using AD\n", |
| 175 | + "\n", |
| 176 | + "As a last step, we will use the SU-evolved PEPS as a starting point for a `fixedpoint`\n", |
| 177 | + "PEPS optimization. Note that we could have also used a sublattice-rotated version of `H` to\n", |
| 178 | + "fit the Hamiltonian onto a single-site unit cell which would require us to optimize fewer\n", |
| 179 | + "parameters and hence lead to a faster optimization. But here we instead take advantage of\n", |
| 180 | + "the already evolved `peps`, thus giving us a physical initial guess for the optimization:" |
| 181 | + ] |
| 182 | + }, |
| 183 | + { |
| 184 | + "cell_type": "code", |
| 185 | + "execution_count": null, |
| 186 | + "metadata": {}, |
| 187 | + "outputs": [], |
| 188 | + "source": [ |
| 189 | + "peps_opt, env_opt, E_opt, = fixedpoint(\n", |
| 190 | + " H, peps, env; optimizer_alg=(; tol=1e-4, maxiter=120)\n", |
| 191 | + ");" |
| 192 | + ] |
| 193 | + }, |
| 194 | + { |
| 195 | + "cell_type": "markdown", |
| 196 | + "metadata": {}, |
| 197 | + "source": [ |
| 198 | + "Finally, we compare the variationally optimized energy against the reference energy. Indeed,\n", |
| 199 | + "we find that the additional AD-based optimization improves the SU-evolved PEPS and leads to\n", |
| 200 | + "a more accurate energy estimate." |
| 201 | + ] |
| 202 | + }, |
| 203 | + { |
| 204 | + "cell_type": "code", |
| 205 | + "execution_count": null, |
| 206 | + "metadata": {}, |
| 207 | + "outputs": [], |
| 208 | + "source": [ |
| 209 | + "E_opt /= (Nr * Nc)\n", |
| 210 | + "@show E_opt\n", |
| 211 | + "@show (E_opt - E_ref) / abs(E_ref);" |
| 212 | + ] |
| 213 | + }, |
| 214 | + { |
| 215 | + "cell_type": "markdown", |
| 216 | + "metadata": {}, |
| 217 | + "source": [ |
| 218 | + "---\n", |
| 219 | + "\n", |
| 220 | + "*This notebook was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*" |
| 221 | + ] |
| 222 | + } |
| 223 | + ], |
| 224 | + "metadata": { |
| 225 | + "kernelspec": { |
| 226 | + "display_name": "Julia 1.11.5", |
| 227 | + "language": "julia", |
| 228 | + "name": "julia-1.11" |
| 229 | + }, |
| 230 | + "language_info": { |
| 231 | + "file_extension": ".jl", |
| 232 | + "mimetype": "application/julia", |
| 233 | + "name": "julia", |
| 234 | + "version": "1.11.5" |
| 235 | + } |
| 236 | + }, |
| 237 | + "nbformat": 4, |
| 238 | + "nbformat_minor": 3 |
| 239 | +} |
0 commit comments