Skip to content

The quantum computer, and what it costs

Generated by npm run quantum:doc from the records that npm run impostors, npm run query:cost and npm run capacity write. 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.

modulefragmentamplitudesprobabilitiescost
simulator.tseverythingfloatsfloats2^n
exact.tsClifford(x + yi)/√2^krational, exact2^n
clifford-t.tsClifford + Tℤ[ζ₈]/√2^k(p + q√2)/2^scale, exact2^n
stabilizer.tsCliffordnonedetermined / undeterminedpolynomial

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:

states128 — 64 cells × 2 polarities
neighbours per state12, uniform
connectivityone component
symmetryvertex-transitive
edges among the twelve0 — 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

qubitsstate vectorstabilizeramplitudestableau bits
40 ms0 ms1680
82 ms0 ms256288
127 ms0 ms4,096624
16510 ms0 ms65,5361,088
183265 ms0 ms262,1441,368
2016494 ms0 ms1,048,5761,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

functionoracle callsclassical worst case
deutschJozsa (n=3)851.60× worse
deutschJozsa (n=4)1691.78× worse
deutschJozsa (n=5)32171.88× worse
deutschJozsa (n=6)64331.94× worse
groverSearch (n=3)2483.00× worse
groverSearch (n=4)64164.00× worse
groverSearch (n=5)160325.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:

representationcost of one unitwidth in 32 GiBcovers
src/quantum/simulator.ts47.68 B / amplitude29 qubitsany circuit, approximately — amplitudes are binary floating point
src/quantum/exact.ts50.84 B / amplitude29 qubitsClifford+T exactly, in Z[zeta8] — no rounding at any width
src/quantum/stabilizer.ts0.67 B / tableau bit113,060 qubitsthe 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.

instrumentserved claimsagreeunmeasured
src/quantum/exact.ts (Gaussian-integer amplitudes)13130
integer arithmetic on the served lattice330
the Lean kernel on the recording machine22220
src/quantum/algorithms.ts (Shor by phase estimation)12120

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 equation
  • interfere — cancelled and restored are counters whose definition is not served; only the support of H·H|0⟩ is pinned
  • prepareAmplitudes — 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 regardless
  • fold — the Worker's 16-character fold of index.lean is not this repository's hash; recorded under served.lean.fold, not compared
  • prose — 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 Workerpairswhat must hold here
factored by gcd (base shares a factor)158the same first step, an identical pair
factored by period38phase estimation here also factors; 38 of 38 pairs identical
refused inside its width42the refusal here is N prime or a^(r/2) ≡ −1
declared beyond its two-qubit counting width196the 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

bash
npm install zeropoint-node
javascript
import {
  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, exactly

Use it from an MCP client

bash
npx zeropoint-mcp
toolwhat it does
zeropoint.quantumRunRun 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.quantumExactRun 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.quantumCapacityWhat 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.quantumAgreesWhat 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.
json
{"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

bash
npm run capacity && npm run query:cost && npm run impostors && npm run refute