# Noise Phase I: identifying the cause of a drifting qubit frequency (synthetic)

This folder holds synthetic tests of single-qubit frequency drift. Can the hidden mechanism behind the drift be identified from interleaved Ramsey counts? Does identifying it improve the correction? And how much room is left for a better estimator? The work was done on 15–16 November 2026, and this README was added on 23 November 2026 after an audit.

**Evidence label: synthetic observation only.** Every mechanism, parameter and count is simulated. No hardware job was run, and nothing here is a measured property of any processor.

## Status (23 November 2026)

| Study | Protocol, frozen before its test seeds | Results | Outcome |
|---|---|---|---|
| Phase I: a bank of drift models against standard trackers | `PROTOCOL.md` (commit `b2a9d27`) | `RESULTS.md` | H1, H2, H3 and H6 passed. H4 was mixed. H5 (residual tests find the out-of-bank sinusoid) failed, as the protocol expected |
| Time ladder: Allan-variance shape across averaging windows | `TIMELADDER_PROTOCOL.md` (v1 `bde71a6`, v2 `938df3a`) | `TIMELADDER.md` | On fresh seeds v2 caught 94 of 96 sinusoids, with in-bank false alarms ≤ 4 of 96. The reach test (TL3) failed in both versions |
| Loops: repeated records to widen the ladder's reach | `LOOPS_PROTOCOL.md` (`a7b0b3d`) | `LOOPS.md` | LC1–LC3 all passed |
| Standard spectral baseline (post hoc, **not pre-registered**) | none | addendum in `RESULTS.md` | caught 46 of 48 Phase I sinusoids and 90–91 of 96 on fresh seeds |

What is known prior work, as the result files themselves say:
- The bank is standard Bayesian multiple-model filtering.
- The ladder uses the overlapping Allan variance.
- The loops are synchronous averaging and recording for longer.
- The periodogram test is textbook.

No novelty is claimed for any method here.

**Corrections from the 23 November audit**, all dated in place:
- Phase I's "generic diagnostics do not find the sinusoid" is narrowed to the two residual tests actually run. A standard periodogram test finds it.
- The time ladder's 48 of 48 is on Phase I trials that version 1 had already been scored on. The clean figure is the fresh-seed 94 of 96.

## Documents that are cited but absent

The frozen `PROTOCOL.md` cites three documents that are **not in this repository**:
- `D0RE_AI_READ_FIRST_2026-11-15.md`, the briefing the run started from;
- `docs/NOISE_CAUSAL_IDENTIFICATION_PLAN.md`;
- `PROJECT_SCIENTIFIC_STATUS.md`.

It also mentions an archived "Existing Hardware Noise Benchmark v0.1" that was not available either. `briefing_checks.py` re-derives numbers quoted in that absent briefing. Most of them (a lattice loop coefficient, an anisotropy, state counts, an H/D line ratio) have nothing to do with this noise study, and they cannot be checked against the briefing from here. The protocol is frozen, so it was left unchanged.

## File map

| Files | Role |
|---|---|
| `PROTOCOL.md` | Phase I frozen protocol (do not edit) |
| `phase1.py` | Phase I simulator, estimators and hypothesis checks: `--selfcheck`, `--dev`, `--test` |
| `results.json`, `run_test.log` | Phase I test output (the log is the standard output of `phase1.py --selfcheck && phase1.py --test`) |
| `RESULTS.md`, `figure.svg`, `plot.py` | Phase I results, figure, and the script that draws it |
| `limit_check.py`, `limit_check.log` | Cramér–Rao and cost checks |
| `briefing_checks.py` | re-derives numbers from the absent briefing (see above) |
| `TIMELADDER_PROTOCOL.md` | time-ladder frozen protocol, v1 and v2 (do not edit) |
| `timeladder.py` | time ladder: `--dev`, `--test`, `--dev2`, `--test2` |
| `timeladder_rule.json`, `timeladder_rule_v2.json` | rules frozen before the tests |
| `timeladder_dev*.log`, `timeladder_test*.log`, `timeladder_results*.json` | development and test outputs |
| `TIMELADDER.md`, `timeladder.svg` | time-ladder results |
| `LOOPS_PROTOCOL.md` | loops frozen protocol (do not edit) |
| `loops.py`, `loops_dev.log`, `loops_test.log`, `loops_results.json` | loops script and outputs |
| `LOOPS.md`, `loops.svg` | loops results |
| `periodogram_baseline.py`, `periodogram_baseline.json`, `periodogram_baseline.log` | post-hoc spectral baseline, added 23 November 2026 |

`../operational-math/grounded.py` checks the frozen-before-results git order of `results.json`, `timeladder_results*.json` and `loops_results.json`. Keep those file names and paths.

## How to run

Python 3.13 and numpy; nothing else.

```sh
python3 phase1.py --selfcheck            # invariants
python3 phase1.py --test                 # 288 trials on 4 cores; rewrites results.json
python3 plot.py                          # figure.svg
python3 limit_check.py                   # limit and cost checks
python3 timeladder.py --test             # version 1
python3 timeladder.py --test2            # version 2
python3 loops.py --test                  # loops
python3 periodogram_baseline.py          # post-hoc spectral baseline
python3 briefing_checks.py               # numbers from the absent briefing
```

Each test reruns deterministically from its seeds. In the 23 November audit, `results.json`, `timeladder_results.json`, `timeladder_results_v2.json` and `loops_results.json` were regenerated identical to the committed files.

## Limits

- One simulated qubit with pure detuning. Contrast and readout are known and constant.
- The thresholds were set by the author after seeing development seeds. The freezes are verifiable from git order only, and no independent party has rerun the tests.
- A pass here licenses Phase II, real timestamped data, and nothing more.
