Skip to content

Commit e740d6a

Browse files
authored
Fix translation operator in Ising CFT example (#304)
* Update Ising CFT example * Update example checksum to use relative path * Regenerate examples with updated hashes * Proper semicolons for clarity * Don't blind copy things * Reregenerate examples * Once more but with labels * Actually use the MPS results * Try that again * Actually use MPS data, plot against conformal spin to remove size dependency
1 parent 10c95b1 commit e740d6a

File tree

19 files changed

+2727
-2716
lines changed

19 files changed

+2727
-2716
lines changed

docs/src/examples/classic2d/1.hard-hexagon/index.md

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

docs/src/examples/classic2d/1.hard-hexagon/main.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@
145145
"file_extension": ".jl",
146146
"mimetype": "application/julia",
147147
"name": "julia",
148-
"version": "1.11.4"
148+
"version": "1.10.4"
149149
},
150150
"kernelspec": {
151-
"name": "julia-1.11",
152-
"display_name": "Julia 1.11.4",
151+
"name": "julia-1.10",
152+
"display_name": "Julia 1.10.4",
153153
"language": "julia"
154154
}
155155
},

docs/src/examples/quantum1d/1.ising-cft/index.md

Lines changed: 271 additions & 270 deletions
Large diffs are not rendered by default.

