Real programs from weyl/examples/ paired with actual weylc outputs.
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é.
1model Z₂ toric code with a rough boundary2 3given Λ : square lattice on a cylinder (circumference L, height W)4given ∂Λ : boundary of Λ at y = 0 with dangling edges d_i5given ∂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 = −116 17define H₀ ≔ − J Σ_v A_v − J Σ_p B_p − Σ_i P_i18define V ≔ − x Σ_i σˣ_{d_i} − κ₁ Σ_i σᶻ_{d_i} − κ₂ Σ_i σᶻ_{h_i}19define H ≔ H₀ + V20 21claim H : Hermitian, local22claim [A_v, B_p] = 0 and [P_i, σˣ_{d_i}]₊ = 023claim ∂Λ condenses {1, e} at x = 0, κ₁ = 0, κ₂ = 024claim ∂top condenses {1, m} at x = 0, κ₁ = 0, κ₂ = 025 26expand H_eff ≔ pCUT of H around H₀27 to O(x¹⁵) at κ₁ = κ₂ = 0, to total order 10 in (x, κ₁, κ₂) otherwise28 in the sector where every conserved A_v, B_p equals +129 30define E_bulk ≔ −J (2W + 1) L31define e₀ ≔ (⟨vac| H_eff |vac⟩ − E_bulk) / L32define ω(k) ≔ one-particle dispersion of H_eff33define Δ ≔ ω(0)34estimate (x_c, zν) from Δ by dlog-Padé in x35 36compare H_eff with free fermions at κ₁ = κ₂ = 037compare H_eff through total order 10 with exact diagonalization on L = 12, W = 238 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.weylJ : positive integer, exactx : real number, exactκ₁ : real number, exactκ₂ : real number, exactA : Hermitian operator, support {h@(-1,0), d, h, u}, exactB : Hermitian operator, support {h, u, h@(0,1), u@(1,0)}, exactP : Hermitian operator, support {d, h, d@(1,0)}, exactH₀ : Hermitian operator, support {h@(-1,0), d, h, u, h@(0,1), d@(1,0), u@(1,0)}, exactV : Hermitian operator, support {d, h}, exactH : Hermitian operator, support {h@(-1,0), d, h, u, h@(0,1), d@(1,0), u@(1,0)}, exactH_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, exacte₀ : 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é)})