Initial learned proposal
A learned integer potential is made dual-feasible by a backward pass. Equality of path cost and lower bound proves optimality. A gap can remain even when the proposed path happens to be optimal.
A trained model · A checkable answer
Run the quantum ToricGT research model. Follow a token through its circuit, graph attention and experts, then inspect the path it proposes.
Loading the checked model and four held-out examples…
01 · Weighted tokenization
Vertices mark positions in a string. Each edge is a permitted token with an integer cost. The model predicts remaining costs and proposes a path; an independent dynamic program checks the optimum.
For every edge, cost = base cost + u × slope. Changing u recomputes the circuit inputs, model output, and exact path certificate. The finite vocabulary is held fixed.
A learned integer potential is made dual-feasible by a backward pass. Equality of path cost and lower bound proves optimality. A gap can remain even when the proposed path happens to be optimal.
When needed, exact dynamic programming supplies a path and matching potential. Its correctness is reported separately from the model’s prediction accuracy.
| Vertex | Raw neural prediction | Exact dynamic program | Difference |
|---|
02 · The token feature map
Each graph token becomes six data angles. Two layers of RY and RZ rotations, followed by controlled-NOT gates, prepare a three-qubit state. The real and imaginary parts of ⟨U⟩, ⟨V⟩ and ⟨UV⟩ become model features.
| Basis | Real | Imaginary | Probability |
|---|
The derivative applies to each observable feature. The nonlinear model loss requires the chain rule; shifting the whole loss is generally incorrect.
| Feature | Value | Derivative |
|---|
U|j⟩ = exp(2πij/8)|j⟩ and V|j⟩ = |j−1 mod 8⟩. Their real and imaginary expectations are expectations of (W+W†)/2 and (W−W†)/(2i). Statevector expectations here are exact up to floating-point error; physical measurements would require shots.
03 · The rest of the trained model
Node and edge tokens share an encoder. Their endpoint incidences enter attention scores. A learned mixture combines softmax attention with a max-plus context; four experts each provide two routing slots.
Combination weights sum to one across slots for each output token. Dispatch weights instead normalize across tokens for each slot; they are different matrices. Attention weights describe an internal calculation and do not by themselves establish a causal explanation.
| Key token | Attention from selected query |
|---|
| Expert slot | Combine | Dispatch |
|---|
04 · Three seeds, three comparisons
The trainable quantum model is compared with a matched classical trigonometric feature map and a frozen quantum-feature ablation. All models use the same graph encoder and data splits. Checkpoints are selected using validation error.
| Feature model | Ordinary test split | Longer graphs, length 9–12 |
|---|
These small experiments establish that the circuit can be trained within the graph model. They do not establish a quantum advantage or a statistically reliable superiority over the classical control. Exact dynamic-programming repair is excluded from the learned-proposal scores above.
| Mode / seed | Selected epoch | Test optimal | Longer optimal | Offset change ‖Δθ‖ | Batch ms | Peak allocated MiB |
|---|
Weyl clock and shift operators represent a finite noncommutative torus. Toric and semigroup geometry describe separate algebraic constructions in the manuscript. Token-DAG optimization supplies an exact, small benchmark. The surface-code companion contains the actual toric and higher-genus quantum circuits.
The paper specifies how a typed graph model could propose tensor rewrites or cosmological detection statistics. Those applications need their own data, physical models and evaluations; this token benchmark does not establish them.
Explore the 18-qubit surface encoder and GPU experiments →The full browser forward pass is checked against the saved CUDA model on two test and two longer-graph examples. The source archive contains training code, all nine run records, the exact path oracle and independent circuit checks.