docs/src/examples/quantum1d/1.ising-cft/main.ipynb

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
"cell_type": "code",
9797
"source": [
9898
"function O_shift(L)\n",
99-
" τ = BraidingTensor{ComplexF64}(ℂ^2, ℂ^2)\n",
100-
" O = TensorMap(τ)\n",
99+
" I = id(ComplexF64, ℂ^2)\n",
100+
" @tensor O[W S; N E] := I[W; N] * I[S; E]\n",
101101
" return periodic_boundary_conditions(InfiniteMPO([O]), L)\n",
102102
"end"
103103
],
@@ -112,7 +112,8 @@
112112
"eigenvalues. The eigensolver will find an orthonormal basis within each energy subspace, but\n",
113113
"this basis is not necessarily a basis of eigenstates of the translation operator. In order\n",
114114
"to fix this, we diagonalize the translation operator within each energy subspace.\n",
115-
"The resulting energy levels have one-to-one correspondence to the operators in CFT, where the momentum is related to their conformal spin as $P_n = \\frac{2\\pi}{L}S_n$."
115+
"The resulting energy levels have one-to-one correspondence to the operators in CFT, where\n",
116+
"the momentum is related to their conformal spin as $P_n = \\frac{2\\pi}{L}S_n$."
116117
],
117118
"metadata": {}
118119
},
@@ -149,7 +150,10 @@
149150
{
150151
"cell_type": "markdown",
151152
"source": [
152-
"Calculating scaling dimensions from the energy gap"
153+
"We can compute the scaling dimensions $\\Delta_n$ of the operators in the CFT from the\n",
154+
"energy gap of the corresponding excitations as $E_n - E_0 = \\frac{2\\pi v}{L} \\Delta_n$,\n",
155+
"where $v = 2$. If we plot these scaling dimensions against the conformal spin $S_n$ from\n",
156+
"above, we retrieve the familiar spectrum of the Ising CFT."
153157
],
154158
"metadata": {}
155159
},
@@ -159,9 +163,12 @@
159163
"source": [
160164
"v = 2.0\n",
161165
"Δ = real.(energies[1:18] .- energies[1]) ./ (2π * v / L)\n",
162-
"p = plot(momenta, real.(Δ);\n",
163-
" seriestype=:scatter, xlabel=\"momentum\", ylabel=\"energy\", legend=false)\n",
164-
"vline!(p, [2π / L * i for i in -3:3]; color=\"gray\", linestyle=:dash)\n",
166+
"S = momenta ./ (2π / L)\n",
167+
"\n",
168+
"p = plot(S, real.(Δ);\n",
169+
" seriestype=:scatter, xlabel=\"conformal spin (S)\", ylabel=\"scaling dimension (Δ)\",\n",
170+
" legend=false)\n",
171+
"vline!(p, -3:3; color=\"gray\", linestyle=:dash)\n",
165172
"hline!(p, [0, 1 / 8, 1, 9 / 8, 2, 17 / 8]; color=\"gray\", linestyle=:dash)\n",
166173
"p"
167174
],
@@ -203,27 +210,31 @@
203210
"outputs": [],
204211
"cell_type": "code",
205212
"source": [
206-
"E_ex, qps = excitations(H_mps, QuasiparticleAnsatz(), ψ, envs; num=16)\n",
213+
"E_ex, qps = excitations(H_mps, QuasiparticleAnsatz(), ψ, envs; num=18)\n",
207214
"states_mps = vcat(ψ, map(qp -> convert(FiniteMPS, qp), qps))\n",
208-
"E_mps = map(x -> expectation_value(x, H_mps), states_mps)\n",
215+
"energies_mps = map(x -> expectation_value(x, H_mps), states_mps)\n",
209216
"\n",
210217
"momenta_mps = Float64[]\n",
211-
"append!(momenta_mps, fix_degeneracies(states[1:1]))\n",
212-
"append!(momenta_mps, fix_degeneracies(states[2:2]))\n",
213-
"append!(momenta_mps, fix_degeneracies(states[3:3]))\n",
214-
"append!(momenta_mps, fix_degeneracies(states[4:5]))\n",
215-
"append!(momenta_mps, fix_degeneracies(states[6:9]))\n",
216-
"append!(momenta_mps, fix_degeneracies(states[10:11]))\n",
217-
"append!(momenta_mps, fix_degeneracies(states[12:12]))\n",
218-
"append!(momenta_mps, fix_degeneracies(states[13:16]))\n",
218+
"append!(momenta_mps, fix_degeneracies(states_mps[1:1]))\n",
219+
"append!(momenta_mps, fix_degeneracies(states_mps[2:2]))\n",
220+
"append!(momenta_mps, fix_degeneracies(states_mps[3:3]))\n",
221+
"append!(momenta_mps, fix_degeneracies(states_mps[4:5]))\n",
222+
"append!(momenta_mps, fix_degeneracies(states_mps[6:9]))\n",
223+
"append!(momenta_mps, fix_degeneracies(states_mps[10:11]))\n",
224+
"append!(momenta_mps, fix_degeneracies(states_mps[12:12]))\n",
225+
"append!(momenta_mps, fix_degeneracies(states_mps[13:16]))\n",
226+
"append!(momenta_mps, fix_degeneracies(states_mps[17:18]))\n",
219227
"\n",
220228
"v = 2.0\n",
221-
"Δ = real.(energies[1:18] .- energies[1]) ./ (2π * v / L)\n",
222-
"plot(momenta_mps, Δ;\n",
223-
" seriestype=:scatter, xlabel=\"momentum\", ylabel=\"energy\", legend=false)\n",
224-
"vline!(p, [2π / L * i for i in -3:3]; color=\"gray\", linestyle=:dash)\n",
225-
"hline!(p, [0, 1 / 8, 1, 9 / 8, 2, 17 / 8]; color=\"gray\", linestyle=:dash)\n",
226-
"p"
229+
"Δ_mps = real.(energies_mps[1:18] .- energies_mps[1]) ./ (2π * v / L_mps)\n",
230+
"S_mps = momenta_mps ./ (2π / L_mps)\n",
231+
"\n",
232+
"p_mps = plot(S_mps, real.(Δ_mps);\n",
233+
" seriestype=:scatter, xlabel=\"conformal spin (S)\",\n",
234+
" ylabel=\"scaling dimension (Δ)\", legend=false)\n",
235+
"vline!(p_mps, -3:3; color=\"gray\", linestyle=:dash)\n",
236+
"hline!(p_mps, [0, 1 / 8, 1, 9 / 8, 2, 17 / 8]; color=\"gray\", linestyle=:dash)\n",
237+
"p_mps"
227238
],
228239
"metadata": {},
229240
"execution_count": null
@@ -244,11 +255,11 @@
244255
"file_extension": ".jl",
245256
"mimetype": "application/julia",
246257
"name": "julia",
247-
"version": "1.11.5"
258+
"version": "1.10.4"
248259
},
249260
"kernelspec": {
250-
"name": "julia-1.11",
251-
"display_name": "Julia 1.11.5",
261+
"name": "julia-1.10",
262+
"display_name": "Julia 1.10.4",
252263
"language": "julia"
253264
}
254265
},

docs/src/examples/quantum1d/2.haldane/index.md

Lines changed: 112 additions & 110 deletions
Large diffs are not rendered by default.

docs/src/examples/quantum1d/2.haldane/main.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@
187187
"file_extension": ".jl",
188188
"mimetype": "application/julia",
189189
"name": "julia",
190-
"version": "1.11.4"
190+
"version": "1.10.4"
191191
},
192192
"kernelspec": {
193-
"name": "julia-1.11",
194-
"display_name": "Julia 1.11.4",
193+
"name": "julia-1.10",
194+
"display_name": "Julia 1.10.4",
195195
"language": "julia"
196196
}
197197
},

docs/src/examples/quantum1d/3.ising-dqpt/index.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@ H₀ = transverse_field_ising(FiniteChain(L); g=-0.5)
3939
````
4040

