# Magic Phone Phase-Lock Simulator — Audited v1.1

A reproducible mathematical toy model for Ryan Hall's “Magic Phone” / HIRM black-hole information hypothesis.

> **Scientific boundary:** this is not a quantum-gravity or numerical-relativity simulator. It is a hypothesis-development sandbox. Its value is in making assumptions explicit, enforcing internal conservation, generating null tests, and exposing where the metaphor still needs a physical derivation.

## What v1.1 models

Each accreted ring is a two-component complex state

`|ψ⟩ = [cos(θ/2), exp(iφ) sin(θ/2)]`

with energy, angular momentum, radius, handedness, natural frequency, and a local interaction graph. Phases evolve through a noisy local Kuramoto-like equation rather than being classified from independent random drift.

Persistent local opposition can phase-pin rings, but locks are reversible. Right-angle “turns” accumulate correctly. Actual graph triangles carry the gauge-invariant Bargmann loop phase

`γ = arg(⟨1|2⟩⟨2|3⟩⟨3|1⟩)`

and the current HIRM loop burden

`g(γ) = 1/2 sin²γ`.

A target loop magnitude of `|γ| = 1.1518 rad` is tracked with both chiral signs. The simulator does **not** treat the sign as determined by pairwise fidelities; it remains the mirror-orientation ambiguity identified in the three-state audit.

## Ledger and release

The ledger separately tracks:

- active mass and angular momentum;
- input code bits, active code bits, and radiation code bits;
- constrained entropy and a Page-entropy proxy;
- exact information-balance error;
- Kerr-like `a*`, outer horizon, area/entropy, temperature, and `A·T⁴` power proxies in geometric units.

A release removes one complete ring from the active ledger and transfers its code bits to radiation. The release hazard has an explicit `1/M²` baseline, then is modulated by LuxG phase alignment and local burden. This is a chosen effective rule, not a derivation of Hawking radiation.

## Why this is better than v1.0

- Locks no longer freeze nearly the whole population by construction.
- “20% release” no longer deletes 100% of a ring on the following refresh.
- Locked phases continue evolving and can unlock.
- Interactions are local/graph-based instead of all-to-all `O(N²)` classification.
- Triangle phase is gauge invariant; an absolute sum of node phases is no longer called loop closure.
- Scalar U(1) phases were replaced by complex states so a nontrivial Bargmann loop phase can exist.
- The Page proxy and information ledger are explicit and exactly balanced.
- Tests cover gauge invariance, locality, handedness, unlocking, conservation, and prevention of default total freeze.

## Run

```bash
pip install -r requirements.txt
python run_demo.py --seed 42 --steps 150 --accretion 60 --release-scale 100
pytest
```

Outputs include the original state/network plots plus:

- `page_curve_proxy.png`
- `loop_phase_histogram.png`
- expanded `simulation_metrics.csv`

See `AUDIT.md` for the remaining scientific gaps and next gates.
