SOPHIA XT
Research direction · qutrit diffusion

SophiaXTQ-T: ternary diffusion language models

A design study with one question: what does a diffusion language model look like when its native alphabet is {0, 1, 2} and its memory is written in the fusion space of non-Abelian anyons. The three-valued logic the study rests on already runs in the SOPHIA XT routing stack, with the measured results below. The qutrit algebra, the ternary arithmetic and the anyon braiding are computed on this page.

Author
Thomas Garren, SOPHIA XT Research
Measured today
Three-valued verifier lane and per-query specialist routing in the Constellation orchestrator
Computed on this page
Two-qutrit simulator, Kleene K₃ and balanced ternary, SU(2)₄ and Fibonacci F and R symbols with pentagon and hexagon checks
Measured · in the shipping stack

Where three-valued logic runs today

Ternary decision logic is load-bearing in how the SOPHIA XT stack routes work to specialists and verifies their output. These are the measured results from that work; the qutrit architecture further down is the research direction they point at.

Verifier lane

Three-valued judgement

In the Constellation orchestrator, a verifier lane scores another model's output on a three-valued scale, true · false · abstain, with a confidence attached, rather than a binary pass/fail. Abstain is a first-class outcome, and it is the practical face of three-valued logic in the system today.

Routing

Per-query specialist routing

Training-free cosine routing over sealed NCN capsule embeddings is clean at N=2: 18/20 combined (10/10 Mnema, 9/10 a published capsule build, 8/10 wrapping Llama-3.2-1B). On similar-domain capsules it collapses above N=2 (100% → 46.7% by N=6), and a learned N≥3 router collapsed to zero mutual information. That is the open frontier.

Separability

Offline ceiling

Offline, the same cosine signal separates ~82% of up to 48 labeled targets, validated across four frozen base models (Llama-3.2-1B / -3B, Qwen2.5-1.5B, SmolLM2-1.7B). The gap between this ceiling and deployment routing is the representation problem: the routing space is separable; the query-to-capsule projection is not solved yet.

Three-valued logic

Kleene's K₃ and balanced ternary

The verifier's three answers are the three values of Kleene's strong logic, where AND and OR are min and max and the middle value absorbs whatever it meets. Balanced ternary is the arithmetic side of the same alphabet: digits \{-1, 0, +1\}, negation by digit flip, and a carry chain that is a trit rather than a bit. Both are evaluated live below.

Three-valued logic · Kleene K₃ and balanced ternary
Truth tables and an adder, evaluated on the page
a ∧ b = min
a \ bFUT
FFFF
UFUU
TFUT
a ∨ b = max
a \ bFUT
FFUT
UUUT
TTTT
a → b
a \ bFUT
FTTT
UUTT
TFUT
consensus
a \ bFUT
FFUU
UUUU
TUUT
a ⊕₃ b
a \ bFUT
FTFU
UFUT
TUTF
¬a and the verifier map
F = −¬ = Tfalse
U = 0¬ = Uabstain
T = +¬ = Ftrue
Balanced-ternary adder, most significant trit first
carry0−000
x = 170+−0−= 17
y = -800−0+= -8
x + y = 900+00= 9
a b
a ∧ b (min)
U
a ∨ b (max)
T
¬a
F
a → b (Łukasiewicz)
U
consensus(a, b)
U
a ⊕₃ b
T
As verifier judgements: a = true, b = abstain; consensus(a, b) = abstain.
Kleene's strong three-valued logic keeps the classical AND and OR as min and max on {F, U, T} and adds a third value U that absorbs whatever it touches: T ∧ U = U, F ∨ U = U, ¬U = U. That is the algebra of a verifier which may return true, false or abstain, which is how the arbiter lane in the SOPHIA XT stack scores another model's output. Balanced ternary writes integers with digits {−, 0, +}; negation is a digit flip, rounding is truncation, and the adder below carries a trit exactly as a binary adder carries a bit. The modular sum ⊕₃ is the classical shadow of the qutrit X₃ gate.
Qutrits · SU(3)

Three-level quantum systems and their gates

A qutrit is a unit vector in \mathbb{C}^3; n of them span 3^n dimensions against 2^n for qubits. Its unitaries are SU(3), generated by the eight Gell-Mann matrices, and its Clifford group is generated by the Fourier gate H_3 and the phase gate S_3.

