Skip to content
Condensed Matter Physics · Topological Order

Categorical Combinators & Condensation

Modular tensor categories, Drinfeld centers, Lagrangian algebras, and high-level categorical combinators (`gauge`, `condense`, `dual`, `stack`, `couple`) in Weyl.

In 2+1D topologically ordered phases, microscopic lattice Hamiltonians—whether Z2\mathbb{Z}_2 Toric Code stars and plaquettes or Kitaev quantum doubles D(G)D(G)—encode an emergent unitary modular tensor category (UMTC) C\mathcal{C}. Hand-writing microscopic local terms while manually tracking anyon fusion, braiding phases, and boundary condensation is error-prone and obscures duality structure.

Weyl bridges the macroscopic categorical layer and the microscopic lattice layer through categorical combinators (gauge, condense, dual, stack, couple) that operate directly on models and topological orders. Every combinator lowers deterministically to core lattice operators, and the type checker independently verifies consistency between the categorical type and the lowered microscopic normal form.

Modular Tensor Categories & Drinfeld Centers in weyl-topo ​

A 2+1D bosonic topological order is represented in weyl-topo by its modular data (I,Nabc,F,R,S,T)(\mathcal{I}, N_{ab}^c, F, R, S, T), where I\mathcal{I} is the finite set of simple anyon types, Nabc∈NN_{ab}^c \in \mathbb{N} are the fusion multiplicities in the fusion ring

a×b=⨁c∈INabc c,dadb=∑c∈INabcdc,D=∑a∈Ida2,a \times b = \bigoplus_{c \in \mathcal{I}} N_{ab}^c \, c, \qquad d_a d_b = \sum_{c \in \mathcal{I}} N_{ab}^c d_c, \qquad \mathcal{D} = \sqrt{\sum_{a \in \mathcal{I}} d_a^2},

and S,TS, T are the modular matrices satisfying unitarity, Tab=θaδabT_{ab} = \theta_a \delta_{ab}, and the Verlinde / modular relations (ST)3=ΘS2(ST)^3 = \Theta S^2 (with chiral central charge phase Θ=D−1∑ada2θa=1\Theta = \mathcal{D}^{-1}\sum_a d_a^2 \theta_a = 1 for non-chiral doubles).

Pre-Metric Groups vs. Non-Abelian Quantum Doubles ​

weyl-topo specializes the representation by algebraic structure to avoid unnecessary F/RF/R-symbol overhead when exact group-theoretic formulas exist:

RegimeWeyl RepresentationAnyon LabelsQuantum Dimension dad_aExact Arithmetic Field
Abelian D(G)D(G) (Phase 1)Pre-metric group (A,θ)(A, \theta), A=G×G^A = G \times \hat{G}(g,χ)∈G×G^(g, \chi) \in G \times \hat{G}11Q(ζexp⁡(G))\mathbb{Q}(\zeta_{\exp(G)})
Non-Abelian D(G)≃Z(VecG)D(G) \simeq \mathcal{Z}(\mathrm{Vec}_G)Conjugacy classes & centralizer irreps([C],π∈Irr(ZG(rC)))([C], \pi \in \mathrm{Irr}(Z_G(r_C)))∣C∣⋅dim⁡π|C| \cdot \dim \piQ(ζexp⁡(G))\mathbb{Q}(\zeta_{\exp(G)})
Twisted Dω(G)≃Z(VecGω)D^\omega(G) \simeq \mathcal{Z}(\mathrm{Vec}_G^\omega)3-cocycle ω∈H3(G,U(1))\omega \in H^3(G, U(1))Projective centralizer irreps∣C∣⋅dim⁡πω|C| \cdot \dim \pi_\omegaQ(ζn)\mathbb{Q}(\zeta_n)
General UMTCExplicit (Nabc,Fdabc,Rcab)(N_{ab}^c, F_{d}^{abc}, R_c^{ab})Finite index set I\mathcal{I}Perron–Frobenius eigenvalueNumber field / cyclotomic

For an Abelian quantum double D(G)D(G), the topological spin and mutual braiding phase are generated automatically from GG:

θ(g,χ)=χ(g),M((g1,χ1),(g2,χ2))=θ(g1g2,χ1χ2)θ(g1,χ1)θ(g2,χ2)=χ1(g2)χ2(g1).\theta(g, \chi) = \chi(g), \qquad M\big((g_1, \chi_1), (g_2, \chi_2)\big) = \frac{\theta(g_1 g_2, \chi_1 \chi_2)}{\theta(g_1, \chi_1)\theta(g_2, \chi_2)} = \chi_1(g_2)\chi_2(g_1).

For a non-Abelian finite group GG (such as S3S_3), the Drinfeld center Z(VecG)\mathcal{Z}(\mathrm{Vec}_G) has simple objects labeled by pairs (C,π)(C, \pi) where C⊂GC \subset G is a conjugacy class with representative rCr_C and π\pi is an irreducible representation of the centralizer ZG(rC)Z_G(r_C). The modular SS- and TT-matrices are computed over the cyclotomic field Q(ζexp⁡(G))\mathbb{Q}(\zeta_{\exp(G)}):

T(C,π),(C′,π′)=δC,C′δπ,π′χπ(rC)dim⁡π,S(C,π),(C′,π′)=1∣G∣∑g∈C,h∈C′gh=hgχπ(xg−1hxg)‾ χπ′(xh−1gxh)‾,T_{(C,\pi),(C',\pi')} = \delta_{C,C'}\delta_{\pi,\pi'} \frac{\chi_\pi(r_C)}{\dim \pi}, \qquad S_{(C,\pi),(C',\pi')} = \frac{1}{|G|} \sum_{\substack{g \in C,\, h \in C' \\ gh = hg}} \overline{\chi_\pi(x_g^{-1} h x_g)} \, \overline{\chi_{\pi'}(x_h^{-1} g x_h)},

where xgrCxg−1=gx_g r_C x_g^{-1} = g. For D(S3)D(S_3), ∣S3∣=6|S_3| = 6 yields 8 anyons (A,B,C,D,E,F,G,HA, B, C, D, E, F, G, H in Beigi–Shor–Whalen notation) with quantum dimensions {1,1,2,3,3,2,2,2}\{1, 1, 2, 3, 3, 2, 2, 2\} and total quantum dimension D=1+1+4+9+9+4+4+4=6=∣S3∣\mathcal{D} = \sqrt{1+1+4+9+9+4+4+4} = 6 = |S_3|.

Categorical Combinators in Weyl ​

Weyl provides five orthogonal combinators that compose both Hamiltonians and topological orders (weyl-types + weyl-topo):

CombinatorPhysical OperationLowering TargetStatic Preconditions
stack(M₁, M₂) / M₁ ⊠ M₂Uncoupled stacking (Deligne product)H1⊗H2\mathcal{H}_1 \otimes \mathcal{H}_2, H1+H2H_1 + H_2Shared lattice Λ\Lambda
couple M₁, M₂ by VInter-layer interactionH1+H2+VH_1 + H_2 + VVV Hermitian & local; symmetry reduced to Stab(V)\mathrm{Stab}(V)
gauge G in MMinimal coupling of 0-form symmetry GGEdge gauge DOFs + Gauss law + flux termGG on-site, exact, anomaly-free (ω=1\omega = 1)
condense 𝒜 in 𝒞Anyon condensation C→CAloc\mathcal{C} \to \mathcal{C}_{\mathcal{A}}^{\mathrm{loc}}Deconfined quotient categoryA\mathcal{A} is a condensable bosonic algebra
dual of M under DBond-algebra isomorphism (e.g. KW, e↔me \leftrightarrow m)Term-wise canonical imageEvery term of MM lies in dom(D)\mathrm{dom}(D)

Example: Z2\mathbb{Z}_2 Toric Code & Condensation Without Microscopic Boilerplate ​

In examples/toric_gauge_combinators.weyl, the entire Z2\mathbb{Z}_2 Toric Code cylinder with rough and smooth boundary terms is synthesized in six lines—and proved algebraically identical to the hand-written star/plaquette Hamiltonian:

weyl
model  ℤ₂ gauge theory with a boundary between its two condensates

given  Λ    : square lattice on a cylinder (circumference L, height W)
given  ∂Λ   : boundary of Λ at y = 0 with dangling edges d_i
given  ∂top : smooth termination of Λ at y = W
given  J    : positive integer
given  x, κ₁, κ₂ : small parameter

define bulk ≔ gauge ℤ₂ in (J · paramagnet on vertices(Λ)) with flux energy J
define R    ≔ boundary terms of bulk at ∂Λ condensing {1, e}
define S    ≔ boundary terms of bulk at ∂Λ condensing {1, m}

define H₀ ≔ bulk − R
define H  ≔ H₀ − x S − κ₁ Σ_i σᶻ_{d_i} − κ₂ Σ_i σᶻ_{h_i}

