Skip to content

[WIP] Add automated dispersion check to ohm_solver_em_modes analysis - #7060

Open
RemiLehe wants to merge 1 commit into
BLAST-WarpX:developmentfrom
RemiLehe:em_modes_dispersion_check
Open

[WIP] Add automated dispersion check to ohm_solver_em_modes analysis#7060
RemiLehe wants to merge 1 commit into
BLAST-WarpX:developmentfrom
RemiLehe:em_modes_dispersion_check

Conversation

@RemiLehe

Copy link
Copy Markdown
Member

The parallel EM-modes (Alfven/whistler) analysis previously only produced a (k, omega) spectrum plot with the analytic R/L dispersion curves overlaid, requiring a human to visually confirm the physics. The only automated CI gate was the checksum regression, which validates reproducibility but not correctness of the dispersion relation.

This adds check_parallel_dispersion(), which quantitatively verifies that, for the B_dir='z' case, spectral power peaks along the analytic R-mode dispersion (k l_i)^2 = (w/w_ci)^2 / (1 + w/w_ci) in the positive-frequency / positive-wavenumber quadrant (where the right-hand polarized component lives). It asserts on the median relative error in k, the fraction of frequency bands on the curve, and the peak signal-to-noise ratio.

Validated on a local 1D run: median relative error 0.02, all bands within 15%, median SNR ~500 (well inside tolerances), while a phase-scrambled null spectrum correctly fails. The spectrum plot is still produced unchanged.

The parallel EM-modes (Alfven/whistler) analysis previously only produced
a (k, omega) spectrum plot with the analytic R/L dispersion curves overlaid,
requiring a human to visually confirm the physics. The only automated CI
gate was the checksum regression, which validates reproducibility but not
correctness of the dispersion relation.

This adds check_parallel_dispersion(), which quantitatively verifies that,
for the B_dir='z' case, spectral power peaks along the analytic R-mode
dispersion (k l_i)^2 = (w/w_ci)^2 / (1 + w/w_ci) in the positive-frequency /
positive-wavenumber quadrant (where the right-hand polarized component lives).
It asserts on the median relative error in k, the fraction of frequency bands
on the curve, and the peak signal-to-noise ratio.

Validated on a local 1D run: median relative error 0.02, all bands within
15%, median SNR ~500 (well inside tolerances), while a phase-scrambled null
spectrum correctly fails. The spectrum plot is still produced unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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