# REPRODUCE — E4-H034

## Environment

- Python 3.12
- numpy (only dependency)
- Interpreter used: `/home/toby/Desktop/300 study 1/04_SUPPORTING/.venv/bin/python`

## Run

```bash
cd Incoprea_E4_H034_2026-11-01/code
python3 h034_theory_and_protocol.py
```

Runtime: under 2 seconds.

## Outputs

| File | Contents |
|---|---|
| `results/h034_results.csv` | 16 rows: P1 (12) and P2 (4) |
| `results/h034_run_log.txt` | full console output of the reported run |

## Determinism

Fully deterministic: `np.random.default_rng(20261101)` seeds both the synthetic generator and the
random split.

## Expected values (spot checks)

- P1 at `P = 3, R_c = 4`: `E_out = 101.25 meV`, ratio 1.000.
- P1 at `P = 3, R_c = 8`: `E_out = 12.66 meV`, ratio 0.125 (exactly `(4/8)³`).
- P2 signal/grouped: RMSE 0.979 → 0.931, improvement **0.048**.
- P2 null/grouped: RMSE 0.856 → 0.924, improvement **−0.068**.

If P2's null/grouped improvement comes out strongly positive, the grouped split is leaking and the
demonstration is invalid.

## What cannot be reproduced

**The empirical test.** There is no data to re-run it on. This file documents how to reproduce the
derivation and the protocol demonstration only.

## Running the protocol on real data

`p2_protocol()` in the script takes a list of per-configuration dicts. To apply it to a real dataset,
supply dicts with the keys `material, size, coord, e_el` and a target vector `y`; the four-model
comparison and the grouped CV run unchanged. `e_el` would be computed from the true

    E_out = P²/(3 κ R_c³)

rather than from the synthetic generator.
