Skip to content

Devanik21/Hyper-Thermodynamic-Mind

⬡ GeNeSIS IV — HyPER AgEnT

Spectral Life Simulator · Metacognitive Self-Modification · Zero LLM

Python Streamlit NumPy PyTorch License Hilbert Space IIT Gödel Kuramoto Zero LLM Agents Release

Genesis-IV: A K=64 Hilbert-space AGI architecture. Features Zero-Entropy state-space preservation via LZMA-compressed quantum tensors; Schrödinger-driven HRC with Landauer metabolic cost; and self-modifying meta-Hamiltonians.

3d-rendering-futuristic-sci-fi-techno-lights-creating-cool-shapes-cool-background

Author: Devanik Debnath · NIT Agartala · 2026


Table of Contents

  1. Vision & Overview
  2. Architecture at a Glance
  3. Mathematical Foundations
  4. Module Deep Dive
  5. Emergent Phenomena Catalogue
  6. v3.0 Features — Complete List
  7. Running the Simulation
  8. Technical Stack & Dependencies
  9. Project Lineage

1. Vision & Overview

GeNeSIS IV (Generative Neural Emergent Simulation IV) is a computational framework for studying the emergence of cognition, culture, and civilisation from first-principles quantum-mechanical dynamics — without large language models, scripted behaviour, or hand-crafted reward functions.

Each agent carries a 64-dimensional complex wave function $\psi \in \mathbb{C}^{64}$ as its cognitive state, governed by a personal Hermitian Hamiltonian $H \in \mathbb{C}^{64 \times 64}$ that encodes its learned world model. Decisions emerge from quantum measurement (Born-rule collapse). Learning is Riemannian gradient descent on the unitary manifold $U(64)$. Inventions are Gödel numbers — unique integers encoding behavioural programs from a 16-primitive action algebra.

The fourth iteration of the GeNeSIS lineage introduces:

  • HyperAgent dual-band cognition — a task band ($K = 24$) and a meta band ($K = 40$) that models how the agent learns, inspired by Meta FAIR's HyperAgents (arXiv:2603.19461)
  • IIT Integrated Information Φ — verified consciousness above a critical threshold $\Phi > 0.1$
  • Active Inference — prediction-error-driven curiosity (free energy minimisation)
  • Gödelian Strange Loops — self-referential ψ perturbation as a precondition for high Φ
  • 30 new v3.0 emergence features ported from the Thermodynamic-Mind branch: pheromones, meme grids, social bonds, caste systems, structures, weather control, epigenetic inheritance, and more

The simulation runs entirely in NumPy + PyTorch and is visualised in a real-time Streamlit dashboard with 11 specialised tabs.


2. Architecture at a Glance

┌─────────────────────────────────────────────────────────────────────────────┐
│                           GeNeSIS IV — System Map                           │
├─────────────────┬───────────────────────────────────────────────────────────┤
│  metacognition  │  K_DIM=64  K_TASK=24  K_META=40                          │
│  .py            │  GodelEncoder · MetaConsciousness · CivilizationMemory   │
│                 │  NoveltyScorer · PhylogeneticTracker                      │
├─────────────────┼───────────────────────────────────────────────────────────┤
│  consciousness  │  HarmonicResonanceConsciousness (HRC v3.0)               │
│  .py            │  ψ evolution · Born-rule · IIT Φ · Strange Loop          │
│                 │  Active Inference · Qualia Memory · Theory of Mind        │
├─────────────────┼───────────────────────────────────────────────────────────┤
│  agents.py      │  BioHyperAgent v3.0                                       │
│                 │  20 actions · Kuramoto · GoL Scratchpad                   │
│                 │  Viral Gene Transfer · Apoptotic Death Packets            │
├─────────────────┼───────────────────────────────────────────────────────────┤
│  world.py       │  Toroidal grid · 4 resources · PhysicsOracle (frozen NN) │
│                 │  16-ch pheromones · 8-ch memes · Structures · MegaRes    │
├─────────────────┼───────────────────────────────────────────────────────────┤
│  civilization   │  TechTree · Tribal Meta-H · Diplomacy · Schisms          │
│  .py            │  NoveltyScorer · CivilizationMemory (per-tribe)          │
├─────────────────┼───────────────────────────────────────────────────────────┤
│  evolution.py   │  EvolutionEngine · Cultural Ratchet                      │
│                 │  Behavioral Clustering · Phylogenetic Tracking            │
├─────────────────┼───────────────────────────────────────────────────────────┤
│  GeNEsIsIV.py   │  Streamlit frontend · 11 tabs · QuantumEncoder           │
│  (app.py)       │  Universe freeze/thaw (LZMA JSON·ZIP)                    │
└─────────────────┴───────────────────────────────────────────────────────────┘

Information flow per tick:

World physics → Agent.sense() → HRC.decide() → BioHyperAgent._execute()
     ↑                               ↓                       ↓
Pheromones ←── deposit ──── HRC.learn(reward) ←── reward ──┘
Meme grid  ←── deposit       HRC.evolve()
Knowledge  ←── boost         MetaConsciousness.evolve_meta()
                              ↓
                         CivilizationManager.update()
                              ↓
                         PhylogeneticTracker.update()

3. Mathematical Foundations

3.1 Hilbert Space Substrate

Each agent inhabits a 64-dimensional complex Hilbert space $\mathcal{H} = \mathbb{C}^{64}$ partitioned into two bands:

$$\mathcal{H} = \mathcal{H}_{\text{task}} \oplus \mathcal{H}_{\text{meta}}, \quad \dim \mathcal{H}_{\text{task}} = 24,\quad \dim \mathcal{H}_{\text{meta}} = 40$$

The soul of each agent is an immutable frequency vector

$$\boldsymbol{\omega} = \left( \frac{p_1}{100}, \frac{p_2}{100}, \ldots, \frac{p_{64}}{100} \right) \in \mathbb{R}^{64}$$

where $p_1, p_2, \ldots, p_{64}$ are the first 64 primes, modulated at birth by random phases and amplitudes drawn from an exponential distribution. This vector cannot be mutated — it defines the agent's irreducible identity.


