Skip to content

feat: IonModeBasis GT3b producer payload - #4

Merged
uwarring82 merged 1 commit into
mainfrom
feature/gt3b-ion-mode-basis
Jul 15, 2026
Merged

feat: IonModeBasis GT3b producer payload#4
uwarring82 merged 1 commit into
mainfrom
feature/gt3b-ion-mode-basis

Conversation

@uwarring82

Copy link
Copy Markdown
Owner

Summary

Producer half of the ratified cross-repo GT3b handshake with iontrap-dynamics (taskcards/TC-ion-mode-basis-payload.md). Emits a versioned, serialization-neutral IonModeBasis payload that the sibling's materialize_ion_mode_basis(...) validates and turns into its normal→local symplectic map S. This repo stays classical structural dynamics — no phase-space / S-builder math here.

What's included

  • IonModeBasis record + ion_mode_basis(...) emitter (mode_basis.py), pure-functions-over-frozen-records style.
  • Wire invariants fixed explicitly: ion-major/axis-minor B (3N,3N) with B[3i+c,m]=eigenvectors[m,i,c], coordinate_frame emitted as the consumer's canonical identifier (exact-match on the consumer side), frequency↔column alignment, and sign-canonicalised eigenvectors (largest-|component| positive) for reproducibility.
  • D3 local-reference gauges: trap_curvature (default) and diagonal_hessian, recorded in tags.
  • Serialization-neutral asdict()/as_arrays() returning detached array copies + primitive tags (no shared runtime class).
  • Producer positivity/finiteness guard so ω>0 holds even for a hand-built/critical ModeResult.
  • Contract test + a guarded real-consumer round-trip test (pytest.importorskip) that drives materialize_ion_mode_basis(**payload.asdict()).
  • Docs (api.md), CHANGELOG.md, docs/LOG.md updated.

Verification

  • ruff check ., mypy, mkdocs build --strict all clean; contract suite green.
  • End-to-end against the real iontrap-dynamics consumer (equal-mass, mixed-species, both gauges, N=2/3/5): materialises, retains tags, built S symplectic to |SΩSᵀ−Ω| ≤ 1.6e-15.

Notes

  • schema_version = 1 is provisional pending consumer ratification (tracked in docs/LOG.md).
  • The legacy to_mode_configs() per-mode seam is unchanged and is not the GT3b handshake.

🤖 Generated with Claude Code

- Add IonModeBasis frozen record + ion_mode_basis(...) emitter
- Wire invariants: ion-major/axis-minor B, canonical coordinate_frame id,
  frequency↔column alignment, sign-canonicalised eigenvectors
- D3 local-reference gauges: trap_curvature (default) and diagonal_hessian
- Serialization-neutral asdict()/as_arrays() with detached array copies
- Contract tests + guarded real-consumer round-trip test
- Docs/api/CHANGELOG/LOG updates

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@uwarring82
uwarring82 merged commit 272ba17 into main Jul 15, 2026
5 of 7 checks passed
@uwarring82
uwarring82 deleted the feature/gt3b-ion-mode-basis branch July 15, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant