zeropoint-node 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,271 @@
1
+ /**
2
+ * Quantum advantage, counted rather than claimed.
3
+ *
4
+ * "Quantum advantage" is one of the most overstated phrases in computing, and
5
+ * this module exists to say exactly how much of it this repository can
6
+ * demonstrate. It does not argue. It wraps the oracle in a counter, runs the
7
+ * simulator's own algorithms, and reports how many times each one asked.
8
+ *
9
+ * THE ONE THING THAT IS PROVEN. In the QUERY MODEL — where cost is the number
10
+ * of oracle calls and nothing else — there are separations that are theorems,
11
+ * not conjectures:
12
+ *
13
+ * Grover Θ(√N) quantum against Θ(N) classical. The lower bound is
14
+ * Bennett–Bernstein–Brassard–Vazirani: no quantum algorithm
15
+ * beats √N for unstructured search, so the gap is exactly
16
+ * quadratic and cannot be improved.
17
+ * Deutsch–Jozsa 1 quantum query against 2^(n-1)+1 classical WORST CASE —
18
+ * but only against DETERMINISTIC EXACT classical algorithms.
19
+ * A randomised classical algorithm decides it in a constant
20
+ * number of queries with bounded error, so this famous
21
+ * "exponential separation" collapses the moment the classical
22
+ * side is allowed to be wrong occasionally. That caveat is
23
+ * usually dropped, and dropping it is the overstatement.
24
+ *
25
+ * WHAT IS NOT PROVEN. Shor's algorithm factors in polynomial time, and the
26
+ * repository implements it. That is NOT a proven advantage: no one has shown
27
+ * factoring is hard classically. The separation is conditional on an unproven
28
+ * assumption, and calling it proven — or calling factoring NP-complete, which
29
+ * it is not known to be — is the error this module is written against.
30
+ *
31
+ * AND THE MEASUREMENT REFUTED MY OWN PREMISE. This module was written to count
32
+ * the simulator's oracle calls and show the advantage. It shows the opposite,
33
+ * and that is the finding:
34
+ *
35
+ * Grover n=10 25 600 simulated oracle calls vs 1 024 classical
36
+ * Deutsch-Jozsa n=10 1 024 simulated oracle calls vs 513 classical
37
+ *
38
+ * A simulator applies the oracle to EVERY basis state of the amplitude vector,
39
+ * so one "quantum query" costs 2^n classical evaluations. Simulated query
40
+ * counts are therefore strictly WORSE than classical, always, by construction.
41
+ * Quantum advantage is a property of hardware that holds the superposition; it
42
+ * is not something a classical simulation can exhibit, and any repository
43
+ * claiming to demonstrate it by simulation is measuring the wrong thing.
44
+ *
45
+ * So this module reports two different quantities and never conflates them:
46
+ * the ALGORITHM's query count, which is where the theorem lives, and the
47
+ * SIMULATION's oracle calls, which is what running it here actually costs.
48
+ */
49
+
50
+ import { groverSearch, deutschJozsa, groverIterations } from './algorithms.ts'
51
+
52
+ // ============================================================================
53
+ // COUNTING
54
+ // ============================================================================
55
+
56
+ /** An oracle wrapped so every call is counted. */
57
+ function counted<T extends (x: number) => unknown>(f: T): { fn: T; calls: () => number } {
58
+ let n = 0
59
+ const fn = ((x: number) => {
60
+ n += 1
61
+ return f(x)
62
+ }) as T
63
+ return { fn, calls: () => n }
64
+ }
65
+
66
+ export interface QueryComparison {
67
+ /** Number of qubits, so the search space is 2^n. */
68
+ readonly qubits: number
69
+ /** Size of the space searched. */
70
+ readonly space: number
71
+ /**
72
+ * Queries the ALGORITHM makes — what the theorem counts. On hardware this is
73
+ * the cost; here it is derived from the algorithm, not observed.
74
+ */
75
+ readonly algorithmQueries: number
76
+ /**
77
+ * Oracle calls the SIMULATION actually made. Larger than the algorithm's
78
+ * count by a factor of the state-vector size, because simulating one query
79
+ * means evaluating the oracle on every basis state.
80
+ */
81
+ readonly simulatedOracleCalls: number
82
+ /** Oracle calls a classical algorithm needs in the worst case. */
83
+ readonly classicalWorstCase: number
84
+ /** Whether the algorithm returned the right answer. */
85
+ readonly correct: boolean
86
+ }
87
+
88
+ // ============================================================================
89
+ // GROVER — a proven quadratic separation
90
+ // ============================================================================
91
+
92
+ /**
93
+ * Run Grover for one marked item and count the oracle calls.
94
+ *
95
+ * Classical worst case for unstructured search over N items is N: an adversary
96
+ * puts the marked item last. Grover's is the iteration count, which the
97
+ * simulator derives from N rather than taking on faith.
98
+ */
99
+ export function groverQueries(qubits: number, target: number): QueryComparison {
100
+ const space = 1 << qubits
101
+ const oracle = counted((x: number) => x === target)
102
+ const result = groverSearch(qubits, oracle.fn as (x: number) => boolean, 1)
103
+
104
+ // The most likely basis state after the run.
105
+ let best = 0
106
+ let bestWeight = -1
107
+ if (result !== null) {
108
+ for (let i = 0; i < result.amps.length; i++) {
109
+ const a = result.amps[i]!
110
+ const weight = a.re * a.re + a.im * a.im
111
+ if (weight > bestWeight) { bestWeight = weight; best = i }
112
+ }
113
+ }
114
+
115
+ return {
116
+ qubits,
117
+ space,
118
+ algorithmQueries: groverIterations(space),
119
+ simulatedOracleCalls: oracle.calls(),
120
+ classicalWorstCase: space,
121
+ correct: result !== null && best === target,
122
+ }
123
+ }
124
+
125
+ // ============================================================================
126
+ // DEUTSCH–JOZSA — exponential, but only against exact classical algorithms
127
+ // ============================================================================
128
+
129
+ /**
130
+ * Run Deutsch–Jozsa and count the oracle calls.
131
+ *
132
+ * Classical worst case for a DETERMINISTIC EXACT answer is 2^(n-1)+1: having
133
+ * seen half the inputs agree, one more disagreement still decides it. A
134
+ * randomised classical algorithm needs only a constant number, so the
135
+ * separation reported here is against exact classical algorithms alone.
136
+ */
137
+ export function deutschJozsaQueries(qubits: number, balanced: boolean): QueryComparison {
138
+ const space = 1 << qubits
139
+ // Constant: always 0. Balanced: the parity of the input, which is 0 on
140
+ // exactly half the domain.
141
+ const f = balanced
142
+ ? (x: number): 0 | 1 => {
143
+ let bits = 0
144
+ for (let b = 0; b < qubits; b++) bits ^= (x >> b) & 1
145
+ return (bits & 1) as 0 | 1
146
+ }
147
+ : (): 0 | 1 => 0
148
+
149
+ const oracle = counted(f as (x: number) => unknown)
150
+ const verdict = deutschJozsa(qubits, oracle.fn as (x: number) => 0 | 1)
151
+
152
+ return {
153
+ qubits,
154
+ space,
155
+ algorithmQueries: 1,
156
+ simulatedOracleCalls: oracle.calls(),
157
+ classicalWorstCase: space / 2 + 1,
158
+ correct: verdict === (balanced ? 'balanced' : 'constant'),
159
+ }
160
+ }
161
+
162
+ // ============================================================================
163
+ // WHAT EACH SEPARATION RESTS ON
164
+ // ============================================================================
165
+
166
+ export type Standing =
167
+ /** A theorem in the query model. Both bounds are proved. */
168
+ | 'proven'
169
+ /** Proved only against a restricted classical adversary. */
170
+ | 'proven-against-exact-classical'
171
+ /** Fast quantumly; no classical lower bound is known. */
172
+ | 'conditional'
173
+
174
+ export interface Separation {
175
+ readonly algorithm: string
176
+ readonly standing: Standing
177
+ readonly note: string
178
+ }
179
+
180
+ /** The honest status of each separation this repository implements. */
181
+ export const SEPARATIONS: readonly Separation[] = [
182
+ {
183
+ algorithm: 'Grover',
184
+ standing: 'proven',
185
+ note:
186
+ 'Θ(√N) against Θ(N). The BBBV lower bound shows no quantum algorithm does better than √N, ' +
187
+ 'so the quadratic gap is exact and final rather than a current best effort.',
188
+ },
189
+ {
190
+ algorithm: 'Deutsch-Jozsa',
191
+ standing: 'proven-against-exact-classical',
192
+ note:
193
+ '1 query against 2^(n-1)+1, but only if the classical algorithm must be exact and ' +
194
+ 'deterministic. Allowed bounded error, a classical algorithm needs O(1). Quoting the ' +
195
+ 'exponential without that condition is the usual overstatement.',
196
+ },
197
+ {
198
+ algorithm: 'Shor',
199
+ standing: 'conditional',
200
+ note:
201
+ 'Polynomial-time factoring quantumly, with NO proof that factoring is classically hard. ' +
202
+ 'Factoring is not known to be NP-complete, so Shor does not place NP in P and does not ' +
203
+ 'imply a general speedup for NP problems.',
204
+ },
205
+ ]
206
+
207
+ // ============================================================================
208
+ // SELF-CHECK
209
+ // ============================================================================
210
+
211
+ /** Facts this module must satisfy. Returns failures. */
212
+ export function selfTest(): string[] {
213
+ const fail: string[] = []
214
+
215
+ for (const qubits of [3, 4, 5, 6]) {
216
+ const target = (1 << qubits) - 1 // adversarial: the last item
217
+ const r = groverQueries(qubits, target)
218
+ if (!r.correct) fail.push(`grover n=${qubits} did not find the target`)
219
+
220
+ // The ALGORITHM beats classical. This is where the theorem lives.
221
+ if (!(r.algorithmQueries < r.classicalWorstCase)) {
222
+ fail.push(`grover n=${qubits}: ${r.algorithmQueries} algorithm queries, not below ${r.classicalWorstCase}`)
223
+ }
224
+
225
+ // The SIMULATION does not, and must be recorded as not doing so. If this
226
+ // ever flips, the simulator has stopped evaluating the oracle over the
227
+ // whole state vector and something is wrong with it, not right.
228
+ if (!(r.simulatedOracleCalls > r.classicalWorstCase)) {
229
+ fail.push(
230
+ `grover n=${qubits}: simulation made ${r.simulatedOracleCalls} calls, which is not above ` +
231
+ `${r.classicalWorstCase} — a simulator cannot beat classical query cost`,
232
+ )
233
+ }
234
+
235
+ // One simulated query costs the state-vector size.
236
+ if (r.simulatedOracleCalls !== r.algorithmQueries * r.space) {
237
+ fail.push(
238
+ `grover n=${qubits}: ${r.simulatedOracleCalls} calls is not ${r.algorithmQueries} x ${r.space}`,
239
+ )
240
+ }
241
+ }
242
+
243
+ // The ALGORITHM's advantage must widen with n — a constant factor is not a
244
+ // speedup. Measured on the algorithm count, not the simulation count.
245
+ const small = groverQueries(3, 7)
246
+ const large = groverQueries(6, 63)
247
+ if (!(large.classicalWorstCase - large.algorithmQueries > small.classicalWorstCase - small.algorithmQueries)) {
248
+ fail.push('grover algorithmic advantage does not widen with n')
249
+ }
250
+
251
+ for (const balanced of [true, false]) {
252
+ const r = deutschJozsaQueries(4, balanced)
253
+ if (!r.correct) fail.push(`deutsch-jozsa balanced=${balanced} gave the wrong verdict`)
254
+ if (r.algorithmQueries !== 1) fail.push('deutsch-jozsa algorithm query count is not 1')
255
+ // Again: the simulation pays the full space, so it cannot be the cheaper side.
256
+ if (!(r.simulatedOracleCalls >= r.space)) {
257
+ fail.push(`deutsch-jozsa: simulation made ${r.simulatedOracleCalls} calls, expected at least ${r.space}`)
258
+ }
259
+ }
260
+
261
+ const shor = SEPARATIONS.find((s) => s.algorithm === 'Shor')
262
+ if (!shor || shor.standing !== 'conditional') fail.push('Shor is not recorded as conditional')
263
+ const dj = SEPARATIONS.find((s) => s.algorithm === 'Deutsch-Jozsa')
264
+ if (!dj || dj.standing !== 'proven-against-exact-classical') {
265
+ fail.push('Deutsch-Jozsa is not recorded with its classical-exactness condition')
266
+ }
267
+ const grover = SEPARATIONS.find((s) => s.algorithm === 'Grover')
268
+ if (!grover || grover.standing !== 'proven') fail.push('Grover is not recorded as proven')
269
+
270
+ return fail
271
+ }
@@ -57,3 +57,13 @@ export {
57
57
  executeInSuperposition,
58
58
  describeQuantumExecution,
59
59
  } from './superposition-execution.ts'
