SNAPKITTYWEST commited on
Commit
5138bf5
Β·
verified Β·
1 Parent(s): 824aded

Add docs/QUANTUM_SWARM.md

Browse files
Files changed (1) hide show
  1. docs/QUANTUM_SWARM.md +172 -0
docs/QUANTUM_SWARM.md ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Quantum Swarm β€” Precise Definition
2
+
3
+ **For researchers.** No metaphors.
4
+
5
+ ---
6
+
7
+ ## What A Swarm Element Is
8
+
9
+ A swarm element in SnapKitty is **a classical inference agent whose temperature parameter is seeded by real quantum entropy.**
10
+
11
+ It is not:
12
+ - A quantum particle
13
+ - A quantum state in superposition
14
+ - A topological charge
15
+ - An anyon
16
+
17
+ It is:
18
+ - An HTTP call to an LLM inference backend (Ollama local or OpenRouter cloud)
19
+ - Carrying a Born-collapsed temperature value derived from ANU QRNG entropy
20
+ - Running concurrently with other elements (bounded by `VRAM_SLOTS = 6`)
21
+ - Returning a quality-scored text response
22
+
23
+ **Evidence:** `bob-orchestrator/bridges/quantum-swarm.mjs`
24
+
25
+ ---
26
+
27
+ ## Complete Definition
28
+
29
+ ```
30
+ Swarm element:
31
+ id: string (HKDF-derived from quantum seed slice)
32
+ model: string (Ollama model identifier)
33
+ temperature: float ∈ (0,1) (Born-collapsed from quantum entropy)
34
+ prompt: string (the query)
35
+ result: string | null (inference response)
36
+ quality: float ∈ [0,1] (scored after completion)
37
+ seal: hex string (SHA-256 WORM receipt)
38
+ ```
39
+
40
+ **State transitions:**
41
+ ```
42
+ PENDING β†’ RUNNING (HTTP call dispatched)
43
+ RUNNING β†’ COMPLETE (response received)
44
+ RUNNING β†’ FAILED (timeout / error)
45
+ COMPLETE β†’ SEALED (WORM receipt written)
46
+ ```
47
+
48
+ **Allowed transitions:** strictly forward β€” no back-edges, no loops.
49
+
50
+ ---
51
+
52
+ ## The Quantum Component
53
+
54
+ The only genuinely quantum component is the entropy source.
55
+
56
+ **Source:** Australian National University Quantum Random Number Generator API (ANU QRNG)
57
+ **Type:** Real vacuum fluctuations β€” physical quantum randomness, not pseudo-random
58
+ **Usage:** 512 bytes fetched once per swarm invocation
59
+ **Processing:**
60
+ ```
61
+ ANU QRNG batch (512 bytes)
62
+ ↓
63
+ HKDF-SHA256 key derivation (one derived key per agent)
64
+ β†’ keys are orthogonal (non-correlated per HKDF construction)
65
+ ↓
66
+ Normalize uint16 β†’ [0, 1]
67
+ Filter to thermal window [0.2, 0.8]
68
+ ↓
69
+ Born collapse: uniform weights within window, select dominant
70
+ ↓
71
+ Temperature parameter T ∈ (0.2, 0.8) for this agent
72
+ ```
73
+
74
+ **What is quantum:** the 512-byte entropy batch (physical quantum measurement)
75
+ **What is classical:** everything after β€” HKDF, normalization, window filter, Born collapse, LLM inference
76
+ **What is classical metaphor:** "Born collapse" is an analogy to quantum measurement. It is implemented as a weighted average, not a quantum operation.
77
+
78
+ ---
79
+
80
+ ## What Connects Two Elements
81
+
82
+ Nothing directly. The swarm topology is a **star** (not a mesh or lattice):
83
+ ```
84
+ β”Œβ”€ agent-0 ─┐
85
+ β”œβ”€ agent-1 ──
86
+ Coordinator ─ agent-2 ── β†’ aggregated result β†’ WORM seal
87
+ β”œβ”€ agent-3 ──
88
+ └─ agent-N β”€β”˜
89
+ ```
90
+
91
+ Elements do not communicate with each other. All communication passes through the coordinator. There are no entanglement-like correlations between agents beyond the shared HKDF key derivation from the same quantum seed.
92
+
93
+ The HKDF derivation does mean all agents' temperatures are derived from the same physical quantum event. This is the only "connection" β€” shared quantum ancestry, not peer communication.
94
+
95
+ ---
96
+
97
+ ## What Is Measured
98
+
99
+ The swarm measures:
100
+ 1. **Quality score** per agent response (evaluated by coordinator)
101
+ 2. **Consensus** by quality-weighted aggregation
102
+ 3. **WORM chain integrity** (every event sealed and verifiable)
103
+
104
+ There is no quantum measurement in the physical sense. The word "measurement" in this codebase means scoring a classical text response.
105
+
106
+ ---
107
+
108
+ ## The 5-Role Variant
109
+
110
+ `sov-kernel-monster/quantum-piper/swarm/swarm_coordinator.mjs`
111
+
112
+ Five named agents:
113
+ | Role | Model | Purpose |
114
+ |------|-------|---------|
115
+ | architect | Nemotron Ultra 550B (OpenRouter) | High-level reasoning |
116
+ | delegate | Nemotron Super 49B | Coordination |
117
+ | engineer | Qwen3-Coder 480B | Implementation |
118
+ | witness | Gemma-3-27B | Independent review |
119
+ | worker | Gemma3:12b (local Ollama) | Execution |
120
+
121
+ Each role's temperature is derived from `qnu_temperature.mjs` (ANU QRNG source). Each role is a distinct classical inference process β€” the "roles" are prompt engineering, not quantum states.
122
+
123
+ ---
124
+
125
+ ## What Remains Invariant
126
+
127
+ The WORM chain is invariant: SHA-256 append-only audit log. No event can be removed or modified after sealing. The quantum genesis seal (SHA-256 of the ANU entropy batch) anchors the entire chain to a physical quantum event.
128
+
129
+ ---
130
+
131
+ ## What The Swarm Visualization Represents
132
+
133
+ The swarm visualization (if built) would show:
134
+ - **Nodes:** individual inference agents (classical processes)
135
+ - **Edges:** data flow from coordinator to agents and back
136
+ - **Node color:** quality score (0=red, 1=green)
137
+ - **Edge labels:** temperature value (quantum-derived)
138
+ - **Root node:** quantum entropy source (ANU QRNG)
139
+
140
+ Every visible node corresponds to an actual inference call. Every edge corresponds to an actual data transfer. No decorative quantum effects.
141
+
142
+ ---
143
+
144
+ ## Relationship To Topological Quantum Computing
145
+
146
+ The swarm uses:
147
+ - No braids
148
+ - No anyons
149
+ - No fusion rules
150
+ - No topological protection
151
+
152
+ The braid group work in SnapKitty (`BraidCompilation.lean`, `carry-agent/braid.rs`) is a **separate research track** β€” formal verification of Fibonacci anyon gate synthesis. It is not connected to the swarm at runtime.
153
+
154
+ The word "quantum" in "quantum swarm" refers to the entropy source only.
155
+
156
+ ---
157
+
158
+ ## Summary: Classical vs. Quantum
159
+
160
+ | Component | Classical | Quantum |
161
+ |-----------|:---------:|:-------:|
162
+ | Entropy source (ANU QRNG) | | βœ“ (physical) |
163
+ | HKDF key derivation | βœ“ | |
164
+ | Temperature assignment | βœ“ | |
165
+ | LLM inference | βœ“ | |
166
+ | Quality scoring | βœ“ | |
167
+ | WORM chain | βœ“ | |
168
+ | "Born collapse" aggregation | βœ“ (metaphor) | |
169
+ | Braid compilation (Lean) | βœ“ (formal spec) | βœ“ (theory) |
170
+ | Fibonacci anyon sim | βœ“ (classical) | |
171
+
172
+ **One line:** The quantum swarm is a classical multi-agent system where temperature scheduling uses real quantum entropy from ANU vacuum fluctuations, and results are sealed in a quantum-genesis-anchored WORM chain.