|\psi\rangle = \alpha|0\rangle + \beta|1\rangle + \gamma|2\rangle, \qquad |\alpha|^2 + |\beta|^2 + |\gamma|^2 = 1
H_3 = \frac{1}{\sqrt 3}\begin{pmatrix} 1 & 1 & 1 \\ 1 & \omega & \omega^2 \\ 1 & \omega^2 & \omega \end{pmatrix}, \quad \omega = e^{2\pi i/3}, \qquad X_3 = \begin{pmatrix} 0&0&1\\1&0&0\\0&1&0 \end{pmatrix}, \quad Z_3 = \mathrm{diag}(1, \omega, \omega^2)
S_3 = \mathrm{diag}(1, 1, \omega), \qquad T_3 = \mathrm{diag}(1, \zeta, \zeta^8), \quad \zeta = e^{2\pi i/9}

Two-qutrit entanglers: the controlled increment \mathrm{CX}_3|a,b\rangle = |a, b+a \bmod 3\rangle and the controlled phase \mathrm{CZ}_3|a,b\rangle = \omega^{ab}|a,b\rangle, related by H_3 on the target exactly as CNOT and CZ are for qubits.

The Gell-Mann matrices \lambda_1 \ldots \lambda_8 are traceless and Hermitian with \mathrm{Tr}(\lambda_a \lambda_b) = 2\delta_{ab}, so any density matrix expands as

\rho = \tfrac13 I + \tfrac12 \sum_{a=1}^{8} n_a \lambda_a, \qquad n_a = \mathrm{Tr}(\rho\lambda_a), \qquad \mathrm{Tr}\,\rho^2 = \tfrac13 + \tfrac12 |n|^2

The 8-vector n is the qutrit's Bloch vector. Pure states have |n|^2 = 4/3 but do not fill the sphere of that radius: the set of pure states is a four-dimensional surface inside an eight-dimensional ball, which is why the figure shows the eight components as bars and the diagonal pair (n_3, n_8) as a point in the triangle whose corners are the basis states.

Rotations \exp(-i\theta\lambda_a/2) are computed by scaling and squaring of the 3×3 series; the figure reports every gate's unitarity to rounding.

Qutrit simulator · two qutrits, SU(3)
Gates on a nine-dimensional state
Presets
H3 q0 · CX3 0→1
wire
gates
2
Σ|a|²
1.000000
Tr ρ₀²
0.3333
Tr ρ₁²
0.3333
X₃ is the cyclic shift |j⟩ → |j+1 mod 3⟩, Z₃ = diag(1, ω, ω²) with ω = e^{2πi/3}, H₃ is the Fourier transform on Z₃, S₃ = diag(1, 1, ω), and together H₃ and S₃ generate the single-qutrit Clifford group; T₃ = diag(1, ζ, ζ⁸) with ζ = e^{2πi/9} is the non-Clifford gate that completes a universal set (Howard and Vala 2012). Rotations are exp(−iθλ_a/2) for any of the eight Gell-Mann generators, computed by scaling and squaring. The bar rows are the 8-vector n_a = Tr(ρ λ_a) of each wire's reduced density matrix; a pure qutrit has |n|² = 4/3 and a maximally mixed one has n = 0, which is what the qutrit Bell preset produces on each wire. The triangles plot (n₃, n₈), the diagonal part of that vector, whose corners are the three basis states.
Topological memory · anyons

Fusion spaces and braiding

A non-Abelian anyon theory assigns each pair of particles a set of fusion outcomes; the space of ways several particles can fuse to a given total charge is the qudit, and moving particles around each other acts on it by unitaries that depend only on the topology of the paths. Two pieces of data fix the theory: the F-symbols, which change the order of fusion, and the R-symbols, the phases of exchanging two particles in a definite channel. They must satisfy the pentagon and hexagon equations, and the figure checks both.

Fibonacci

\tau \times \tau = 1 + \tau, \qquad d_\tau = \varphi = \tfrac{1+\sqrt5}{2}
F^{\tau\tau\tau}_\tau = \begin{pmatrix} \varphi^{-1} & \varphi^{-1/2} \\ \varphi^{-1/2} & -\varphi^{-1} \end{pmatrix}, \qquad R^{\tau\tau}_1 = e^{-4\pi i/5}, \quad R^{\tau\tau}_\tau = e^{3\pi i/5}

Three τ's with total charge τ span two states, a qubit; the braid group on three strands acts on it through \sigma_1 = R and \sigma_2 = F R F^{-1}, and the image is dense in SU(2) (Freedman, Larsen and Wang 2002), so braiding alone is universal.

Metaplectic, SU(2)₄ ≅ SO(3)₂

