Skip to content

A domain-specific language for theoretical physics.

Types are representations: an operator's type is its content under the symmetry group. Write lattice models, symmetries, and perturbation series in paper notation; broken symmetry, wrong physics, and missing remainders fail at compile time.

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 σ : qubit on edges(Λ)
6given J : positive integer
7given x, κ₁, κ₂ : small parameter
8
9define A_v ≔ ∏_{l ∋ v} σˣ_l for v ∈ vertices(Λ)
10define B_p ≔ ∏_{l ∈ ∂p} σᶻ_l for p ∈ plaquettes(Λ)
11define P_i ≔ σᶻ_{d_i} σᶻ_{h_i} σᶻ_{d_{i+1}} for i ∈ cells(∂Λ)
12
13define H₀ ≔ − J Σ_v A_v − J Σ_p B_p − Σ_i P_i
14define V ≔ − x Σ_i σˣ_{d_i} − κ₁ Σ_i σᶻ_{d_i} − κ₂ Σ_i σᶻ_{h_i}
15define H ≔ H₀ + V
16
17claim H : Hermitian, local
18claim ∂Λ condenses {1, e} at x = 0, κ₁ = 0, κ₂ = 0
19
20expand H_eff ≔ pCUT of H around H₀
21 to O(x¹⁵) at κ₁ = κ₂ = 0, to total order 10 in (x, κ₁, κ₂) otherwise
22estimate (x_c, zν) from Δ by dlog-Padé in x
weylc
$ weylc explain examples/toric_boundary.weyl
J : positive integer, 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, ...}, exact
H : Hermitian operator, support {h@(-1,0), d, h, u, ...}, exact
H_eff : Hermitian operator, support {h@(-1,0), d, h, u, ...}, + O(x^15)
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é)})

Types are representations

Declare how the symmetry group acts on modes: invariance is decided exactly, symmetry-breaking terms are reported by irrep, and H_eff is given as reduced coefficients on the invariant basis.

Error tags

Exact values, truncated series (+ O(I)), and extrapolations (± σ) stay distinct in the type system.

Deterministic algebra kernel

Coefficients and expansions come solely from the Rust kernel; LLMs only submit schedules and rewrites over MCP with offline replay.

Combinator equivalence

A one-line gauge ℤ₂ model and an explicit microscopic Hamiltonian are both valid and checked equal in normal form.

Weyl v0.1 · MIT License