Skip to content

Examples

Real programs from weyl/examples/ paired with actual weylc outputs.

Z₂ Toric Code Rough–Smooth Cylinder Boundary Transition

Z₂ Toric Code on a rough–smooth cylinder: 14th-order pCUT checked against exact free fermions at κ₁=κ₂=0, and finite-J corrections verified with ED and dlog-Padé.

examples/toric_boundary.weyl
1model Z₂ toric code with a rough boundary
2
3given Λ : square lattice on a cylinder (circumference L, height W)
4given ∂Λ : boundary of Λ at y = 0 with dangling edges d_i
5given ∂top : smooth termination of Λ at y = W -- 几何与截断星按 2.1 定义
6given σ : qubit on edges(Λ)
7given J : positive integer -- 假设 A3:整数 J 保证 H₀ 谱等间距
8given x, κ₁, κ₂ : small parameter -- 展开变量
9
10define A_v ≔ ∏_{l ∋ v} σˣ_l for v ∈ vertices(Λ)
11define B_p ≔ ∏_{l ∈ ∂p} σᶻ_l for p ∈ plaquettes(Λ)
12define P_i ≔ σᶻ_{d_i} σᶻ_{h_i} σᶻ_{d_{i+1}} for i ∈ cells(∂Λ)
13
14given 𝒞 : topological order D(ℤ₂)
15 with e ↔ A_v = −1, m ↔ B_p = −1 or P_i = −1
16
17define H₀ ≔ − J Σ_v A_v − J Σ_p B_p − Σ_i P_i
18define V ≔ − x Σ_i σˣ_{d_i} − κ₁ Σ_i σᶻ_{d_i} − κ₂ Σ_i σᶻ_{h_i}
19define H ≔ H₀ + V
20
21claim H : Hermitian, local
22claim [A_v, B_p] = 0 and [P_i, σˣ_{d_i}]₊ = 0
23claim ∂Λ condenses {1, e} at x = 0, κ₁ = 0, κ₂ = 0
24claim ∂top condenses {1, m} at x = 0, κ₁ = 0, κ₂ = 0
25
26expand H_eff ≔ pCUT of H around H₀
27 to O(x¹⁵) at κ₁ = κ₂ = 0, to total order 10 in (x, κ₁, κ₂) otherwise
28 in the sector where every conserved A_v, B_p equals +1
29
30define E_bulk ≔ −J (2W + 1) L
31define e₀ ≔ (⟨vac| H_eff |vac⟩ − E_bulk) / L
32define ω(k) ≔ one-particle dispersion of H_eff
33define Δ ≔ ω(0)
34estimate (x_c, zν) from Δ by dlog-Padé in x
35
36compare H_eff with free fermions at κ₁ = κ₂ = 0
37compare H_eff through total order 10 with exact diagonalization on L = 12, W = 2
38 by vacuum sector (k = 0, W_e^top = +1)
39 and one-particle sector (k, W_e^top = −1)
40 using double-double arithmetic, residual protocol of section 6.7
$ weylc explain examples/toric_boundary.weyl
J : positive integer, exact
x : real number, exact
κ₁ : real number, exact
κ₂ : real number, exact
A : Hermitian operator, support {h@(-1,0), d, h, u}, exact
B : Hermitian operator, support {h, u, h@(0,1), u@(1,0)}, exact
P : Hermitian operator, support {d, h, d@(1,0)}, exact
H₀ : Hermitian operator, support {h@(-1,0), d, h, u, h@(0,1), d@(1,0), u@(1,0)}, exact
V : Hermitian operator, support {d, h}, exact
H : Hermitian operator, support {h@(-1,0), d, h, u, h@(0,1), d@(1,0), u@(1,0)}, exact
H_eff : Hermitian operator, support {h@(-1,0), d, h, u, h@(0,1), d@(1,0), u@(1,0)}, + O(x^15)
E_bulk : positive integer, exact
e₀ : power series in (x) + O(x^15)
ω : power series in (x) + O(x^15)
Δ : power series in (x) + O(x^15)
x_c : real number ± σ (extrapolated: Epi{PadeSpread(dlog-Padé)})
zν : real number ± σ (extrapolated: Epi{PadeSpread(dlog-Padé)})

Weyl v0.1 · MIT License