Skip to content

Commit 1c1d1f7

Browse files
Yue-Zhengyuanlkdvospbrehmer
authored
Add 3-site simple update (aka 3-site cluster update) (#171)
- Implement the simple update algorithm for 3-site clusters such as in next-nearest-neighbor interactions - Define `real` and `imag` for `LocalOperator`s - Add corresponding tests - Add a commented J1-J2 simple update example --------- Co-authored-by: Lukas Devos <[email protected]> Co-authored-by: Paul Brehmer <[email protected]>
1 parent db7ae37 commit 1c1d1f7

File tree

15 files changed

+1604
-97
lines changed

15 files changed

+1604
-97
lines changed

.github/workflows/Tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
- examples
3333
- utility
3434
- bondenv
35+
- timeevol
3536
os:
3637
- ubuntu-latest
3738
- macOS-latest

docs/make.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ mathengine = MathJax3(
4343
# examples pages
4444
examples_optimization =
4545
joinpath.(["heisenberg", "bose_hubbard", "xxz", "fermi_hubbard"], Ref("index.md"))
46-
examples_time_evolution = joinpath.(["heisenberg_su", "hubbard_su"], Ref("index.md"))
46+
examples_time_evolution =
47+
joinpath.(["heisenberg_su", "hubbard_su", "j1j2_su"], Ref("index.md"))
4748
examples_partition_functions =
4849
joinpath.(
4950
["2d_ising_partition_function", "3d_ising_partition_function"], Ref("index.md")

docs/src/assets/pepskit.bib

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,16 @@ @article{vanderstraeten_variational_2022
134134
publisher = {American Physical Society},
135135
doi = {10.1103/PhysRevB.105.195140}
136136
}
137+
138+
@article{liu_gapless_2022,
139+
title = {Gapless quantum spin liquid and global phase diagram of the spin-1/2 J1-J2 square antiferromagnetic Heisenberg model},
140+
journal = {Science Bulletin},
141+
volume = {67},
142+
number = {10},
143+
pages = {1034-1041},
144+
year = {2022},
145+
issn = {2095-9273},
146+
doi = {10.1016/j.scib.2022.03.010},
147+
url = {https://www.sciencedirect.com/science/article/pii/S2095927322001001},
148+
author = {Wen-Yuan Liu and Shou-Shu Gong and Yu-Bin Li and Didier Poilblanc and Wei-Qiang Chen and Zheng-Cheng Gu},
149+
}

docs/src/examples/j1j2_su/index.md

Lines changed: 341 additions & 0 deletions
Large diffs are not rendered by default.

docs/src/examples/j1j2_su/main.ipynb

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
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+
}

examples/Cache.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ boundary_mps = "31e14bd742c12acfc4facd5bc8f28752f025a1a523c72ffccc8581e38880d3cd
66
heisenberg_su = "299b79f36b94b301dafa0d39fc54498b44dcdf0e4988e3c5416aa6c4e9e8f584"
77
xxz = "b5ab0efe6b9addb4b029250d7212d8b2e771136ca4ec4a4bfd7bccc8c688b949"
88
fermi_hubbard = "13d6d827a9851bef2c47cbe8894bf6eec9e1fb3222ecc24d2a876336553439ff"
9+
j1j2_su = "883df8a1ccf061754538620c1086e2e13f1fd7821b8f2f489f305d0cf7098908"
910
heisenberg = "f6b057dacb058656ad903778fc00832c6c8a61df930118872e04006b086030c7"

0 commit comments

Comments
 (0)