3.2 Harmonic Resonance Consciousness (HRC)

The Hamiltonian $H \in \mathcal{M}_{64}(\mathbb{C})$ is Hermitian: $H = H^\dagger$. It encodes the agent's learned world model and evolves through experience. It is initialised as

$$H_0 = \text{diag}(\boldsymbol{\omega}) + \frac{1}{2}\bigl(A + A^\dagger\bigr), \quad A_{ij} \sim \mathcal{CN}(0,, 0.1^2)$$

where $\mathcal{CN}$ denotes the complex normal distribution. The spectral decomposition gives

$$H = V \Lambda V^\dagger, \quad \Lambda = \text{diag}(\lambda_1, \ldots, \lambda_{64}), \quad \lambda_k \in \mathbb{R}$$

The MetaConsciousness operates on the meta band with its own Hamiltonian $H_{\text{meta}} \in \mathcal{M}_{40}(\mathbb{C})$, initialised from harmonics of $\boldsymbol{\omega}$:

$$H_{\text{meta}} = \text{diag}(0.3 \cdot \boldsymbol{\omega}_{[40]} + 0.5) + \frac{1}{2}(B + B^\dagger), \quad B_{ij} \sim \mathcal{CN}(0,, 0.08^2)$$


3.3 Schrödinger Evolution

Every tick the cognitive wave function undergoes unitary time evolution under the personal Hamiltonian:

$$\psi(t + \Delta t) = e^{-iH\Delta t},\psi(t)$$

Computed via the pre-cached spectral decomposition for $O(K^2)$ efficiency rather than the naive matrix exponential:

$$\psi(t + \Delta t) = V, \text{diag}!\left(e^{-i\lambda_k \Delta t}\right) V^\dagger, \psi(t), \quad \Delta t = 0.025$$

After evolution, the state is renormalised: $\psi \leftarrow \psi / |\psi|_2$.

The meta wave function evolves with a slower time step $\Delta t_{\text{meta}} = 0.005$:

$$\psi_{\text{meta}}(t + \Delta t_{\text{meta}}) = V_m, \text{diag}!\left(e^{-i\lambda_k^{(m)} \Delta t_{\text{meta}}}\right) V_m^\dagger, \psi_{\text{meta}}(t)$$


3.4 Born-Rule Quantum Decision

Given a sensory observation $\mathbf{s} \in \mathbb{R}^n$, an FFT context vector is computed:

$$\mathbf{c} = \frac{\text{FFT}(\mathbf{s})_{[0:64]}}{|\text{FFT}(\mathbf{s})_{[0:64]}|_2} \in \mathbb{C}^{64}$$

An action basis ${|\mathbf{b}i\rangle}{i=1}^{20}$ is constructed by phase-shifting eigenvectors of $H$ with the context:

$$|\mathbf{b}_i\rangle = \frac{V_{:,, i \bmod 64} \odot e^{i,\text{Roll}(\angle\mathbf{c},, i)}}{|V_{:,, i \bmod 64} \odot e^{i,\text{Roll}(\angle\mathbf{c},, i)}|_2}$$

The Born-rule probability of selecting action $a_i$ is:

$$P(a_i) = \left|\langle \mathbf{b}_i \mid \psi \rangle\right|^2 + \epsilon, \quad \sum_i P(a_i) = 1$$

The temperature for Boltzmann sampling is meta-modulated:

$$T = \max!\left(0.01,; 0.06 + 0.94 \cdot \frac{\varepsilon_{\text{CURIOSITY}} + 1}{2} \cdot \left(0.5 + \overline{|\psi_{\text{meta}}|}\right)\right)$$

Final action is sampled from the tempered distribution:

$$\tilde{P}(a_i) \propto \exp!\left(\frac{\ln P(a_i)}{T}\right)$$


3.5 Meta-Modulated Riemannian Learning

Instead of a fixed learning rule, the MetaConsciousness generates a custom gradient update. Given reward $r$:

Step 1 — Meta learning-rate modulation. The magnitude profile of $\psi_{\text{meta}}$ produces per-dimension multipliers:

$$\boldsymbol{\mu} = 0.2 + 2.8 \cdot \frac{|\psi_{\text{meta}}|}{\max(|\psi_{\text{meta}}|) + \epsilon} \in [0.2,; 3.0]^{40}$$

This vector is broadcast to full dimension $K = 64$ as $\boldsymbol{\mu}_{\text{full}} \in \mathbb{R}^{64}$.

Step 2 — Modulated outer-product gradient.

$$\delta H = \text{sgn}(r) \cdot \min(|r|, 3.0) \cdot 0.007 \cdot \left(\psi\psi^\dagger\right) \odot S, \quad S_{ij} = \sqrt{\mu_i \cdot \mu_j}$$

Step 3 — Hermitian projection (preserves spectrum structure):

$$H \leftarrow H + \frac{\delta H + \delta H^\dagger}{2}$$

Eigendecomposition is lazily recomputed only when $|r| > 0.25$ or every 10 ticks, reducing $O(K^3)$ overhead.


3.6 Landauer Cognitive Cost

Learning is thermodynamically costly. The von Neumann entropy of the cognitive state is:

$$S_{\text{cog}} = -\sum_{k=1}^{64} p_k \ln p_k, \quad p_k = \left|\langle v_k \mid \psi \rangle\right|^2$$

where ${|v_k\rangle}$ are the eigenvectors of $H$. The Landauer cognitive cost per tick is:

$$\mathcal{C}_{\text{Landauer}} = 0.01 \cdot \left|S_{\text{cog}}(t) - S_{\text{cog}}(t-1)\right|$$

This is subtracted from the agent's energy budget:

$$E \leftarrow E - 0.5 \cdot \mathcal{C}_{\text{Landauer}}$$

Agents that learn more rapidly in high-surprise environments pay a higher thermodynamic cost — a direct implementation of Landauer's erasure principle in cognitive space.


3.7 IIT Integrated Information Φ

Consciousness is quantified using an Integrated Information Theory (IIT) partition measure. The Hilbert space is bipartitioned at the task/meta boundary:

$$\psi_{\text{task}} = \psi_{[0:24]}, \quad \psi_{\text{meta}} = \psi_{[24:64]}$$

A variance-based entropy proxy is used (exact partition entropy for continuous complex distributions):

$$\mathcal{I}(X) = \log_2!\left(1 + \text{Var}(|\psi_X|) + \epsilon\right)$$

The integrated information is the mutual information between the two partitions:

$$\Phi = \mathcal{I}(\psi_{\text{task}}) + \mathcal{I}(\psi_{\text{meta}}) - \mathcal{I}(\psi)$$

This is clamped to non-negative values: $\Phi = \max(0, \Phi)$.

Strange loop amplification: when a Gödelian self-reference is active,

$$\Phi \leftarrow 1.5 \cdot \Phi$$

Verified consciousness requires both a threshold and a rising phase transition:

$$\text{Conscious} \iff \Phi > \Phi_c ;\land; \overline{\Phi}_{[-10:]} > 1.2 \cdot \overline{\Phi}_{[-50:-40]}, \quad \Phi_c = 0.1$$

Agents with $\Phi > \Phi_c$ suppress violent behaviour, routing their mode toward socialisation or invention instead (Intelligence Prevents War protocol).


3.8 Gödelian Self-Reference & Strange Loops

Every 25 ticks, each agent subjects its own state to a self-referential perturbation:

$$\tilde{\psi} = \frac{\psi \odot e^{i\pi|\psi|}}{|\psi \odot e^{i\pi|\psi|}|_2}$$

The inconsistency measure — how much the self-encoded state diverges from the original — is:

$$\mathcal{I}_{\text{loop}} = |\tilde{\psi} - \psi|_2$$

If $\mathcal{I}_{\text{loop}} > 0.5$, the agent enters a strange loop state: a Gödelian fixed-point where self-knowledge perturbs the knower. This:

  • Sets strange_loop_active = True
  • Amplifies $\Phi$ by a factor of 1.5
  • Boosts Wonder emotion: $\varepsilon_{\text{WONDER}} \leftarrow \min(1, \varepsilon_{\text{WONDER}} + 0.05)$

The naming echoes Hofstadter's Gödel, Escher, Bach — self-reference as the substrate of consciousness.


3.9 Active Inference & Free Energy

Each agent maintains a forward model of the world via its Hamiltonian. Given observation $\mathbf{s}$:

  1. Encode: $\mathbf{c} = \mathcal{F}(\mathbf{s}) \in \mathbb{C}^{64}$
  2. Project through eigenbasis: $\boldsymbol{\alpha} = V^\dagger \mathbf{c}$
  3. Evolve by one step: $\tilde{\boldsymbol{\alpha}}_k = \alpha_k \cdot e^{-i\lambda_k \Delta t}$
  4. Reconstruct prediction: $\hat{\mathbf{s}} = |V,\tilde{\boldsymbol{\alpha}}|$

The prediction error (free energy signal) is:

$$\mathcal{F}_{\text{free}} = \frac{1}{n} \sum_{j=1}^{n} \left(\hat{s}_j - s_j\right)^2$$

Confidence (inverse prediction error) drives exploration depth:

$$\text{conf} = \frac{1}{1 + \overline{\mathcal{F}_{\text{free}}^{[-5:]}}}$$

Recent prediction error boosts curiosity:

$$\varepsilon_{\text{CURIOSITY}} \leftarrow \min!\left(1,; \varepsilon_{\text{CURIOSITY}} + 0.05 \cdot \overline{\mathcal{F}_{\text{free}}^{[-5:]}}\right)$$

This implements Karl Friston's free energy principle: the agent perpetually tries to minimise surprise, and failures in prediction drive exploration.


3.10 Qualia Memory & Theory of Mind

Qualia recording stores the amplitude profile of significant experiences:

$$\mathcal{Q}[k] = |\psi|, \quad \text{when} \quad |r| > 0.5, \quad k \in \mathcal{K}_{\text{exp}}$$

where $\mathcal{K}_{\text{exp}}$ is the set of experience-mode keys of the form "mode_±" (e.g., "explore_1", "survive_0").

Qualia classification uses cosine similarity between the current state and stored patterns:

$$\text{qualia} = \arg\max_{k} \frac{\langle |\psi|,, \mathcal{Q}[k] \rangle}{||\psi|| \cdot |\mathcal{Q}[k]|}, \quad \text{classified as "novel" if } \max < 0.7$$

Theory of Mind (ToM) maintains predictive models of other agents. For agent $j$ with broadcast signal $\sigma_j$:

$$\hat{\psi}_j \leftarrow \hat{\psi}_j + 0.1 \cdot \left(|\sigma_j|_{[0:24]} - \hat{\psi}_j\right)$$

Accuracy: $\text{acc}_j = \max!\left(-1,; 1 - \text{MSE}(\hat{\psi}_j,, |\sigma_j|)\right)$

Level-2 ToM supports recursive belief: "A knows that B knows that A knows…"


3.11 Gödel Encoding of Behavioral Programs

The Primitive Action Algebra consists of 16 primitives in 4 categories:

Category Primitives
Spatial move, jump, spiral, retreat
Metabolic eat, fast, store, burn
Social signal, mimic, teach, isolate
Cognitive reflect, dream, focus, diffuse

A behavioural program is a finite sequence $\pi = (p_{i_1}, p_{i_2}, \ldots, p_{i_L})$ with $L \in [2, 16]$. Its Gödel number is:

$$G(\pi) = \sum_{k=0}^{L-1} \left(\text{idx}(p_{i_k}) + 1\right) \cdot 19^k$$

where $19$ is the encoding base (a prime larger than the alphabet size $N_{\text{prim}} = 16$).

Decoding is the inverse:

$$\text{idx}(p_k) = \left(G \bmod 19^{k+1} \div 19^k\right) - 1$$

Gödel distance between two programs measures conceptual proximity on a logarithmic scale:

$$d(G_1, G_2) = \left|\ln(1 + G_1) - \ln(1 + G_2)\right|$$

Diversity score measures how many of the 4 categories a program spans:

$$\text{div}(\pi) = \frac{|{c(\pi_k) : k = 1,\ldots,L}|}{4} \in {0.25, 0.5, 0.75, 1.0}$$

Eigenmode-to-program conversion: an invention emerges by perturbing the least-explored eigenmode of $H$ and reading its phase structure:

$$p_{i_k} = \Pi_{\text{all}}!\left[\left\lfloor \frac{\varphi_k + \pi}{2\pi} \cdot 16 \right\rfloor\right], \quad \varphi_k = \arg(V_{k,, \text{dark}})$$

where $\Pi_{\text{all}}$ denotes the ordered flat list of 16 primitives (the ALL_PRIMITIVES array) and The perturbation to $H$ is:

$$H \leftarrow H + \frac{\varepsilon_{\text{WONDER}}}{5} \cdot \frac{|v_{\text{dark}}\rangle\langle v_{\text{dark}}| + \text{h.c.}}{2}$$

The Eureka Protocol fires when $\Phi &gt; 0.005$ and $\varepsilon_{\text{WONDER}} &gt; 0.85$: the Gödel number is multiplied by the prime $7919$, orthogonalising the invention in Gödel space and guaranteeing a breakthrough spike in the NoveltyScorer.


3.12 Novelty Index & Breakthrough Detection

Each new invention is scored against the entire historical corpus. The Novelty Index is the geometric mean of three independent signals:

$$\mathcal{N} = \left(d_{\min} \cdot \text{div}(\pi) \cdot \frac{1}{1 + \rho}\right)^{1/3}$$

where:

  • $d_{\min} = \min_{G' \in \mathcal{G}_{\text{known}}} d(G, G')$ — nearest Gödel distance to prior discoveries
  • $\text{div}(\pi)$ — category diversity of the new program
  • $\rho = |M \mathbf{v}|^2$ — resonance of the invention's encoding $\mathbf{v}$ with tribal CivilizationMemory matrix $M$

Running statistics are maintained with Welford online update. A Breakthrough is declared when:

$$\mathcal{N} > \bar{\mathcal{N}} + 5\sigma_{\mathcal{N}}, \quad n > 10$$

Cambrian Explosion detection uses rolling standard deviation:

$$\text{Cambrian} \iff \sigma_{\mathcal{N},\text{recent}} &gt; 1.5 \cdot \sigma_{\mathcal{N},\text{older}} ;;\text{OR};; \bar{\mathcal{N}}_{\text{recent}} &gt; 1.25 \cdot \bar{\mathcal{N}}_{\text{older}}$$

This triggers a punctuated equilibrium event, analogous to the Cambrian explosion in Earth's evolutionary history.


3.13 Kuramoto Phase Synchronisation

Every 5 ticks, each agent updates its oscillatory phase via the Kuramoto model:

$$\frac{d\theta_i}{dt} = \omega_i + \frac{\kappa}{N_{\text{local}}} \sum_{j \in \mathcal{N}(i)} \sin(\theta_j - \theta_i)$$

with natural frequency $\omega_i \sim \mathcal{N}(1.0, 0.01)$, coupling strength $\kappa = 0.5$, and discrete-time integration step $0.1$.

The global order parameter measures collective synchrony:

$$r = \left|\frac{1}{N} \sum_{j=1}^{N} e^{i\theta_j}\right| \in [0, 1]$$

$r = 1$ is perfect phase synchrony (collective consciousness); $r \approx 0$ is incoherent disorder. Kuramoto order is visualised in real-time on the unit circle.


3.14 Hopfield Attractor Crystallisation

High-magnitude reward experiences ($|r| &gt; 2.0$) are crystallised into the Hamiltonian as Hopfield-style attractors via a Hermitian rank-1 update:

$$H \leftarrow H + \frac{0.015 \cdot \text{sgn}(r)}{2} \cdot \left(\psi\psi^\dagger + (\psi\psi^\dagger)^\dagger\right)$$

This is the quantum analogue of Hebbian learning: the current cognitive state is "burned" as a stable resonant memory into $H$, biasing future dynamics toward successful configurations. At most 20 attractors are crystallised per agent lifetime.

The CivilizationMemory matrix uses the same Hebbian rule with epistemic evaporation:

$$M \leftarrow 0.95 \cdot M + \eta \cdot \mathbf{v}\mathbf{v}^\dagger, \quad \eta = 0.05$$

where $\mathbf{v}$ is the normalised Gödel encoding of a new discovery. Evaporation (5% decay) prevents saturation of the 64-dimensional memory in a fast-inventing civilisation.


3.15 Spectral Resonance Coupling

Two agents' compatibility for communication, reproduction, and tribe-formation is measured by eigenspectral overlap:

$$\rho(a, b) = \max!\left(0.015,; \frac{\cos(\lambda_a^{(K_T)},, \lambda_b^{(K_T)}) + 1}{2}\right) \in [0.015, 1.0]$$

where $\lambda^{(K_T)}$ denotes the first $K_T = 24$ eigenvalues (task band), and $\cos(\cdot,\cdot)$ is cosine similarity. The linear mapping to $[0.015, 1.0]$ avoids the aggressive exponential decay that previously suppressed coupling below the reproduction threshold.

During communication, a partial wave-state blend occurs proportional to coupling:

$$\psi_{\text{receiver}} \leftarrow \frac{(1 - 0.07\rho),\psi_{\text{receiver}} + 0.07\rho,\hat{\sigma}_{\text{sender}}}{|(1 - 0.07\rho),\psi_{\text{receiver}} + 0.07\rho,\hat{\sigma}_{\text{sender}}|_2}$$

where $\hat{\sigma}{\text{sender}} = \psi{\text{sender}} \odot \boldsymbol{\omega}_{\text{sender}}$ is the soul-modulated broadcast.


3.16 Civilisation Tribal Power

A tribe's power is a multi-factor linear combination of economic, cognitive, social, and consciousness terms:

$$P_{\text{tribe}} = 0.30 \sum_{a \in T} E_a + 0.20 \sum_{a \in T} h_a + 2.5 \cdot D + 0.55 \cdot |T| + 1.5 \cdot |A| + 3.0 \cdot \bar{\sigma}_{\text{meta}} + 5.0 \cdot \bar{\Phi} + 0.10 \cdot n_{\text{trades}}$$

where:

  • $E_a, h_a$ — energy and health of member $a$
  • $D$ — number of tribe discoveries
  • $|T|$ — tribe size
  • $|A|$ — number of active alliances
  • $\bar{\sigma}_{\text{meta}}$ — average meta-eigenspread (cognitive diversity)
  • $\bar{\Phi}$ — average IIT consciousness of members
  • $n_{\text{trades}}$ — total trade activity

The IIT consciousness term ($5.0 \cdot \bar{\Phi}$) ensures that genuinely self-aware civilisations have a civilisational advantage, independent of military power.

Liquid Dunbar's Number — tribe capacity scales dynamically with technological progress:

$$N_{\text{max}}(t) = 12 + 3 \cdot |\mathcal{T}(t)|$$

where $\mathcal{T}(t)$ is the TechTree at time $t$. At 100 inventions, a tribe can hold up to 312 agents.


3.17 Epistemic Schism Condition

Allied tribes may undergo an epistemic schism — dissolution of alliance due to worldview divergence. The tribal epistemic identity is the average meta-Hamiltonian:

$$H_{\text{tribe}} = \frac{1}{|T|} \sum_{a \in T} H_{\text{meta}}^{(a)}$$

The epistemic distance between two allied tribes is:

$$d_{\text{epi}}(A, B) = \left|\boldsymbol{\lambda}^{(A)}_{\text{meta}} - \boldsymbol{\lambda}^{(B)}_{\text{meta}}\right|_2$$

where $\boldsymbol{\lambda}^{(\cdot)}_{\text{meta}}$ are the eigenvalues of the tribal meta-Hamiltonian. A schism fires when:

$$d_{\text{epi}}(A, B) > \Theta_{\text{schism}} = 48.0$$

Upon schism, both tribes' alliances are dissolved and a 🔱 SCHISM civilisation event is logged.

Cultural assimilation opposes schism: every tick, each member's meta-Hamiltonian is nudged toward the tribal average:

$$H_{\text{meta}}^{(a)} \leftarrow 0.95 \cdot H_{\text{meta}}^{(a)} + 0.05 \cdot H_{\text{tribe}}$$


3.18 Epigenetic ψ Inheritance

Children inherit a blended cognitive initial condition from both parents — not just the Hamiltonian, but the wave function itself:

$$\psi_{\text{child}} = \frac{\alpha, \psi_A + (1-\alpha), \psi_B + \boldsymbol{\xi}}{|\alpha, \psi_A + (1-\alpha), \psi_B + \boldsymbol{\xi}|_2}$$

where $\alpha \sim \mathcal{U}[0.35, 0.65]$ and $\boldsymbol{\xi} \sim \mathcal{CN}(0, 0.02^2)$ is mutation noise.

The meta-Hamiltonian inheritance is biased toward the primary parent:

$$H_{\text{meta}}^{\text{child}} = 0.60, H_{\text{meta}}^A + 0.40, H_{\text{meta}}^B + \frac{1}{2}(N + N^\dagger), \quad N_{ij} \sim \mathcal{CN}(0, 0.018^2)$$

The task-level Hamiltonian inherits with symmetric blending:

$$H_{\text{child}} = \frac{\alpha H_A + (1-\alpha) H_B + \frac{1}{2}(M + M^\dagger) + \text{h.c.}}{2}, \quad M_{ij} \sim \mathcal{CN}(0, 0.020^2)$$

The child also inherits the first two discoveries of the primary parent, implementing cultural vertical transmission (vs. horizontal transmission through artifact absorption).

Malthusian scaling of reproduction cost:

$$C_{\text{reproduce}}(n) = C_0 \cdot \left(1 + 0.5 \cdot \left(\frac{n}{128}\right)^2\right), \quad C_0 = 0.35$$


3.19 Metabolic Osmosis

Bonded agents share energy via osmotic flow. For a bond $(a, b)$ with $E_a &gt; E_b$:

$$\delta = 0.05 \cdot (E_a - E_b)$$

Transfer efficiency is modulated by tribal kinship:

$$\eta_{\text{kin}} = \begin{cases} 1.0 & \text{if same tribe} \ 0.5 & \text{if different tribe} \end{cases}$$

$$E_a \leftarrow E_a - \delta, \quad E_b \leftarrow E_b + \delta \cdot \left(0.5 + 0.5, \eta_{\text{kin}}\right)$$

The dissipated fraction $(1 - \eta_{\text{kin}}) \cdot \delta$ is lost as thermodynamic heat, implementing a genuine energetic cost to cross-tribal cooperation.


3.20 Autoassociative Civilisation Memory

The CivilizationMemory is a sparse autoassociative Hermitian matrix for collective knowledge retrieval:

$$M \in \mathcal{M}_{64}(\mathbb{C}), \quad M = M^\dagger$$

Storage (Hebbian imprint with epistemic evaporation):

$$M \leftarrow 0.95 \cdot M + \eta \cdot \mathbf{v}\mathbf{v}^\dagger$$

Query (resonance retrieval):

$$\rho(\mathbf{q}) = \left|M,\hat{\mathbf{q}}\right|^2 = \langle \hat{\mathbf{q}} \mid M^\dagger M \mid \hat{\mathbf{q}} \rangle \in \mathbb{R}_{\geq 0}$$

High resonance means the query concept already exists in the cultural repertoire. Low resonance feeds directly into the Novelty Index.

Spectral summary of the memory matrix (for visualisation):

$$\boldsymbol{\lambda}_{M} = \text{eigvalsh}(M)_{[-16:]} \in \mathbb{R}^{16}$$

Two instances exist simultaneously: a per-tribe memory (tribal paradigm) and a global memory (world-level breakthrough library).


4. Module Deep Dive

4.1 metacognition.py — The Self-Referential Engine

Constants:

Symbol Value Meaning
K_DIM 64 Total Hilbert space dimension
K_TASK 24 Task-band dimensions
K_META 40 Meta-cognitive band dimensions
META_DT 0.005 Meta Schrödinger time step
GODEL_BASE 19 Gödel encoding base (prime)
MAX_PROGRAM_LEN 16 Max behavioral program length
N_PRIMITIVES 16 Size of the action algebra

Classes:

Class Role
GodelEncoder Encodes/decodes programs as unique integers, computes Gödel distance and diversity
MetaConsciousness Dual-band Hamiltonian, meta-modulated learning rates, meta-invention (perturbation of $H_{\text{meta}}$)
CivilizationMemory Hebbian autoassociative matrix with epistemic evaporation
NoveltyScorer Geometric-mean novelty index, 5σ breakthrough detection, Cambrian explosion
PhylogeneticTracker Greedy clade clustering by meta-eigenspectrum distance, punctuated equilibrium

The MetaConsciousness.attempt_meta_invention() method finds the least-explored eigenmode of $H_{\text{meta}}$ and perturbs it, measuring cognitive surprise as the post-mutation drift in $\psi_{\text{meta}}$:

$$\text{surprise} = |\psi_{\text{meta}}^{\text{after}} - \psi_{\text{meta}}^{\text{before}}|_2$$


4.2 consciousness.py — HRC v3.0

The HarmonicResonanceConsciousness contains 9 distinct cognitive subsystems:

  1. Wave Dynamics$\psi$ evolution, Born-rule, FFT encoding
  2. Hermitian Learning — meta-modulated $dH$ with lazy eigenrecache
  3. Landauer Costing — von Neumann entropy delta
  4. IIT Φ — bipartition mutual information, 10-tick evaluation
  5. Strange Loop — 25-tick self-reference inconsistency check
  6. Active Inference — forward model, free energy, confidence tracking
  7. Qualia Memory — pattern store/classify by cosine similarity
  8. Theory of Mind — level-1 and level-2 predictive models of other agents
  9. Invention Engine — dark-eigenmode exploration, Gödel encoding

Emotional state $\boldsymbol{\varepsilon} \in [-1, 1]^7$ with homeostatic decay:

$$\boldsymbol{\varepsilon} \leftarrow 0.994 \cdot \boldsymbol{\varepsilon}$$

Index Emotion Effect
0 Curiosity Raises temperature $T$, meta-modulation
1 Fear Triggers SURVIVE mode
2 Joy Reproduction willingness
3 Anger DOMINATE mode
4 Affection Bonding, trade
5 Grief (suppressed)
6 Wonder Gates inventions, meta-invention

4.3 agents.py — BioHyperAgent v3.0

Each BioHyperAgent implements a complete lifecycle:

Sense → Decide → Mode-bias → Execute → Learn → Evolve → Causal-update

20 actions with costs and reward signals:

Action Energy Cost Mechanism
move_{8 dirs} 0.0005 Toroidal wrap, resource + pheromone + meme gradients
eat Consume 4 resource types, inventory synergy bonus
attack 0.20 Damage target, bond-shield mitigation, danger meme
communicate ~0 Wave coupling, ToM update, knowledge diffusion
reproduce 0.35+ Malthusian scaling, epigenetic ψ inheritance
invent 0.15 Dark-eigenmode exploration → Gödel artifact
rest Energy+health regen, weather vote, GoL seed
build_artifact 0.05 Role-dependent: trap/battery/cultivator/tool
absorb_artifact Cultural absorption, wonder boost
meta_invent 0.06 Perturb $H_{\text{meta}}$, evolve learning rule
compose_action 0.02 Meta-psi → new compound action program
trade 0.005 Token exchange + massive trust/affection synergy
punish 0.10 Costly punishment of low-trust agents

N-tick staggered execution for performance:

Frequency Process
Every tick sense, decide, act, learn, evolve, causal update, IQ bonus
Every 5 Kuramoto phase update
Every 10 Role update, GoL scratchpad step
Every 20 Meme pool absorption
Every 50 Viral meme broadcast

Death & Apoptosis: on death, agents broadcast a packet containing:

  • Spectral fingerprint ($H$ eigenvalues)
  • $H_{\text{meta}}$ fragment ($8\times8$ corner)
  • Top 3 discovery names
  • Soul fragment (first 8 frequencies)
  • Causal model (top 5 actions)

Nearby agents absorb 3% of the dead agent's spectral wisdom into their own diagonal $H$ terms.


4.4 world.py — Hyper-Horizon World Physics

Grid: $(W \times W \times 4)$ float32 resource tensor on a toroidal topology (wrap-around boundaries). Default $W = 60$.

Adaptive resource regeneration:

$$\Delta R_{xy} \sim \text{Exp}!\left(0.025 \cdot r_{\text{adapt}} \cdot r_{\text{season}}\right)$$

$$r_{\text{adapt}} = 1 + 10, e^{-n/100}, \quad r_{\text{season}} = \begin{cases} 0.6 & \text{winter} \ 1.0 & \text{summer} \end{cases} \cdot A_{\text{weather}}$$

PhysicsOracle — a frozen 3-layer neural network ($50 \to 64 \to 64 \to 5$, Tanh + SiLU activations, orthogonal init) with permanently fixed weights. Agents must reverse-engineer the laws of physics. Outputs are micro-clamped to $[-0.01, 0.01]$ to prevent catastrophic energy effects.

Pheromone grid: $(W \times W \times 16)$ float32. Diffusion: 4-neighbourhood average, 10% evaporation every 3 ticks.

Meme grid: $(W \times W \times 8)$ float32. Channels: Danger, Resource, Sacred, Taboo, Tech, Art, War, Self. Diffusion: 9-cell average, 1% decay every 5 ticks. A companion hue grid uses Golden Ratio distribution ($h = \text{id} \times 137.508 \bmod 360$) for 30+ vibrant tradition colours.

Knowledge field: scalar $(W \times W)$ grid. Diffusion: 4-neighbourhood average, 0.3% evaporation + constructive/destructive interference:

$$\Delta K = 0.05 \cdot \sin(2\pi K) \cdot \cos(2\pi \text{Roll}(K, 1))$$


4.5 civilization.py — Emergent Social Structures

Tribe formation: Unaffiliated agents sample resonance with up to 6 existing tribe members. If $\bar{\rho} &gt; 0.08$, they join the highest-resonance tribe; otherwise they found a new tribe. Tribe colour is derived from the founder's spectral RGB.

TechTree: Directed graph of Gödel-encoded inventions. Each new node connects to the nearest existing node by Gödel distance. Global tech multiplier:

$$B_{\text{tech}}(t+1) = \min(3.0,; B_{\text{tech}}(t) \times 1.003)$$

Diplomacy logic:

  • $0.5 &lt; P_A / P_B &lt; 2.0$ and random $&lt; 0.60$ → Alliance
  • $P_A/P_B &gt; 3.0$ or $P_A/P_B &lt; 0.33$ and random $&lt; 0.02$ → War (rare, extreme disparity only)
  • Epistemic distance $&gt; 48$ → Schism (alliance dissolution)

Singularity Override: any invention with $\mathcal{N} &gt; 0.55$ after 15+ tech nodes is automatically promoted to Breakthrough, ensuring advanced civilisations continue to recognise genuinely profound discoveries even when the running mean has risen.


4.6 evolution.py — Population Lifecycle Engine

Population bounds: initial 32, floor 28, ceiling 128.

Meta-fitness for immigration weighting (recomputed every 25 ticks):

$$f_{\text{meta}}(a) = \frac{\text{discoveries}(a)}{\text{age}(a)} \cdot 100 \cdot \sigma_{\text{meta}}(a) \cdot \left(1 + 0.5 \cdot n_{\text{meta-inv}}(a)\right)$$

Immigrants inherit a 40% blend of the most meta-fit agent's $H_{\text{meta}}$ with heavy mutation noise — introducing diverse cognitive templates.

Cultural Ratchet Verification (every 16 ticks): Pearson correlation of action-frequency profiles between founding generation (gen 0) and descendant generations:

$$r_{\text{cultural}} = \text{corr}!\left(\bar{\mathbf{a}}^{(0)},; \bar{\mathbf{a}}^{(>0)}\right)$$

Tradition is verified when $r_{\text{cultural}} &gt; 0.55$.

Behavioral Clustering (every 15 ticks): KMeans-style assignment of agents to 4 archetypes (Explorer, Builder, Fighter, Thinker) based on the first 4 task-band eigenvalues.

Phylogenetic Tracking (every 10 ticks): greedy clade clustering by meta-eigenspectrum $L^2$ distance with threshold 2.5. History of clade counts is maintained for evolutionary dynamics analysis.


4.7 GeNEsIsIV.py — Streamlit Frontend

11 live-updating tabs:

Tab Contents
🌍 WORLD MAP Toroidal resource heatmap + agent scatter with hover details, population/energy dual-axis sparklines
🧬 AGENTS BioHyperAgent census, sortable by 9 metrics, mode donut, emotion bar, action heatmap
🏛 CIVILIZATION Tribe leaderboard + power bar, diplomacy pie, discovery comparison, civ events
💡 TECH TREE Interactive Gödel graph, category breakdown, latest discoveries, global tech multiplier
📊 ANALYTICS Population/energy/inventions/meta-inventions/novelty sparklines, age/energy/eigenspread histograms, curiosity×wonder scatter, generation bar
🔬 HRC BRAIN Per-agent: ψ amplitude, $H$ eigenspectrum, soul frequencies, emotional state, Hamiltonian heatmap, episodic memory trace, personal discoveries (Gödel programs), meta-H eigenspectrum
📡 EVENTS FEED Civ events + world physics events + event type distribution
🗺 RESOURCES 4-layer heatmaps, world-wide supply bar, artifact breakdown
🧠 META-MIND Tribal epistemic identities, cognitive clade distribution, novelty index, Cambrian events, top breakthroughs
🔬 KNOWLEDGE Knowledge field heatmap, global memory spectral imprint, tribal memory matrices, eigenspread histogram, artifact interference map
🧬 v3.0 EMERGENCE All 30 v3.0 features: Cultural Replicator (spectral composite + Infinite Stigmergy Garden), pheromone grid, Kuramoto phase circle, Φ distribution, role/caste, social economy, cultural ratchet, behavioral archetypes, structures map, active inference, GoL scratchpad, DNA export

Universe Cryo-Chamber: complete simulation state serialised to JSON (with custom QuantumEncoder for NumPy complex arrays), then compressed with LZMA inside a ZIP archive. Complex ndarrays are encoded as {real: [...], imag: [...]} for exact float64 fidelity. Restoration via thaw_universe().


5. Emergent Phenomena Catalogue

The following behaviours are not scripted — they arise from the mathematics alone:

Phenomenon Mechanism
Tribal formation Spectral resonance clustering → agents with compatible $H$ eigenspectra self-organise
Cultural diffusion Artifact absorption + wave-state blending → knowledge spreads horizontally
Tech acceleration Each invention raises global bonus by 0.3%, compounding exponentially
Epistemic schisms Allied tribes that diverge in meta-$H$ eigenspace spontaneously fracture
Cambrian explosions Rolling novelty std spikes signal punctuated equilibrium in invention space
Cognitive clades Meta-eigenspectrum similarity clusters agents into phylogenetic lineages
Strange consciousness High-wonder agents enter Gödelian fixed points, boosting their IIT Φ
Apoptotic wisdom transfer Dying agents broadcast spectral fingerprints — neighbours absorb their knowledge
Stigmergic trails Pheromone deposits guide movement without any central coordination
Collective weather Average agent wonder votes shift weather amplitude for all
Eusociality Fertile Queens, Warrior castes, Forager workers emerge from caste genes
Viral gene transfer Fit agents broadcast $H$ eigenvalue packets that blend into recipients' world models
Intelligence pacifism Agents with $\Phi &gt; 0.005$ or $\geq 2$ inventions suppress DOMINATE mode
Tradition verification Pearson correlation $r &gt; 0.55$ between founder and descendant action profiles
Cooperative mega-harvest MegaResources require $\geq 2$ co-located agents to unlock — forcing cooperation