X \times X = 1 + Y, \quad Y \times Y = 1 + Y + Z, \quad Y \times Z = Y, \quad Z \times Z = 1
d_X = \sqrt 3, \quad d_Y = 2, \quad d_Z = 1, \qquad [n]_q = \frac{\sin(n\pi/6)}{\sin(\pi/6)}

Four Y's with trivial total charge span three states: a qutrit (Hastings, Nayak and Wang 2013). Braiding acts on it by a finite group, 54 elements up to phase in the figure's count, so the metaplectic scheme completes its gate set by measuring the total charge of pairs rather than by braiding alone. That measured step is where a three-valued readout enters the hardware story.

Anyons · F and R symbols, braid group representation
Braiding as a unitary on the fusion space
F^{YYY}_{Y}, rows/cols 1, Y, Z
0.5000-0.70710.5000
-0.70710.00000.7071
0.50000.70710.5000
R^{YY}_c and fusion rules
c = 1exp(i·-0.6667π)
c = Yexp(i·0.6667π)
c = Zexp(i·0.3333π)
X × X1 + Y
X × YX + X′
X × X′Y + Z
X × ZX′
Y × Y1 + Y + Z
Y × X′X + X′
Y × ZY
X′ × X′1 + Y
X′ × ZX
Z × Z1
σ1 on the 3-dim fusion space
-0.500−0.866i00
0-0.500+0.866i0
000.500+0.866i
σ2 on the 3-dim fusion space
-0.250+0.433i0.354+0.612i0.250−0.433i
0.354+0.612i00.354+0.612i
0.250−0.433i0.354+0.612i-0.250+0.433i
σ3 on the 3-dim fusion space
-0.500−0.866i00
0-0.500+0.866i0
000.500+0.866i
U(word) = σ1·σ2·σ1
-0.250−0.433i0.354+0.612i-0.250−0.433i
0.354+0.612i0-0.354−0.612i
-0.250−0.433i-0.354−0.612i-0.250−0.433i
U · |basis 0⟩
(1,Y,1)-0.250−0.433i0.2500
(Y,Y,1)0.354+0.612i0.5000
(Z,Y,1)-0.250−0.433i0.2500
Σ|amp|²1.000000
space
append
start basis
fusion space dim
3
quantum dim d_x
2.000000
pentagon residual
running 0%
hexagon residual
pending
unitarity ‖σ†σ − I‖
1.8e-15
braid relation
1.2e-15
‖σ₁σ₃ − σ₃σ₁‖
0.0e+0
projective image
finite, order 54
The F-symbols are the q-deformed 6j symbols of SU(2)_k with q = e^{iπ/(k+2)} (Kirillov and Reshetikhin 1989) and the R-symbols are R^{ab}_c = (−1)^{a+b−c} q^{c(c+1)−a(a+1)−b(b+1)}; the pentagon and hexagon residuals are the largest violation of the two consistency equations over every label, computed on this page. Fibonacci is the integer-spin part of SU(2)_3: one anyon τ with τ × τ = 1 + τ, quantum dimension φ, and F^{τττ}_τ the familiar 2×2 golden-ratio matrix. The metaplectic theory is SU(2)_4, equivalently SO(3)_2: the spin-1 anyon Y has Y × Y = 1 + Y + Z, so four Y's with trivial total charge span three states, the qutrit of Hastings, Nayak and Wang (2013). On a left-to-right fusion tree σ₁ is diagonal in R, and σ₂ is F R F⁻¹. Every σ is unitary and the σ's satisfy the braid relations to rounding; the braid word you build is applied to the chosen basis state and its product matrix is shown. Closing the generators under multiplication, modulo global phase, ends after 54 elements for the metaplectic qutrit, so braiding alone is not universal there (Jones 1986; Freedman, Larsen and Wang 2002: with four or more strands the image is finite only for k + 2 = 1, 2, 3, 4 or 6); for Fibonacci the closure does not terminate, consistent with the density theorem of Freedman, Larsen and Wang (2002).
Research direction · qutrit diffusion

The design question

A diffusion language model denoises a whole sequence at once rather than emitting one token after another. SophiaXTQ-T asks what changes when the sequence lives on a three-letter alphabet and the denoiser's state is a register of qutrits: the noise process becomes a random walk on \mathbb{Z}_3 per position, driven by X_3, and the denoising step is a unitary on the register followed by a three-outcome measurement, which is the verifier's true, false, abstain read directly off the hardware.

The pieces on this page are the scaffolding for that question: the qutrit gate set and its 8-vector, the three-valued logic the verifier already uses, and the anyon fusion space that would hold the register with topological protection.

Open problems

