diff --git a/docs/src/examples/quantum1d/1.ising-cft/index.md b/docs/src/examples/quantum1d/1.ising-cft/index.md
index 81143e46a..fbfc7eeed 100644
--- a/docs/src/examples/quantum1d/1.ising-cft/index.md
+++ b/docs/src/examples/quantum1d/1.ising-cft/index.md
@@ -14,7 +14,7 @@ analysis to larger system sizes through the use of MPS techniques.
````julia
using MPSKit, MPSKitModels, TensorKit, Plots, KrylovKit
-using LinearAlgebra: eigen, diagm, Hermitian
+using LinearAlgebra: eigvals, diagm, Hermitian
````
The hamiltonian is defined on a finite lattice with periodic boundary conditions,
@@ -63,68 +63,70 @@ plot(real.(energies);
```
@@ -144,26 +146,15 @@ either diagramatically as
or in the code as:
````julia
-id = complex(isomorphism(ℂ^2, ℂ^2))
-@tensor O[-1 -2; -3 -4] := id[-1, -3] * id[-2, -4]
-T = periodic_boundary_conditions(InfiniteMPO([O]), L)
+function O_shift(L)
+ id = complex(isomorphism(ℂ^2, ℂ^2))
+ @tensor O[-1 -2; -3 -4] := id[-1, -3] * id[-2, -4]
+ return periodic_boundary_conditions(InfiniteMPO([O]), L)
+end
````
````
-12-site FiniteMPO{TensorKit.TensorMap{ComplexF64, TensorKit.ComplexSpace, 2, 2, Vector{ComplexF64}}}:
-┬ O[12]: TensorMap((ℂ^4 ⊗ ℂ^2) ← (ℂ^2 ⊗ ℂ^1))
-┼ O[11]: TensorMap((ℂ^4 ⊗ ℂ^2) ← (ℂ^2 ⊗ ℂ^4))
-┼ O[10]: TensorMap((ℂ^4 ⊗ ℂ^2) ← (ℂ^2 ⊗ ℂ^4))
-┼ O[9]: TensorMap((ℂ^4 ⊗ ℂ^2) ← (ℂ^2 ⊗ ℂ^4))
-┼ O[8]: TensorMap((ℂ^4 ⊗ ℂ^2) ← (ℂ^2 ⊗ ℂ^4))
-┼ O[7]: TensorMap((ℂ^4 ⊗ ℂ^2) ← (ℂ^2 ⊗ ℂ^4))
-┼ O[6]: TensorMap((ℂ^4 ⊗ ℂ^2) ← (ℂ^2 ⊗ ℂ^4))
-┼ O[5]: TensorMap((ℂ^4 ⊗ ℂ^2) ← (ℂ^2 ⊗ ℂ^4))
-┼ O[4]: TensorMap((ℂ^4 ⊗ ℂ^2) ← (ℂ^2 ⊗ ℂ^4))
-┼ O[3]: TensorMap((ℂ^4 ⊗ ℂ^2) ← (ℂ^2 ⊗ ℂ^4))
-┼ O[2]: TensorMap((ℂ^4 ⊗ ℂ^2) ← (ℂ^2 ⊗ ℂ^4))
-┴ O[1]: TensorMap((ℂ^1 ⊗ ℂ^2) ← (ℂ^2 ⊗ ℂ^4))
-
+O_shift (generic function with 1 method)
````
We can then calculate the momentum of the groundstate as the expectation value of this
@@ -171,23 +162,18 @@ operator. However, there is a subtlety because of the degeneracies in the energy
eigenvalues. The eigensolver will find an orthonormal basis within each energy subspace, but
this basis is not necessarily a basis of eigenstates of the translation operator. In order
to fix this, we diagonalize the translation operator within each energy subspace.
+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$.
````julia
-momentum(ψᵢ, ψⱼ=ψᵢ) = angle(dot(ψᵢ, T * ψⱼ))
-
function fix_degeneracies(basis)
- N = zeros(ComplexF64, length(basis), length(basis))
+ L = length(basis[1])
M = zeros(ComplexF64, length(basis), length(basis))
- for i in eachindex(basis), j in eachindex(basis)
- N[i, j] = dot(basis[i], basis[j])
- M[i, j] = momentum(basis[i], basis[j])
+ T = O_shift(L)
+ for j in eachindex(basis), i in eachindex(basis)
+ M[i, j] = dot(basis[i], T, basis[j])
end
- vals, vecs = eigen(Hermitian(N))
- M = (vecs' * M * vecs)
- M /= diagm(vals)
-
- vals, vecs = eigen(M)
+ vals = eigvals(M)
return angle.(vals)
end
@@ -202,80 +188,88 @@ append!(momenta, fix_degeneracies(states[12:12]))
append!(momenta, fix_degeneracies(states[13:16]))
append!(momenta, fix_degeneracies(states[17:18]))
-plot(momenta,
- real.(energies[1:18]);
- seriestype=:scatter,
- xlabel="momentum",
- ylabel="energy",
- legend=false)
+p = plot(momenta, real.(energies[1:18]);
+ seriestype=:scatter, xlabel="momentum", ylabel="energy", legend=false)
+vline!(p, [2π / L * i for i in -3:3]; color="gray", linestyle=:dash)
+hline!(p, [0, 1 / 8, 1, 9 / 8, 2, 17 / 8]; color="gray", linestyle=:dash)
+p
````
```@raw html
```
@@ -293,39 +287,34 @@ D = 64
````
````
-[ Info: DMRG init: obj = -1.985048003930e+01 err = 7.2317e-02
-[ Info: DMRG 1: obj = -2.549098966283e+01 err = 7.8053488477e-03 time = 2.60 sec
-[ Info: DMRG 2: obj = -2.549098968635e+01 err = 8.7334840815e-07 time = 0.67 sec
-[ Info: DMRG 3: obj = -2.549098968636e+01 err = 1.2954774429e-07 time = 0.65 sec
-[ Info: DMRG 4: obj = -2.549098968636e+01 err = 8.8619635923e-09 time = 0.38 sec
-[ Info: DMRG 5: obj = -2.549098968636e+01 err = 4.0315399959e-09 time = 0.80 sec
-[ Info: DMRG 6: obj = -2.549098968636e+01 err = 3.2944729108e-09 time = 0.37 sec
-[ Info: DMRG 7: obj = -2.549098968636e+01 err = 2.9865723847e-09 time = 0.41 sec
-[ Info: DMRG 8: obj = -2.549098968636e+01 err = 2.6357410693e-09 time = 0.42 sec
-[ Info: DMRG 9: obj = -2.549098968636e+01 err = 2.2240717932e-09 time = 0.42 sec
-[ Info: DMRG 10: obj = -2.549098968636e+01 err = 1.8085277012e-09 time = 0.42 sec
-[ Info: DMRG 11: obj = -2.549098968636e+01 err = 1.6691363159e-09 time = 0.40 sec
-[ Info: DMRG 12: obj = -2.549098968636e+01 err = 1.5815738385e-09 time = 0.40 sec
-[ Info: DMRG 13: obj = -2.549098968636e+01 err = 1.4646953060e-09 time = 0.41 sec
-[ Info: DMRG 14: obj = -2.549098968636e+01 err = 1.3303795749e-09 time = 0.40 sec
-[ Info: DMRG 15: obj = -2.549098968636e+01 err = 1.1895189194e-09 time = 0.39 sec
-[ Info: DMRG 16: obj = -2.549098968636e+01 err = 1.0506295654e-09 time = 0.39 sec
-[ Info: DMRG 17: obj = -2.549098968636e+01 err = 9.1947251000e-10 time = 0.39 sec
-[ Info: DMRG 18: obj = -2.549098968636e+01 err = 7.9934905173e-10 time = 0.78 sec
-[ Info: DMRG 19: obj = -2.549098968636e+01 err = 6.9168756403e-10 time = 0.34 sec
-[ Info: DMRG 20: obj = -2.549098968636e+01 err = 5.9665203224e-10 time = 0.42 sec
-[ Info: DMRG 21: obj = -2.549098968636e+01 err = 5.1364326892e-10 time = 0.43 sec
-[ Info: DMRG 22: obj = -2.549098968636e+01 err = 4.4166061761e-10 time = 0.45 sec
-[ Info: DMRG 23: obj = -2.549098968636e+01 err = 3.7953956622e-10 time = 0.44 sec
-[ Info: DMRG 24: obj = -2.549098968636e+01 err = 3.2609572758e-10 time = 0.44 sec
-[ Info: DMRG 25: obj = -2.549098968636e+01 err = 2.8020469415e-10 time = 0.44 sec
-[ Info: DMRG 26: obj = -2.549098968636e+01 err = 2.4084097310e-10 time = 0.44 sec
-[ Info: DMRG 27: obj = -2.549098968636e+01 err = 2.0709226936e-10 time = 0.44 sec
-[ Info: DMRG 28: obj = -2.549098968636e+01 err = 1.7815981840e-10 time = 0.43 sec
-[ Info: DMRG 29: obj = -2.549098968636e+01 err = 1.5335144532e-10 time = 0.44 sec
-[ Info: DMRG 30: obj = -2.549098968636e+01 err = 1.3207131024e-10 time = 0.44 sec
-[ Info: DMRG 31: obj = -2.549098968636e+01 err = 1.1380867710e-10 time = 0.45 sec
-[ Info: DMRG conv 32: obj = -2.549098968636e+01 err = 9.8126879511e-11 time = 17.14 sec
+[ Info: DMRG init: obj = -1.950932334537e+01 err = 7.6388e-02
+[ Info: DMRG 1: obj = -2.549098967614e+01 err = 4.9971525324e-03 time = 1.36 sec
+[ Info: DMRG 2: obj = -2.549098968636e+01 err = 8.4649097719e-07 time = 0.31 sec
+[ Info: DMRG 3: obj = -2.549098968636e+01 err = 1.0653583798e-07 time = 0.26 sec
+[ Info: DMRG 4: obj = -2.549098968636e+01 err = 1.0285945253e-08 time = 0.38 sec
+[ Info: DMRG 5: obj = -2.549098968636e+01 err = 4.9294778725e-09 time = 0.24 sec
+[ Info: DMRG 6: obj = -2.549098968636e+01 err = 3.4402601557e-09 time = 0.21 sec
+[ Info: DMRG 7: obj = -2.549098968636e+01 err = 2.6081578543e-09 time = 0.20 sec
+[ Info: DMRG 8: obj = -2.549098968636e+01 err = 1.9647429697e-09 time = 0.22 sec
+[ Info: DMRG 9: obj = -2.549098968636e+01 err = 1.4606856043e-09 time = 0.21 sec
+[ Info: DMRG 10: obj = -2.549098968636e+01 err = 1.0804235983e-09 time = 0.20 sec
+[ Info: DMRG 11: obj = -2.549098968636e+01 err = 8.7649268155e-10 time = 0.20 sec
+[ Info: DMRG 12: obj = -2.549098968636e+01 err = 7.6509949985e-10 time = 0.21 sec
+[ Info: DMRG 13: obj = -2.549098968636e+01 err = 6.6586719998e-10 time = 0.20 sec
+[ Info: DMRG 14: obj = -2.549098968636e+01 err = 5.7837098453e-10 time = 0.20 sec
+[ Info: DMRG 15: obj = -2.549098968636e+01 err = 5.0175362626e-10 time = 0.43 sec
+[ Info: DMRG 16: obj = -2.549098968636e+01 err = 4.3497459831e-10 time = 0.26 sec
+[ Info: DMRG 17: obj = -2.549098968636e+01 err = 3.7695147403e-10 time = 0.22 sec
+[ Info: DMRG 18: obj = -2.549098968636e+01 err = 3.2663807492e-10 time = 0.21 sec
+[ Info: DMRG 19: obj = -2.549098968636e+01 err = 2.8306434660e-10 time = 0.20 sec
+[ Info: DMRG 20: obj = -2.549098968636e+01 err = 2.4535365971e-10 time = 0.20 sec
+[ Info: DMRG 21: obj = -2.549098968636e+01 err = 2.1272698230e-10 time = 0.20 sec
+[ Info: DMRG 22: obj = -2.549098968636e+01 err = 1.8449972817e-10 time = 0.21 sec
+[ Info: DMRG 23: obj = -2.549098968636e+01 err = 1.6007478776e-10 time = 0.20 sec
+[ Info: DMRG 24: obj = -2.549098968636e+01 err = 1.3893409102e-10 time = 0.22 sec
+[ Info: DMRG 25: obj = -2.549098968636e+01 err = 1.2062942021e-10 time = 0.21 sec
+[ Info: DMRG 26: obj = -2.549098968636e+01 err = 1.0477391341e-10 time = 0.26 sec
+[ Info: DMRG conv 27: obj = -2.549098968636e+01 err = 9.1034011073e-11 time = 7.67 sec
````
@@ -338,7 +327,6 @@ E_ex, qps = excitations(H_mps, QuasiparticleAnsatz(), ψ, envs; num=16)
states_mps = vcat(ψ, map(qp -> convert(FiniteMPS, qp), qps))
E_mps = map(x -> expectation_value(x, H_mps), states_mps)
-T_mps = periodic_boundary_conditions(InfiniteMPO([O]), L_mps)
momenta_mps = Float64[]
append!(momenta_mps, fix_degeneracies(states[1:1]))
append!(momenta_mps, fix_degeneracies(states[2:2]))
@@ -349,78 +337,101 @@ append!(momenta_mps, fix_degeneracies(states[10:11]))
append!(momenta_mps, fix_degeneracies(states[12:12]))
append!(momenta_mps, fix_degeneracies(states[13:16]))
-plot(momenta_mps,
- real.(energies[1:16]);
- seriestype=:scatter,
- xlabel="momentum",
- ylabel="energy",
- legend=false)
+plot(momenta_mps, real.(energies[1:16]);
+ seriestype=:scatter, xlabel="momentum", ylabel="energy", legend=false)
+vline!(p, [2π / L * i for i in -3:3]; color="gray", linestyle=:dash)
+hline!(p, [0, 1 / 8, 1, 9 / 8, 2, 17 / 8]; color="gray", linestyle=:dash)
+p
````
```@raw html
```
diff --git a/docs/src/examples/quantum1d/1.ising-cft/main.ipynb b/docs/src/examples/quantum1d/1.ising-cft/main.ipynb
index 2273b27ca..fd42e14a9 100644
--- a/docs/src/examples/quantum1d/1.ising-cft/main.ipynb
+++ b/docs/src/examples/quantum1d/1.ising-cft/main.ipynb
@@ -16,7 +16,7 @@
"cell_type": "code",
"source": [
"using MPSKit, MPSKitModels, TensorKit, Plots, KrylovKit\n",
- "using LinearAlgebra: eigen, diagm, Hermitian"
+ "using LinearAlgebra: eigvals, diagm, Hermitian"
],
"metadata": {},
"execution_count": null
@@ -95,9 +95,11 @@
"outputs": [],
"cell_type": "code",
"source": [
- "id = complex(isomorphism(ℂ^2, ℂ^2))\n",
- "@tensor O[-1 -2; -3 -4] := id[-1, -3] * id[-2, -4]\n",
- "T = periodic_boundary_conditions(InfiniteMPO([O]), L)"
+ "function O_shift(L)\n",
+ " id = complex(isomorphism(ℂ^2, ℂ^2))\n",
+ " @tensor O[-1 -2; -3 -4] := id[-1, -3] * id[-2, -4]\n",
+ " return periodic_boundary_conditions(InfiniteMPO([O]), L)\n",
+ "end"
],
"metadata": {},
"execution_count": null
@@ -109,7 +111,8 @@
"operator. However, there is a subtlety because of the degeneracies in the energy\n",
"eigenvalues. The eigensolver will find an orthonormal basis within each energy subspace, but\n",
"this basis is not necessarily a basis of eigenstates of the translation operator. In order\n",
- "to fix this, we diagonalize the translation operator within each energy subspace."
+ "to fix this, we diagonalize the translation operator within each energy subspace.\n",
+ "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$."
],
"metadata": {}
},
@@ -117,21 +120,15 @@
"outputs": [],
"cell_type": "code",
"source": [
- "momentum(ψᵢ, ψⱼ=ψᵢ) = angle(dot(ψᵢ, T * ψⱼ))\n",
- "\n",
"function fix_degeneracies(basis)\n",
- " N = zeros(ComplexF64, length(basis), length(basis))\n",
+ " L = length(basis[1])\n",
" M = zeros(ComplexF64, length(basis), length(basis))\n",
- " for i in eachindex(basis), j in eachindex(basis)\n",
- " N[i, j] = dot(basis[i], basis[j])\n",
- " M[i, j] = momentum(basis[i], basis[j])\n",
+ " T = O_shift(L)\n",
+ " for j in eachindex(basis), i in eachindex(basis)\n",
+ " M[i, j] = dot(basis[i], T, basis[j])\n",
" end\n",
"\n",
- " vals, vecs = eigen(Hermitian(N))\n",
- " M = (vecs' * M * vecs)\n",
- " M /= diagm(vals)\n",
- "\n",
- " vals, vecs = eigen(M)\n",
+ " vals = eigvals(M)\n",
" return angle.(vals)\n",
"end\n",
"\n",
@@ -146,12 +143,11 @@
"append!(momenta, fix_degeneracies(states[13:16]))\n",
"append!(momenta, fix_degeneracies(states[17:18]))\n",
"\n",
- "plot(momenta,\n",
- " real.(energies[1:18]);\n",
- " seriestype=:scatter,\n",
- " xlabel=\"momentum\",\n",
- " ylabel=\"energy\",\n",
- " legend=false)"
+ "p = plot(momenta, real.(energies[1:18]);\n",
+ " seriestype=:scatter, xlabel=\"momentum\", ylabel=\"energy\", legend=false)\n",
+ "vline!(p, [2π / L * i for i in -3:3]; color=\"gray\", linestyle=:dash)\n",
+ "hline!(p, [0, 1 / 8, 1, 9 / 8, 2, 17 / 8]; color=\"gray\", linestyle=:dash)\n",
+ "p"
],
"metadata": {},
"execution_count": null
@@ -195,7 +191,6 @@
"states_mps = vcat(ψ, map(qp -> convert(FiniteMPS, qp), qps))\n",
"E_mps = map(x -> expectation_value(x, H_mps), states_mps)\n",
"\n",
- "T_mps = periodic_boundary_conditions(InfiniteMPO([O]), L_mps)\n",
"momenta_mps = Float64[]\n",
"append!(momenta_mps, fix_degeneracies(states[1:1]))\n",
"append!(momenta_mps, fix_degeneracies(states[2:2]))\n",
@@ -206,12 +201,11 @@
"append!(momenta_mps, fix_degeneracies(states[12:12]))\n",
"append!(momenta_mps, fix_degeneracies(states[13:16]))\n",
"\n",
- "plot(momenta_mps,\n",
- " real.(energies[1:16]);\n",
- " seriestype=:scatter,\n",
- " xlabel=\"momentum\",\n",
- " ylabel=\"energy\",\n",
- " legend=false)"
+ "plot(momenta_mps, real.(energies[1:16]);\n",
+ " seriestype=:scatter, xlabel=\"momentum\", ylabel=\"energy\", legend=false)\n",
+ "vline!(p, [2π / L * i for i in -3:3]; color=\"gray\", linestyle=:dash)\n",
+ "hline!(p, [0, 1 / 8, 1, 9 / 8, 2, 17 / 8]; color=\"gray\", linestyle=:dash)\n",
+ "p"
],
"metadata": {},
"execution_count": null
@@ -232,11 +226,11 @@
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
- "version": "1.11.4"
+ "version": "1.11.5"
},
"kernelspec": {
"name": "julia-1.11",
- "display_name": "Julia 1.11.4",
+ "display_name": "Julia 1.11.5",
"language": "julia"
}
},
diff --git a/examples/Cache.toml b/examples/Cache.toml
index b592e022c..9dd502d5e 100644
--- a/examples/Cache.toml
+++ b/examples/Cache.toml
@@ -7,5 +7,5 @@
"7.xy-finiteT" = "0243b44634d38d04ddd96b180fd1fc24e20485e97135cb7c805c9d60baab9ccb"
"3.ising-dqpt" = "f437ac4560db51f67e3997867c02bb8844b1077731b1dd1a06c61ab7c4846e97"
"5.haldane-spt" = "6443696b20d416652951c646cf78b604a7fd0d79804995588491ea53ca210d57"
-"1.ising-cft" = "bd1253451973aa73c4fee6b64d81ee52cc2feba5b9632f87ce332eea3a05f460"
"4.xxz-heisenberg" = "f8359ad29a028b01d41913014c0a442b99c3bd5cd403c23bd2a59f646a7c78cf"
+"1.ising-cft" = "f8e4987501c248a28dee6ada344e3638b515fdf28a451e6bb7ed22c0bec1fa8d"
diff --git a/examples/quantum1d/1.ising-cft/main.jl b/examples/quantum1d/1.ising-cft/main.jl
index 547560125..e0516e1dc 100644
--- a/examples/quantum1d/1.ising-cft/main.jl
+++ b/examples/quantum1d/1.ising-cft/main.jl
@@ -7,7 +7,7 @@ analysis to larger system sizes through the use of MPS techniques.
"""
using MPSKit, MPSKitModels, TensorKit, Plots, KrylovKit
-using LinearAlgebra: eigen, diagm, Hermitian
+using LinearAlgebra: eigvals, diagm, Hermitian
md"""
The hamiltonian is defined on a finite lattice with periodic boundary conditions,
@@ -52,9 +52,11 @@ either diagramatically as
or in the code as:
"""
-id = complex(isomorphism(ℂ^2, ℂ^2))
-@tensor O[-1 -2; -3 -4] := id[-1, -3] * id[-2, -4]
-T = periodic_boundary_conditions(InfiniteMPO([O]), L)
+function O_shift(L)
+ id = complex(isomorphism(ℂ^2, ℂ^2))
+ @tensor O[-1 -2; -3 -4] := id[-1, -3] * id[-2, -4]
+ return periodic_boundary_conditions(InfiniteMPO([O]), L)
+end
md"""
We can then calculate the momentum of the groundstate as the expectation value of this
@@ -62,23 +64,18 @@ operator. However, there is a subtlety because of the degeneracies in the energy
eigenvalues. The eigensolver will find an orthonormal basis within each energy subspace, but
this basis is not necessarily a basis of eigenstates of the translation operator. In order
to fix this, we diagonalize the translation operator within each energy subspace.
+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$.
"""
-momentum(ψᵢ, ψⱼ=ψᵢ) = angle(dot(ψᵢ, T * ψⱼ))
-
function fix_degeneracies(basis)
- N = zeros(ComplexF64, length(basis), length(basis))
+ L = length(basis[1])
M = zeros(ComplexF64, length(basis), length(basis))
- for i in eachindex(basis), j in eachindex(basis)
- N[i, j] = dot(basis[i], basis[j])
- M[i, j] = momentum(basis[i], basis[j])
+ T = O_shift(L)
+ for j in eachindex(basis), i in eachindex(basis)
+ M[i, j] = dot(basis[i], T, basis[j])
end
- vals, vecs = eigen(Hermitian(N))
- M = (vecs' * M * vecs)
- M /= diagm(vals)
-
- vals, vecs = eigen(M)
+ vals = eigvals(M)
return angle.(vals)
end
@@ -93,12 +90,11 @@ append!(momenta, fix_degeneracies(states[12:12]))
append!(momenta, fix_degeneracies(states[13:16]))
append!(momenta, fix_degeneracies(states[17:18]))
-plot(momenta,
- real.(energies[1:18]);
- seriestype=:scatter,
- xlabel="momentum",
- ylabel="energy",
- legend=false)
+p = plot(momenta, real.(energies[1:18]);
+ seriestype=:scatter, xlabel="momentum", ylabel="energy", legend=false)
+vline!(p, [2π / L * i for i in -3:3]; color="gray", linestyle=:dash)
+hline!(p, [0, 1 / 8, 1, 9 / 8, 2, 17 / 8]; color="gray", linestyle=:dash)
+p
md"""
## Finite bond dimension
@@ -122,7 +118,6 @@ E_ex, qps = excitations(H_mps, QuasiparticleAnsatz(), ψ, envs; num=16)
states_mps = vcat(ψ, map(qp -> convert(FiniteMPS, qp), qps))
E_mps = map(x -> expectation_value(x, H_mps), states_mps)
-T_mps = periodic_boundary_conditions(InfiniteMPO([O]), L_mps)
momenta_mps = Float64[]
append!(momenta_mps, fix_degeneracies(states[1:1]))
append!(momenta_mps, fix_degeneracies(states[2:2]))
@@ -133,9 +128,8 @@ append!(momenta_mps, fix_degeneracies(states[10:11]))
append!(momenta_mps, fix_degeneracies(states[12:12]))
append!(momenta_mps, fix_degeneracies(states[13:16]))
-plot(momenta_mps,
- real.(energies[1:16]);
- seriestype=:scatter,
- xlabel="momentum",
- ylabel="energy",
- legend=false)
+plot(momenta_mps, real.(energies[1:16]);
+ seriestype=:scatter, xlabel="momentum", ylabel="energy", legend=false)
+vline!(p, [2π / L * i for i in -3:3]; color="gray", linestyle=:dash)
+hline!(p, [0, 1 / 8, 1, 9 / 8, 2, 17 / 8]; color="gray", linestyle=:dash)
+p