60
+
61
+ // Named rather than star-exported: `selfTest` exists in several modules here,
62
+ // and an ambiguous star export silently drops every one of them.
63
+ export type { QueryComparison, Separation, Standing } from './advantage.ts'
64
+ export {
65
+ groverQueries,
66
+ deutschJozsaQueries,
67
+ SEPARATIONS,
68
+ selfTest as advantageSelfTest,
69
+ } from './advantage.ts'
@@ -46,14 +46,29 @@ export function layer1_riemannSimulator(): RiemannLayer {
46
46
  /**
47
47
  * P vs NP: Can every problem verifiable in polynomial time be solved in polynomial time?
48
48
  *
49
- * Maps to: Quantum Algorithms
50
- * Why: Shor (NP P for factoring), Grover (speedup for search)
51
- * Gap: Algorithm definitions exist but not end-to-end tested
52
- * Solution: P vs NP gap IS the algorithm completeness gap
49
+ * Maps to: Quantum Algorithms — as a NAMING, not a result. Three corrections,
50
+ * because the previous version of this comment stated two things that are false
51
+ * and one that is misleading:
53
52
  *
54
- * Shor proves factoring is in BQP (Quantum Polynomial)
55
- * If NP BQP, then Shor solves the NP-completeness problem
56
- * Grover gives quadratic speedup for any search (generic NP solver)
53
+ * "Shor (NP → P for factoring)" is wrong twice over. Factoring is not known
54
+ * to be NP-complete it sits in NP co-NP, which is strong evidence it is
55
+ * NOT NP-complete so solving it settles nothing about NP. And Shor puts
56
+ * factoring in BQP, not in P; those are different classes.
57
+ *
58
+ * "Grover ... (generic NP solver)" is wrong. Grover is a QUADRATIC speedup on
59
+ * brute force: 2^n becomes 2^(n/2), which is still exponential. That is not
60
+ * polynomial time and does not solve NP-complete problems efficiently. The
61
+ * BBBV lower bound proves no quantum algorithm does better on unstructured
62
+ * search, so this is a ceiling rather than a starting point.
63
+ *
64
+ * "If NP ⊆ BQP, then Shor solves the NP-completeness problem" is a
65
+ * conditional whose antecedent is an open question widely believed false.
66
+ * Stating it beside two claimed results reads as though it followed from
67
+ * them. It does not.
68
+ *
69
+ * What IS true: Shor places factoring in BQP, and no classical lower bound for
70
+ * factoring is known, so the speedup is conditional. See src/quantum/advantage.ts,
71
+ * which counts the queries and records which separations are theorems.
57
72
  */
58
73
 
59
74
  export interface PvsNPLayer {
@@ -251,11 +251,22 @@ export function feedbackAndImprove(
251
251
  const boost = 0.05 // 5% improvement per iteration
252
252
  const decay = 0.98 // Strong layers maintain, don't overfit
253
253
 
254
- let updated = { ...state }
254
+ // `{ ...state }` copies the TOP LEVEL only, so the copy's `layer_states` was
255
+ // the same object as the caller's. Both loops then assigned into it, and this
256
+ // function — which takes a state and returns a new one — mutated the state it
257
+ // was given. Measured: after one call, the input's layer_states had changed.
258
+ // The readonly types were reporting exactly that, and the fix is a second
259
+ // copy rather than a cast.
260
+ //
261
+ // Note on the names: `suppress` is the WEAK set (quality < 0.7) and gets the
262
+ // boost, `amplify` is the STRONG set (> 0.8) and gets the decay. That reads
263
+ // backwards but is correct — the fields classify the interference, they do
264
+ // not name the action taken here, which is what the comments above describe.
265
+ const layer_states = { ...state.layer_states }
255
266
 
256
267
  for (const layer_name of interference.suppress) {
257
268
  const key = layer_name as keyof typeof state.layer_states
258
- updated.layer_states[key] = {
269
+ layer_states[key] = {
259
270
  working: true,
260
271
  quality: min(1, state.layer_states[key].quality + boost),
261
272
  }
@@ -263,14 +274,13 @@ export function feedbackAndImprove(
263
274
 
264
275
  for (const layer_name of interference.amplify) {
265
276
  const key = layer_name as keyof typeof state.layer_states
266
- updated.layer_states[key] = {
277
+ layer_states[key] = {
267
278
  working: true,
268
279
  quality: state.layer_states[key].quality * decay,
269
280
  }
270
281
  }
271
282
 
272
- // Iterate
273
- updated = { ...updated, iteration: state.iteration + 1 }
283
+ const updated = { ...state, layer_states, iteration: state.iteration + 1 }
274
284
 
275
285
  // Re-entangle with new state
276
286
  return entangleLayerOutputs(updated)
package/src/vbm-math.ts CHANGED
@@ -7,6 +7,7 @@
7
7
 
8
8
  import { pathToFileURL } from 'node:url'
9
9
  import { abs, pow } from './0/algebra.ts'
10
+ import { VORTEX_ORBIT, VORTEX_AXIS } from './0/index.ts'
10
11
  import { legacyDigitalRoot } from './0/3/6/9/1/2/4/8/7/5/1/a432.roots.ts'
11
12
 
12
13
  export class VortexMath {
@@ -41,10 +42,14 @@ export class VortexMath {
41
42
  }
42
43
 
43
44
  /**
44
- * Get the core Mobius Circuit pattern [1,2,4,8,7,5]
45
+ * The core Mobius circuit the kernel's VORTEX_ORBIT, not a second copy.
46
+ *
47
+ * This returned a literal, so it was one of 91 places in the tree holding
48
+ * its own copy of a constant the kernel already exports. Bound rather than
49
+ * retyped, it cannot drift from the definition.
45
50
  */
46
51
  static getMobiusCircuit(): number[] {
47
- return [1, 2, 4, 8, 7, 5];
52
+ return [...VORTEX_ORBIT];
48
53
  }
49
54
 
50
55
  /**
@@ -52,7 +57,7 @@ export class VortexMath {
52
57
  * These numbers form the higher dimensional control axis in VBM
53
58
  */
54
59
  static getSpiritNumbers(): number[] {
55
- return [3, 6, 9];
60
+ return [...VORTEX_AXIS];
56
61
  }
57
62
 
58
63
  /**
@@ -32,6 +32,11 @@
32
32
  import { createHash } from 'node:crypto'
33
33
  import { digitalRoot, throughVoid, bearingForDigit, VORTEX_SEQUENCE, VORTEX_ORBIT, VORTEX_AXIS } from '../0/index.ts'
34
34
  import { angleForDigit } from '../0/3/6/9/1/2/4/8/7/5/1/a432.math.ts'
35
+ import { A432Sequence } from '../0/3/6/9/1/2/4/8/7/5/1/a432.utils.ts'
36
+ import { getTrinityAxis } from '../0/3/6/9/1/2/4/8/7/5/1/a432.math.ts'
37
+ import { a432RodinCoil } from '../0/3/6/9/1/2/4/8/7/5/1/a432.coil.ts'
38
+ import { a432Shears } from '../0/3/6/9/1/2/4/8/7/5/1/a432.shear.ts'
39
+ import { a432ElectronShear } from '../0/3/6/9/1/2/4/8/7/5/1/a432.shear.electron.ts'
35
40
  import { foldToLean, leanIsFixed } from '../kernel/import-graph.ts'
36
41
  import {
37
42
  GIBBS_FORMATION,
@@ -69,6 +74,10 @@ import {
69
74
  STEANE_CODE,
70
75
  symplecticProduct,
71
76
  estimateSurfaceCodeThreshold,
77
+ groverQueries,
78
+ deutschJozsaQueries,
79
+ SEPARATIONS,
80
+ advantageSelfTest,
72
81
  executeInSuperposition,
73
82
  computeInterferencePattern,
74
83
  describeQuantumExecution,
@@ -471,6 +480,63 @@ export const SEALS: Record<string, Seal> = {
471
480
  return TRIAD.every((t) => reflected.includes(t))
472
481
  },
473
482
  },
483
+ a432_vortex_is_the_doubling_orbit: {
484
+ basis: "A432Sequence.generateVortex returned digitalRoot(i + 1) — the counting sequence 1..9 — under the name 'vortex'. Two things gave it away: it was byte-identical to generateConsciousness(9), and it contained 3, 6 and 9, which doubling_avoids_the_triad proves the doubling circuit can never reach. Nothing caught it because no test in the repository names it and the a432 surface has no tests at all. This binds the a432 layer's vortex to the kernel's VORTEX_ORBIT so the two cannot drift apart again.",
485
+ decide: () => {
486
+ // One period. Must BE the kernel's orbit — not merely orbit-shaped.
487
+ const period = A432Sequence.generateVortex(VORTEX_ORBIT.length)
488
+ if (period.join() !== VORTEX_ORBIT.join()) return false
489
+
490
+ // The bug's own signature: the triad must be absent. This is the
491
+ // conjunct that the counting sequence fails, so it is what makes the
492
+ // seal falsifiable rather than decorative. VORTEX_AXIS is narrowed to
493
+ // 3 | 6 | 9, so it is widened to compare against arbitrary digits.
494
+ const TRIAD: readonly number[] = VORTEX_AXIS
495
+ if (period.some((d) => TRIAD.includes(d))) return false
496
+
497
+ // Every term a unit mod 9, which is why the triad is unreachable.
498
+ if (period.some((d) => d % 3 === 0)) return false
499
+
500
+ // It is the doubling map, step by step, not a list that happens to match.
501
+ for (let i = 0; i < period.length; i++) {
502
+ if (digitalRoot(period[i]! * 2) !== period[(i + 1) % period.length]!) return false
503
+ }
504
+
505
+ // Period 6: asking for more repeats the circuit rather than continuing to
506
+ // count. The old implementation ran 1..9 and then wrapped, so length 12
507
+ // is where the two disagree most visibly.
508
+ const twice = A432Sequence.generateVortex(VORTEX_ORBIT.length * 2)
509
+ if (twice.slice(0, VORTEX_ORBIT.length).join() !== twice.slice(VORTEX_ORBIT.length).join()) return false
510
+
511
+ // And it must no longer be the counting sequence wearing the name.
512
+ return A432Sequence.generateVortex(9).join() !== A432Sequence.generateConsciousness(9).join()
513
+ },
514
+ },
515
+ a432_constants_do_not_drift_from_the_kernel: {
516
+ basis: "An isolated collision trial over all 198 a432 modules found the kernel's constants RETYPED as literals in module after module: [1,2,4,8,7,5] in a432.coil, [3,6,9] in a432.trinity, [1,4,7] in both a432.shear and a432.shear.electron. Each retyped copy is a place that can drift with nothing noticing, which is exactly how generateVortex became the counting sequence. Some modules already bind to the kernel — a432.string.theory returns VORTEX_ORBIT itself and cannot drift — so this seal holds the literal copies to the same standard by recomputing the agreement instead of trusting it.",
517
+ decide: () => {
518
+ // The doubling circuit, retyped as a literal in a432.coil.
519
+ if (a432RodinCoil().join() !== VORTEX_ORBIT.join()) return false
520
+
521
+ // The triad. a432.math derives it by slicing A432_SEQUENCE, so this also
522
+ // pins that sequence's ordering, not just the three digits.
523
+ if (getTrinityAxis().join() !== VORTEX_AXIS.join()) return false
524
+
525
+ // [1,4,7] is not a kernel constant, so it is derived rather than
526
+ // compared to another literal: it is exactly the set that reflection
527
+ // through the void carries ONTO the triad. Computing the preimage is
528
+ // what keeps this from being one hardcoded array checked against another.
529
+ const preimage = VORTEX_AXIS.map((t) => throughVoid(t)).sort((a, b) => a - b)
530
+ if (a432Shears().slice().sort((a, b) => a - b).join() !== preimage.join()) return false
531
+ if (a432ElectronShear().join() !== a432Shears().join()) return false
532
+
533
+ // And the preimage must actually reflect back onto the triad, so the
534
+ // relation is verified in both directions rather than assumed from the
535
+ // fact that throughVoid produced it.
536
+ const TRIAD: readonly number[] = VORTEX_AXIS
537
+ return preimage.every((n) => TRIAD.includes(throughVoid(n)))
538
+ },
539
+ },
474
540
  superposition_reports_its_own_state: {
475
541
  basis: "the superposition model's prose must follow its measurement, not assert simultaneity regardless. Collapse is decided by one comparison — interference against the threshold — and the description must claim 'all at once' exactly when that comparison says so. While anything is still open the sequence has not computed all at once, and the text must say that.",
476
542
  decide: () => {
@@ -774,6 +840,43 @@ export const SEALS: Record<string, Seal> = {
774
840
  return leanIsFixed(full, ['r'])
775
841
  },
776
842
  },
843
+ simulation_shows_no_query_advantage: {
844
+ basis: "the algorithm's query count beats classical and the SIMULATION's does not, and both are checked. Grover asks about sqrt(N) times as an algorithm, against N classically — a proven separation with a matching BBBV lower bound. Simulating one such query costs 2^n oracle evaluations, so the simulation makes MORE calls than classical, always, by construction. A repository that claimed to demonstrate quantum advantage by simulation would be measuring the wrong quantity, so this seal requires the simulation to lose.",
845
+ decide: () => {
846
+ if (advantageSelfTest().length > 0) return false
847
+
848
+ for (const qubits of [4, 6, 8]) {
849
+ const r = groverQueries(qubits, (1 << qubits) - 1)
850
+ if (!r.correct) return false
851
+ // The algorithm wins.
852
+ if (!(r.algorithmQueries < r.classicalWorstCase)) return false
853
+ // The simulation loses, and must — one query costs the state vector.
854
+ if (!(r.simulatedOracleCalls > r.classicalWorstCase)) return false
855
+ if (r.simulatedOracleCalls !== r.algorithmQueries * r.space) return false
856
+ }
857
+
858
+ // The algorithmic gap widens; a constant factor would not be a speedup.
859
+ const a = groverQueries(4, 15)
860
+ const b = groverQueries(8, 255)
861
+ if (!(b.classicalWorstCase - b.algorithmQueries > a.classicalWorstCase - a.algorithmQueries)) return false
862
+
863
+ // Deutsch-Jozsa: one algorithmic query, and the simulation pays the space.
864
+ const dj = deutschJozsaQueries(4, true)
865
+ if (dj.algorithmQueries !== 1 || !dj.correct) return false
866
+ if (!(dj.simulatedOracleCalls >= dj.space)) return false
867
+
868
+ // Shor must be recorded as CONDITIONAL, and Deutsch-Jozsa's exponential
869
+ // must carry its exact-classical condition. Dropping either is the
870
+ // overstatement this seal exists to prevent.
871
+ const shor = SEPARATIONS.find((x) => x.algorithm === 'Shor')
872
+ const dozsa = SEPARATIONS.find((x) => x.algorithm === 'Deutsch-Jozsa')
873
+ const grover = SEPARATIONS.find((x) => x.algorithm === 'Grover')
874
+ if (shor?.standing !== 'conditional') return false
875
+ if (dozsa?.standing !== 'proven-against-exact-classical') return false
876
+ return grover?.standing === 'proven'
877
+ },
878
+ },
879
+
777
880
  }
778
881
 
779
882
  // ============================================================================