Routing above N=2 on similar-domain capsules collapses, and the learned router reached zero mutual information; the representation problem, projecting a query into the capsule space, is unsolved.

A first reproducible training run of the ternary denoiser has not been done; the benchmarks will come from that run.

Metaplectic braiding is not universal on its own, so the architecture depends on charge measurement of anyon pairs, an operation that no current device performs.

Reference implementation

The qutrit simulator, in Python

The same operations the figure above runs, written out for a notebook: the gate matrices, a two-qutrit register, the entanglers and the Gell-Mann 8-vector.

Qutrit register

1import numpy as np
2
3w = np.exp(2j* np.pi /3)
4zeta = np.exp(2j* np.pi /9)
5
6X3 = np.array([[0,0,1],[1,0,0],[0,1,0]], dtype=complex)# |j> -> |j+1 mod 3>
7Z3 = np.diag([1, w, w**2])
8H3 = np.array([[1,1,1],[1, w, w**2],[1, w**2, w]])/ np.sqrt(3)# Fourier on Z_3
9S3 = np.diag([1,1, w])# with H3 generates the Clifford group
10T3 = np.diag([1, zeta, zeta**8])# non-Clifford (Howard & Vala 2012)
11
12GELL_MANN =[
13 np.array([[0,1,0],[1,0,0],[0,0,0]]),
14 np.array([[0,-1j,0],[1j,0,0],[0,0,0]]),
15 np.array([[1,0,0],[0,-1,0],[0,0,0]]),
16 np.array([[0,0,1],[0,0,0],[1,0,0]]),
17 np.array([[0,0,-1j],[0,0,0],[1j,0,0]]),
18 np.array([[0,0,0],[0,0,1],[0,1,0]]),
19 np.array([[0,0,0],[0,0,-1j],[0,1j,0]]),
20 np.array([[1,0,0],[0,1,0],[0,0,-2]])/ np.sqrt(3),
21]
22
23defrotation(a:int, theta:float)-> np.ndarray:
24"""exp(-i theta lambda_a / 2) by eigendecomposition."""
25 vals, vecs = np.linalg.eigh(GELL_MANN[a -1])
26return vecs @ np.diag(np.exp(-0.5j* theta * vals)) @ vecs.conj().T
27
28classRegister:
29"""n qutrits; qutrit k owns base-3 digit n-1-k of the basis index."""
30
31def__init__(self, n:int):
32 self.n = n
33 self.psi = np.zeros(3**n, dtype=complex)
34 self.psi[0]=1.0
35
36defapply(self, U: np.ndarray, k:int):
37 psi = self.psi.reshape([3]* self.n)
38 psi = np.moveaxis(np.tensordot(U, psi, axes=([1],[k])),0, k)
39 self.psi = psi.reshape(-1)
40
41defcx3(self, c:int, t:int):
42 psi = self.psi.reshape([3]* self.n)
43 out = np.zeros_like(psi)
44for a inrange(3):
45 idx =[slice(None)]* self.n
46 idx[c]= a
47 out[tuple(idx)]= np.roll(psi[tuple(idx)], a, axis=t if t < c else t -1)
48 self.psi = out.reshape(-1)
49
50defcz3(self, c:int, t:int):
51 psi = self.psi.reshape([3]* self.n)
52 a = np.arange(3).reshape([3if i == c else1for i inrange(self.n)])
53 b = np.arange(3).reshape([3if i == t else1for i inrange(self.n)])
54 self.psi =(psi * w **((a * b)%3)).reshape(-1)
55
56defreduced(self, k:int)-> np.ndarray:
57 psi = np.moveaxis(self.psi.reshape([3]* self.n), k,0).reshape(3,-1)
58return psi @ psi.conj().T
59
60defbloch8(self, k:int)-> np.ndarray:
61 rho = self.reduced(k)
62return np.array([np.trace(rho @ L).real for L in GELL_MANN])
63
64defprobabilities(self)-> np.ndarray:
65return np.abs(self.psi)**2
66
67if __name__ =="__main__":
68 r = Register(2)
69 r.apply(H3,0)
70 r.cx3(0,1)# qutrit Bell state (|00> + |11> + |22>) / sqrt 3
71print(np.round(r.probabilities(),4))
72print("purity of q0:", np.trace(r.reduced(0) @ r.reduced(0)).real)# 1/3
73print("8-vector of q0:", np.round(r.bloch8(0),6))# all zero

The paper

The SophiaXTQ-T design study: the qutrit register, the ternary diffusion process and the anyon encoding, as a PDF.

Download PDF