claim  H : Hermitian, local
claim  dual of (R + x S) under KW(∂Λ) = S + x R

define H_explicit ≔ − J Σ_v A_v − J Σ_p B_p − Σ_i P_i
                    − x Σ_i σˣ_{d_i} − κ₁ Σ_i σᶻ_{d_i} − κ₂ Σ_i σᶻ_{h_i}
claim  H = H_explicit

define 𝒟 ≔ condense {1, e₁e₂} in D(ℤ₂) ⊠ D(ℤ₂)
claim  𝒟 = D(ℤ₂)

Running weylc explain examples/toric_gauge_combinators.weyl prints the inferred physical types without expanding lattice sizes L,WL, W:

bash
$ weylc explain examples/toric_gauge_combinators.weyl
bulk : model on Λ, topological order D(ℤ₂), symmetry ℤ₂^(1), exact
R    : model on Λ, topological order D(ℤ₂), symmetry ℤ₂^(1), ∂Λ condenses {1, e}, exact
S    : model on Λ, topological order D(ℤ₂), symmetry ℤ₂^(1), ∂Λ condenses {1, m}, exact
𝒟    : topological order condense {1, e₁e₂} in D(ℤ₂) ⊠ D(ℤ₂) with anyons {1, e₂, m₁m₂, m₁f₂}
claim dual of (R + x S) under KW(∂Λ) = S + x R   [proved: exact bond-algebra identity]
claim H = H_explicit                             [proved: canonical normal form identical]
claim 𝒟 = D(ℤ₂)                                  [proved: modular (S, T) isomorphism]

Trusted Computing Base (TCB) Invariant

High-level combinators never enlarge the trusted base. Every combinator lowers to core lattice terms (weylc explain --expand), and the type checker re-verifies the lowered terms from scratch. If the combinator-level type disagrees with the lowered microscopic type (e.g., braiding phase from SS vs. Pauli symplectic inner product), the compiler aborts with an internal error.

Anyon Condensation & Lagrangian Algebras ​

Anyon condensation transitions a parent UMTC C\mathcal{C} to a child phase U=CAloc\mathcal{U} = \mathcal{C}_{\mathcal{A}}^{\mathrm{loc}} by proliferating a commutatively separable Frobenius algebra (condensable algebra) A=⨁a∈Ina a\mathcal{A} = \bigoplus_{a \in \mathcal{I}} n_a \, a with na∈Nn_a \in \mathbb{N} and n1=1n_1 = 1.

Static Checks for Condensable & Lagrangian Algebras ​

When a user writes condense 𝒜 in 𝒞 or declares a refinement type LagAlg<𝒞>, weyl-topo enforces four static conditions over Q(ζn)\mathbb{Q}(\zeta_n). First, the algebra must contain the vacuum with unit multiplicity (n1=1n_1 = 1), and every condensed simple anyon must have bosonic self-statistics:

na>0  ⟹  θa=1.n_a > 0 \implies \theta_a = 1.

Second, the quantum dimension dim⁡(A)=∑anada\dim(\mathcal{A}) = \sum_a n_a d_a must divide D\mathcal{D} for Abelian condensations, and equals D\mathcal{D} precisely when A\mathcal{A} is Lagrangian (yielding a trivial child phase CAloc≃Vec\mathcal{C}_{\mathcal{A}}^{\mathrm{loc}} \simeq \mathrm{Vec}, i.e., a gapped boundary to vacuum):

dim⁡(A)=∑a∈Inada=D  ⟺  A is Lagrangian.\dim(\mathcal{A}) = \sum_{a \in \mathcal{I}} n_a d_a = \mathcal{D} \iff \mathcal{A} \text{ is Lagrangian}.

Finally, as a necessary condition for Lagrangian algebras, the multiplicity vector n=(na)n = (n_a) must be modular invariant:

S n=n,T n=n.S \, n = n, \qquad T \, n = n.

Because modular invariance alone is not sufficient for general non-Abelian MTCs, weyl-topo constructively enumerates valid Lagrangian algebras of D(G)D(G) from subgroup-cocycle pairs (K,ω)(K, \omega) with K≤GK \le G up to conjugacy and [ω]∈H2(K,U(1))[\omega] \in H^2(K, U(1)), rejecting any user-claimed vector nn outside the constructive enumeration with diagnostic E0372.

Confinement, Identification, and Splitting ​