4141
````
42-
[ Info: DMRG init: obj = +9.627138678740e+00 err = 1.5287e-01
43-
[ Info: DMRG 1: obj = -2.040021714898e+01 err = 1.5582585194e-02 time = 0.10 sec
44-
[ Info: DMRG 2: obj = -2.040021715175e+01 err = 3.4655395009e-07 time = 0.02 sec
45-
[ Info: DMRG 3: obj = -2.040021763026e+01 err = 3.7385206468e-05 time = 0.06 sec
46-
[ Info: DMRG 4: obj = -2.040021786702e+01 err = 2.1782648849e-06 time = 0.04 sec
47-
[ Info: DMRG 5: obj = -2.040021786703e+01 err = 1.3998187485e-07 time = 0.02 sec
48-
[ Info: DMRG conv 6: obj = -2.040021786703e+01 err = 9.0384912069e-11 time = 0.26 sec
42+
[ Info: DMRG init: obj = +9.906929661608e+00 err = 1.4654e-01
43+
[ Info: DMRG 1: obj = -2.040021714938e+01 err = 9.3181641986e-04 time = 0.05 sec
44+
[ Info: DMRG 2: obj = -2.040021715179e+01 err = 2.4688856530e-07 time = 0.03 sec
45+
[ Info: DMRG 3: obj = -2.040021786221e+01 err = 4.2747944525e-05 time = 0.08 sec
46+
[ Info: DMRG 4: obj = -2.040021786699e+01 err = 1.6446674043e-06 time = 0.04 sec
47+
[ Info: DMRG 5: obj = -2.040021786703e+01 err = 2.4678293656e-07 time = 0.03 sec
48+
[ Info: DMRG 6: obj = -2.040021786703e+01 err = 2.3749087526e-10 time = 0.03 sec
49+
[ Info: DMRG conv 7: obj = -2.040021786703e+01 err = 4.3310784899e-12 time = 0.29 sec
4950
5051
````
5152

@@ -111,14 +112,13 @@ H₀ = transverse_field_ising(; g=-0.5)
111112
````
112113

113114
````
114-
[ Info: VUMPS init: obj = +4.981979532800e-01 err = 3.9530e-01
115-
[ Info: VUMPS 1: obj = -1.030701827098e+00 err = 1.0340065851e-01 time = 6.72 sec
116-
[ Info: VUMPS 2: obj = -1.063544326030e+00 err = 2.9155624606e-04 time = 0.01 sec
117-
[ Info: VUMPS 3: obj = -1.063544409971e+00 err = 1.8767724186e-06 time = 0.01 sec
118-
[ Info: VUMPS 4: obj = -1.063544409973e+00 err = 2.0959736412e-08 time = 0.00 sec
119-
[ Info: VUMPS 5: obj = -1.063544409973e+00 err = 2.7005924256e-09 time = 0.00 sec
120-
[ Info: VUMPS 6: obj = -1.063544409973e+00 err = 3.0434524435e-10 time = 0.00 sec
121-
[ Info: VUMPS conv 7: obj = -1.063544409973e+00 err = 2.4566755222e-11 time = 6.75 sec
115+
[ Info: VUMPS init: obj = +4.937592959715e-01 err = 3.8640e-01
116+
[ Info: VUMPS 1: obj = -1.041532472680e+00 err = 1.0207037612e-01 time = 7.91 sec
117+
[ Info: VUMPS 2: obj = -1.063544395012e+00 err = 1.0570052184e-04 time = 0.01 sec
118+
[ Info: VUMPS 3: obj = -1.063544409972e+00 err = 1.3451291600e-06 time = 0.01 sec
119+
[ Info: VUMPS 4: obj = -1.063544409973e+00 err = 2.1982905922e-08 time = 0.00 sec
120+
[ Info: VUMPS 5: obj = -1.063544409973e+00 err = 8.6218866571e-10 time = 0.00 sec
121+
[ Info: VUMPS conv 6: obj = -1.063544409973e+00 err = 7.1345139950e-11 time = 7.94 sec
122122
123123
````
124124

@@ -130,7 +130,7 @@ dot(ψ₀, ψ₀)
130130
````
131131

132132
````
133-
1.0000000000000053 - 8.519001927175606e-17im
133+
0.9999999999999991 + 5.43344267830843e-16im
134134
````
135135

136136
so the loschmidth echo takes on the pleasant form

docs/src/examples/quantum1d/3.ising-dqpt/main.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,11 @@
285285
"file_extension": ".jl",
286286
"mimetype": "application/julia",
287287
"name": "julia",
288-
"version": "1.11.4"
288+
"version": "1.10.4"
289289
},
290290
"kernelspec": {
291-
"name": "julia-1.11",
292-
"display_name": "Julia 1.11.4",
291+
"name": "julia-1.10",
292+
"display_name": "Julia 1.10.4",
293293
"language": "julia"
294294
}
295295
},

0 commit comments

Comments
 (0)