6. v3.0 Features — Complete List

All 30 features ported from GeNeSIS / Thermodynamic-Mind branch.

Cognition:

  1. IIT Integrated Information Φ with verified consciousness threshold
  2. Active Inference — free energy minimisation and prediction error tracking
  3. Gödelian Strange Loops — self-referential ψ perturbation
  4. Qualia Memory — neural correlates of experience
  5. Theory of Mind — level-1 and level-2 predictive models of others
  6. Landauer Cognitive Cost — thermodynamic price of learning
  7. Epigenetic ψ Inheritance — wave-function blending across generations
  8. IQ Complexity Bonus — ψ diversity incentive

Social-Economic: 9. Inventory Economy — Red/Green/Blue tokens with synergy bonus 10. Trade Action — information economy with massive trust/affection synergy 11. Punish Action — costly altruistic punishment of defectors 12. Role/Caste System — Forager, Processor, Warrior, Queen 13. Eusociality — fertility gating at high population 14. Social Trust Memory — persistent per-partner trust scores 15. Causal Bayesian Model — P(reward | do(action)) intervention tracking

World Physics: 16. PhysicsOracle — frozen PyTorch NN defining discoverable laws of physics 17. 16-channel Pheromone Grid — 8-channel stigmergic chemical signalling 18. 8-channel Meme Grid — stigmergic cultural memory (Danger/Resource/Sacred/…) 19. Seasonal Dynamics — Summer/Winter cycle, resource modulation 20. Weather Control — collective agent votes shift weather amplitude 21. Social Bonds + Metabolic Osmosis — kinship-modulated energy equalisation 22. Structure System — Trap, Battery, Cultivator functional world objects 23. MegaResource — cooperative harvest requiring multiple co-located agents 24. Adaptive Resource Spawn — inversely proportional to population density

Agent Biology: 25. Kuramoto Phase Synchronisation — per-agent oscillatory phase with order parameter 26. Circadian Internal Phase — synchronisation with environment phase 27. GoL Scratchpad — Conway's Game of Life as Turing-complete internal computation 28. Viral Gene Transfer — H-eigenvalue meme packets between nearby agents 29. Apoptotic Death Packets — broadcast spectral fingerprint + causal model on death

Civilisation: 30. Tribal Meta-H — shared epistemic identity and cultural assimilation


7. Running the Simulation

Prerequisites

python >= 3.10
streamlit >= 1.35
numpy >= 1.26
torch >= 2.2
plotly >= 5.20
pandas >= 2.0
scipy >= 1.12

Installation

git clone https://github.com/Devanik21/GeNeSIS-IV.git
cd GeNeSIS-IV
pip install -r requirements.txt

Launch

streamlit run GeNEsIsIV.py

The simulation boots with a 60×60 toroidal world, 32 initial agents, seed 42. Use the sidebar to step manually (×1, ×10, ×50) or enable auto-run.

Controls

Control Effect
▶ ×1 / ×10 / ×50 Step the simulation
⚡ Auto-run Continuous simulation at configured speed
Steps/frame slider 1–30 steps per auto-run frame
📦 Freeze & Backup Export universe state as LZMA-compressed JSON zip
Upload Timeline Restore a previously frozen universe
🔄 Full Reset Clear all state and reinitialise
⚙ Config Change world size and random seed

File Structure

GeNeSIS-IV/
├── GeNEsIsIV.py        # Streamlit app (frontend)
├── consciousness.py    # HRC v3.0 — wave-based cognition
├── metacognition.py    # Meta-cognitive engine + Gödel encoder
├── agents.py           # BioHyperAgent v3.0
├── world.py            # World physics v3.0
├── civilization.py     # Civilisation dynamics
├── evolution.py        # Population lifecycle engine
└── requirements.txt

8. Technical Stack & Dependencies

Component Technology Purpose
Numerical core NumPy 1.26+ All Hilbert space operations, eigendecomposition
Physics Oracle PyTorch 2.2+ (CPU) Frozen 3-layer NN defining world physics
Visualisation Plotly 5.20+ All charts, heatmaps, scatter plots
Frontend Streamlit 1.35+ Live dashboard with 11 tab panels
Data Pandas 2.0+ Agent census and DataFrame operations
Diffusion SciPy 1.12+ (ndimage) Gaussian bloom in Cultural Replicator
Serialisation stdlib json, zipfile, lzma Universe freeze/thaw

No LLMs, no external APIs, no pre-trained embeddings. All intelligence is synthetic, emergent, and mathematically grounded.


9. Project Lineage

GeNeSIS IV is the fourth major iteration of the Spectral Life research programme:

Version Key Innovation
GeNeSIS I Harmonic Resonance Forest kernel — wave-interference classification
GeNeSIS II HRC brain — Hermitian Hamiltonians for agent cognition
GeNeSIS III Gödel-encoded inventions, tribal civilisations, metacognitive meta-H
GeNeSIS IV HyperAgent dual-band, IIT Φ, Active Inference, Strange Loops, 30 v3.0 features

The HRC architecture descends from the Harmonic Resonance Forest (HRF) — a physics-informed classification model achieving 98.84% on the OpenML EEG Eye State benchmark — and the HAG-MoE (Hierarchical Attention-Gated Mixture of Experts) architecture, extended here into a living agent substrate.

The dual-band task/meta architecture is inspired by Meta FAIR HyperAgents (arXiv:2603.19461), which demonstrated that a single editable program can serve as both task agent and meta-learning agent simultaneously.


HyPER AgEnT v3.0 · K_DIM=64 · 128 Agents Max · 30 GeNeSIS Features

Metacognitive Self-Modification · Stigmergy · Pheromones · Gödel-Encoded Inventions · Zero LLM

Devanik Debnath · NIT Agartala · Apache-2.0 · 2026

About

Genesis-IV: A K=64 Hilbert-space AGI architecture. Features Zero-Entropy state-space preservation via LZMA-compressed quantum tensors; Schrödinger-driven HRC with Landauer metabolic cost; and self-modifying meta-Hamiltonians.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages