The quantum computer, and what it costs
Generated by
npm run quantum:docfrom the records thatnpm run impostors,npm run query:costandnpm run capacitywrite. Every number below is read from a measurement; none is typed here.
No quantum advantage is claimed anywhere in this package, and none is present. Of 7 oracle-call measurements, 0 show an advantage. A state-vector simulator applies a phase oracle by evaluating f on every basis state, so one quantum query costs 2^n classical evaluations by construction. What this package offers is exactness and honesty about cost, not speed.
Four representations, and why there is more than one
A quantum state can be carried in more than one way, and the choice decides what is exact and what is affordable. All four are exported from zeropoint-node/quantum.
| module | fragment | amplitudes | probabilities | cost |
|---|---|---|---|---|
simulator.ts | everything | floats | floats | 2^n |
exact.ts | Clifford | (x + yi)/√2^k | rational, exact | 2^n |
clifford-t.ts | Clifford + T | ℤ[ζ₈]/√2^k | (p + q√2)/2^scale, exact | 2^n |
stabilizer.ts | Clifford | none | determined / undetermined | polynomial |
Twelve neighbours, and what that is not
The hexbit lattice gives each cell six neighbours, one per bit. Carry a polarity alongside the cell and each bit offers two moves:
| states | 128 — 64 cells × 2 polarities |
| neighbours per state | 12, uniform |
| connectivity | one component |
| symmetry | vertex-transitive |
| edges among the twelve | 0 — a cuboctahedron has 24 |
Twelve is what a sphere touches in closest packing, which is why a vector equilibrium looked like the answer. It is not one: two states reached by flipping different bits differ in two bits, and two bits apart is not adjacent, so the neighbourhood is an independent set. This is the 6-cube with every vertex doubled into a non-adjacent twin — the vertex count of a cuboctahedron and none of its geometry.
The polarity did not buy the transitivity either: the undoubled 6-cube is already vertex-transitive at degree 6, so the doubling changed the degree and not the property. npm run test:polarity-lattice asserts both refusals. The rule that leaves: before crediting a mechanism with a property, compute the property without the mechanism.
eisenstein.ts sits beside them for the hexagonal case: ω = e^{iπ/3} satisfies ω² = ω − 1, so a 60° rotation is (a, b) → (−b, a+b) — integer arithmetic with no decimal at all.
Where the hardness actually is. Not the qubit count and not "quantum". It is the T gate: Clifford circuits are classically simulable in polynomial time (Gottesman–Knill), and classical cost grows with the number of T gates. That is why clifford-t.ts and stabilizer.ts are two files and not one.
The same circuits, both ways
| qubits | state vector | stabilizer | amplitudes | tableau bits |
|---|---|---|---|---|
| 4 | 0 ms | 0 ms | 16 | 80 |
| 8 | 2 ms | 0 ms | 256 | 288 |
| 12 | 7 ms | 0 ms | 4,096 | 624 |
| 16 | 510 ms | 0 ms | 65,536 | 1,088 |
| 18 | 3265 ms | 0 ms | 262,144 | 1,368 |
| 20 | 16494 ms | 0 ms | 1,048,576 | 1,680 |
- 100 qubits on the tableau in 1 ms (40,400 bits). A state vector would need 2^100 amplitudes.
- 400 qubits on the tableau in 27 ms (641,600 bits). A state vector would need 2^400 amplitudes.
- 1000 qubits on the tableau in 222 ms (4,004,000 bits). A state vector would need 2^1000 amplitudes.
The exponential cost is the representation, not the quantum content.
What the checks establish about METHOD
An algorithm that returns the right answer has not been shown to be that algorithm. Classical trial division once passed this package's exhaustive Shor check with no wrong answer and no unexplained refusal. npm run impostors replaces each algorithm with a classical stand-in returning identical answers and runs the check that should notice.
7 of 8 are identified by their method: bernsteinVazirani, simon, deutschJozsa, grover, phaseEstimation, shor, groverSearch.
1 verified by answer alone: deutsch. This is a floor, not a backlog item — one bit of output over a two-element domain leaves no residue to read and no query pattern to compare.
The two routes to identification:
- Residue — two Grover iterations over N=8 leave exactly 121/128 on the marked state and 1/128 on each of the other seven, which nothing else produces.
- Query pattern — a phase oracle reads every basis state exactly once. Shor’s refuses precisely where period-finding must: over 434 inputs to N=31, 204 factored and 230 refused, with 93 of them cases a classical stand-in wrongly answers.
What every oracle call costs
| function | oracle calls | classical worst case | |
|---|---|---|---|
deutschJozsa (n=3) | 8 | 5 | 1.60× worse |
deutschJozsa (n=4) | 16 | 9 | 1.78× worse |
deutschJozsa (n=5) | 32 | 17 | 1.88× worse |
deutschJozsa (n=6) | 64 | 33 | 1.94× worse |
groverSearch (n=3) | 24 | 8 | 3.00× worse |
groverSearch (n=4) | 64 | 16 | 4.00× worse |
groverSearch (n=5) | 160 | 32 | 5.00× worse |
What was NOT measured
A partial measurement read as a general one is the error this section exists to prevent. These are not measured anywhere in this package:
- the SPEEDUP a stabilizer-rank simulator would give — the 2^t scaling is measured here, but realising it needs tableau branches with amplitude extraction, and the better ~2^{0.23t} decompositions, neither of which is implemented
- noise, error correction and the physical qubit overhead a real device needs per logical qubit
- any hardware timing whatsoever — no quantum processor was involved in any number in this repository
- communication and readout cost, which dominate on real devices and are free in every simulator
- the asymptotic separations themselves (Simon, Shor), which are proven results about query and gate complexity and are not measurable at the sizes anything here can run
The QPU
There is no quantum processor here and no access to one. Six axes are measured by npm run qpu:pentagram — five machine resources and the representation the state is written in. RAM (total) is what binds: a state vector stops at 29 qubits, and neither CPU nor GPU adds a single qubit to that.
That ceiling belongs to the REPRESENTATION rather than to the machine, and the representation turns out to be the larger lever of the two:
| representation | cost of one unit | width in 32 GiB | covers |
|---|---|---|---|
src/quantum/simulator.ts | 47.68 B / amplitude | 29 qubits | any circuit, approximately — amplitudes are binary floating point |
src/quantum/exact.ts | 50.84 B / amplitude | 29 qubits | Clifford+T exactly, in Z[zeta8] — no rounding at any width |
src/quantum/stabilizer.ts | 0.67 B / tableau bit | 113,060 qubits | the CLIFFORD fragment only. T gates cost 2^t branches, not width |
The same memory holds 29 qubits or 113,060 — a factor of 3,899 in width, against the 18 qubits spanned by every machine resource put together. Measured rather than argued: the same Clifford circuits reach 1000 qubits on a tableau, on the same hardware, in 222 ms.
It is not a way around the exponential and is not offered as one. A tableau covers the Clifford fragment; a circuit with t T-gates is an exact sum of 2^t Clifford circuits (src/quantum/stabilizer-rank.ts), so the exponent moves from n to t. Where the exponent sits is a property of the representation and the fragment, never of the work being quantum.
One QPU on the network, recomputed here
npm run qpu:agrees — qpu.uuidna.com serves one quantum processing unit as JSON-LD: a 3-qubit exact simulator, a Shor run on 91, a 14-face lattice and a Lean file whose 10 listed theorems each carry a holds that Worker computed about itself. Every claim is recomputed here by instruments that never read its source, and the offline check reruns all of them on every gate run without the network.
| instrument | served claims | agree | unmeasured |
|---|---|---|---|
src/quantum/exact.ts (Gaussian-integer amplitudes) | 13 | 13 | 0 |
| integer arithmetic on the served lattice | 3 | 3 | 0 |
| the Lean kernel on the recording machine | 22 | 22 | 0 |
src/quantum/algorithms.ts (Shor by phase estimation) | 12 | 12 | 0 |
50 of 50 served claims agree, 0 disagree, 0 unmeasured; the record holds. The served proof was re-accepted by Lean (version 4.33.1, arm64-apple-darwin24.6.0, commit 819816b2e0a3bf405af45ae5c7af2491d8f5bee6, Release) against a served toolchain of leanprover/lean4:v4.33.0, and its constants as the kernel evaluates them match the numbers the JSON serves.
Not recomputed, by name:
measurement— served as {index, bits, support}; the meaning of index and bits is not stated as an equationinterfere— cancelled and restored are counters whose definition is not served; only the support of H·H|0⟩ is pinnedprepareAmplitudes— served as a count of 16 after preparation under a definition the Worker does not serve; the exact register here holds 4 nonzero amplitudes at that point, and the circuit is re-run gate for gate regardlessfold— the Worker's 16-character fold of index.lean is not this repository's hash; recorded under served.lean.fold, not comparedprose— speed, messaging, neuro, design, css, docs, glossary and ui are counters or prose
Found by recomputing, not served:
- The served two-qubit counting marginal cannot see the modular arithmetic: with four distinct work values it is uniform whatever the multipliers are, and replacing 64 by 63 in the served cmodexp left it at 1/4 four times. The multipliers and the work values the circuit reaches are therefore compared as their own claims; the marginal alone would pass a wrong circuit.
The same Shor sweep, sent to that QPU
npm run qpu:shor:agrees — every pair of the sweep, N = 4..31, 434 in all, sent to qpu.uuidna.com crypto_shor and compared on three arms: coprimality, period, factors.
| the Worker | pairs | what must hold here |
|---|---|---|
| factored by gcd (base shares a factor) | 158 | the same first step, an identical pair |
| factored by period | 38 | phase estimation here also factors; 38 of 38 pairs identical |
| refused inside its width | 42 | the refusal here is N prime or a^(r/2) ≡ −1 |
| declared beyond its two-qubit counting width | 196 | the order here does not divide 4 — counted, not scored |
434 of 434 pairs agree on every arm, 0 disagree; the record holds. The Worker recovers a period only when it divides 4 and says so in advance; this repository uses 2·bits(N) counting qubits and factors most of what the Worker declares beyond it. A declared limit is disclosure, not a defect, and is not scored.
Use it from npm
npm install zeropoint-nodeimport {
stabilizerZeroState, stabilizerH, stabilizerCnot, stabilizerMeasure,
ctZeroState, ctH, ctT, ctProbability,
} from 'zeropoint-node/quantum'
// A Bell pair on 200 qubits — polynomial, so the size is not a problem.
const s = stabilizerZeroState(200)
stabilizerH(s, 0)
stabilizerCnot(s, 0, 1)
const a = stabilizerMeasure(s, 0, 1) // undetermined: your coin decides
const b = stabilizerMeasure(s, 1) // determined, and equal to a
// H T H on |0>, with no floating point anywhere.
let r = ctZeroState(1)
r = ctH(r, 0); r = ctT(r, 0); r = ctH(r, 0)
ctProbability(r, 0) // { p: 2n, q: 1n, scale: 2 } -> (2 + sqrt2)/4, exactlyUse it from an MCP client
npx zeropoint-mcp| tool | what it does |
|---|---|
zeropoint.quantumRun | Run a Clifford circuit (h, s, x, z, cnot) on a stabilizer tableau and measure qubits. Polynomial in the qubit count rather than exponential, so hundreds of qubits are reachable — the same circuits a state vector cannot hold past about 30. Each measurement reports whether the outcome was DETERMINED by the state or genuinely undetermined; supply coins for the latter. No T gate: this is the Clifford fragment, which is exactly the fragment that is classically cheap. |
zeropoint.quantumExact | Run a Clifford+T circuit (h, s, t, tdg, x, z, cnot, cz) with NO FLOATING POINT and return exact probabilities. Amplitudes live in the ring generated by the eighth root of unity, so T is exact rather than absent or approximated. Each probability comes back as (p + q*sqrt2)/2^scale with integer p and q: Clifford-only circuits give q=0 and a rational, and any T makes it irrational — H T H on |0> is exactly (2 + sqrt2)/4. Arbitrary-angle rotations are absent, not approximated. |
zeropoint.quantumCapacity | What this quantum computer costs and where it stops, measured rather than claimed: the axes that were measured, the ones that were NOT, which algorithms are identified by their method rather than their answer, and the oracle-call counts. No quantum advantage is claimed anywhere — simulating one quantum query costs 2^n classical evaluations, and every measurement says so. |
zeropoint.quantumAgrees | What qpu.uuidna.com serves about its quantum processing unit, recomputed by instruments that never read its source: the exact simulator for the Bell, GHZ and product states, the Shor of this package for the factorisation of 91, and the Lean kernel on the recording machine for the served proof, plus the exhaustive Shor sweep of this package sent pair by pair to that QPU and compared arm by arm. Per-claim agreement as recorded in src/verification/qpu-agrees.json and qpu-shor-agrees.json; nothing is fetched at call time. |
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"zeropoint.quantumExact",
"arguments":{"qubits":1,"gates":[{"gate":"h","a":0},{"gate":"t","a":0},{"gate":"h","a":0}]}}}returns (2 + 1*sqrt2)/2^2 and (2 - 1*sqrt2)/2^2 — the exact probabilities, as integers.
Disagree with any of it
npm run capacity && npm run query:cost && npm run impostors && npm run refute