Under condensation of A\mathcal{A}, anyons in C\mathcal{C} undergo confinement, identification, and splitting. Any anyon b∈Cb \in \mathcal{C} with non-trivial mutual braiding against a constituent a∈Aa \in \mathcal{A} (Mab≠1M_{ab} \neq 1, or more generally a non-local module structure) acquires a linear string tension and is confined in CAloc\mathcal{C}_{\mathcal{A}}^{\mathrm{loc}}. Among the remaining deconfined anyons, two charges bb and b′b' related by fusion with A\mathcal{A} become identical in the quotient phase (b∼b′  ⟺  ∃a∈A,  Nabb′>0b \sim b' \iff \exists a \in \mathcal{A},\; N_{ab}^{b'} > 0). In non-Abelian theories, a deconfined anyon bb that can absorb A\mathcal{A} in multiple channels (Nabb>0N_{ab}^b > 0 for a≠1a \neq 1) additionally splits into distinct simple anyons in CAloc\mathcal{C}_{\mathcal{A}}^{\mathrm{loc}}, conserving total quantum dimension dim⁡(CAloc)=D/dim⁡(A)\dim(\mathcal{C}_{\mathcal{A}}^{\mathrm{loc}}) = \mathcal{D} / \dim(\mathcal{A}).

In the double-layer example condense {1, e₁e₂} in D(ℤ₂) ⊠ D(ℤ₂), the composite charge e1e2e_1 e_2 has spin θ(e1e2)=θ(e1)θ(e2)=1⋅1=1\theta(e_1 e_2) = \theta(e_1)\theta(e_2) = 1 \cdot 1 = 1, so A=1⊕e1e2\mathcal{A} = 1 \oplus e_1 e_2 is bosonic with dim⁡(A)=2\dim(\mathcal{A}) = 2 inside a parent phase of total quantum dimension Dparent=4\mathcal{D}_{\mathrm{parent}} = 4. Exactly eight anyons—{1,e1,e2,e1e2,m1m2,m1f2,f1m2,f1f2}\{1, e_1, e_2, e_1 e_2, m_1 m_2, m_1 f_2, f_1 m_2, f_1 f_2\}—braid trivially with e1e2e_1 e_2, whereas m1,m2,f1,f2m_1, m_2, f_1, f_2 and their ee-shifts are confined. Identifying b∼b×e1e2b \sim b \times e_1 e_2 collapses the deconfined sector into four equivalence classes {[1],[e2],[m1m2],[m1f2]}\{[1], [e_2], [m_1 m_2], [m_1 f_2]\} with Dchild=4/2=2\mathcal{D}_{\mathrm{child}} = 4 / 2 = 2, recovering a child phase isomorphic to D(Z2)D(\mathbb{Z}_2).

Non-Abelian Example: D(S3)D(S_3) Condensation & Lagrangian Algebras ​

For D(S3)D(S_3) (D=6\mathcal{D} = 6), weyl-topo enumerates the 4 subgroup conjugacy classes of S3S_3 (all with trivial H2(K,U(1))H^2(K, U(1))), yielding 4 Lagrangian algebras and 2 non-Lagrangian condensable algebras:

weyl
given  G : symmetric group S₃
given  𝒞 : topological order D(G)

-- Non-Lagrangian condensation: condense the 1D bosonic sign charge B (d_B = 1)
define 𝒰_B ≔ condense {1 ⊕ B} in 𝒞
claim  𝒰_B = D(ℤ₃)                     -- D(S₃) / {1, B} ≅ D(ℤ₃), 𝒟 = 6 / 2 = 3

-- All four Lagrangian algebras of D(S₃), each with dim(𝒜) = 6 = 𝒟
claim  1 ⊕ B ⊕ 2 C : Lagrangian algebra of 𝒞   -- K = {1}   (smooth / magnetic-like)
claim  1 ⊕ C ⊕ D   : Lagrangian algebra of 𝒞   -- K = ℤ₂    (partial SSB)
claim  1 ⊕ B ⊕ 2 F : Lagrangian algebra of 𝒞   -- K = ℤ₃    (electric-magnetic mixed)
claim  1 ⊕ D ⊕ F   : Lagrangian algebra of 𝒞   -- K = S₃    (rough / electric-like)

Notice the non-trivial multiplicity nC=2n_C = 2 in A{1}=1⊕B⊕2C\mathcal{A}_{\{1\}} = 1 \oplus B \oplus 2 C: because dC=2d_C = 2, dim⁡(A{1})=1+1+2×2=6=D\dim(\mathcal{A}_{\{1\}}) = 1 + 1 + 2 \times 2 = 6 = \mathcal{D}. Under A=1⊕B\mathcal{A} = 1 \oplus B, the 2-dimensional anyon CC (B×C=CB \times C = C) splits into two Abelian anyons of D(Z3)D(\mathbb{Z}_3), while the 3-dimensional flux anyons D,ED, E are confined.

Fixed-Point Condensation & Braiding Cross-Checks ​

Weyl draws a strict semantic boundary between geometric termination and dynamical condensation phase. A declaration such as given ∂Λ : boundary of Λ at y = 0 with dangling edges d_i specifies only lattice geometry and truncated operators, whereas claim ∂Λ condenses {1, e} at x = 0, κ₁ = 0, κ₂ = 0 is decided strictly at that solvable stabilizer fixed point via the quotient of the boundary stabilizer centralizer by endpoint string operators (T-Bdy). Away from the fixed point (H = H₀ + V), Weyl preserves the tag at x = 0, κ₁ = 0, κ₂ = 0 rather than extrapolating fixed-point condensation to finite couplings (x,κ1,κ2)(x, \kappa_1, \kappa_2).

Static Diagnostics on Invalid Condensation & Braiding

Attempting to claim a wrong condensate or inconsistent anyon string braiding fails at compile time before any series expansion runs:

bash
error[E0311]: the fixed-point condensation claim disagrees with the stabilizer quotient
  --> toric_boundary.weyl:23:8
   |  claim ∂top condenses {1, e} at x = 0, κ₁ = 0, κ₂ = 0
   |  the smooth termination has truncated stars and absorbs m
   = help: state the proven fixed-point subgroup {1, m}

error[E0360]: claimed algebra {1, f} is not a valid condensable algebra of D(ℤ₂)
  --> bad_condense.weyl:9:12
   |  anyons with n_a > 0 must be bosons (θ_a = 1), but θ(f) = −1

For every pair of string operators annotated with anyon types (e ↔ A_v = −1, m ↔ B_p = −1) and intersection number kk, rule T-Braid checks that the categorical prediction ϵcat=M(α,β)k\epsilon_{\mathrm{cat}} = M(\alpha, \beta)^k matches the microscopic Pauli symplectic inner product ϵsymp=(−1)ω(ga,gb)\epsilon_{\mathrm{symp}} = (-1)^{\omega(g_a, g_b)}. Any discrepancy triggers E0340, providing a zero-cost cross-check between the categorical type layer and the microscopic operator kernel.

Internal Representation & Static Check Complexity ​

Inside weyl-topo and weyl-types, topological orders and refinement predicates are stored as immutable interned structures whose verification cost is independent of the symbolic lattice dimensions (L,W)(L, W):

rust
pub struct PreMetricGroup {
    pub order: usize,                 // |A| = |G|^2 for Abelian D(G)
    pub spins: Vec<Cyclotomic>,       // theta(a) in Q(zeta_n)
    pub braiding: Vec<Cyclotomic>,    // M(a, b) = theta(a + b) / (theta(a) * theta(b))
}

pub struct LagAlg {
    pub parent: TopoId,
    pub multiplicities: Vec<u32>,     // n_a in N with n_1 = 1, sum n_a d_a = D
    pub witness: Option<(SubgroupId, Cocycle2Id)>, // constructive (K, omega) witness
}
Static CheckAlgorithm in weyl-topoComplexityLattice-Size Dependent?
Abelian Lagrangian check (Lagrangian<T>)Verify $L^2 =
Non-Abelian LagAlg<T> enumerationEnumerate (K,ω)(K, \omega) up to conjugacy + H2(K,U(1))H^2(K, U(1))O(∣Sub(G)∣⋅∣H2∣)O(|\mathrm{Sub}(G)| \cdot |H^2|)No
3-cocycle verification (δω=1\delta \omega = 1)Bounded exhaustive table check over G4G^4O(∣G∣4)O(|G|^4)No
Fixed-point condensation (T-Bdy)Boundary stabilizer centralizer quotient on representative cellsO(C⋅K⋅Rd)O(C \cdot K \cdot R^d)No
Braiding cross-check (T-Braid)Compare M(α,β)kM(\alpha, \beta)^k against (−1)ω(ga,gb)(-1)^{\omega(g_a, g_b)}O(Rd)O(R^d)No

Weyl v0.1 · MIT License