Physics validation¶
MHX validation tests have explicit physics gates, not just smoke-run assertions. The suite starts from exact resistive diffusion of a single Fourier mode and now includes Harris tearing eigenvalue checks, nonlinear energy-budget identities, duration guards, Orszag–Tang morphology, decaying turbulence, forced turbulent-reconnection media with a validation-only readiness gate, double-Harris promotion/convergence evidence, seed-QI, neural-ODE reproducibility, and restartable campaign-executor artifacts.
Exact resistive decay¶
With zero flow and one flux mode,
the reduced-MHD flux equation collapses to
The exact solution is
and magnetic energy must decay as
These gates test the spectral Laplacian sign convention, RK4 time stepping, mode diagnostics, energy diagnostics, output files, and plotting path.
Run the validation:
mhx benchmark decay --outdir outputs/benchmarks/resistive_decay
Expected files:
outputs/benchmarks/resistive_decay/diagnostics.jsonoutputs/benchmarks/resistive_decay/validation.jsonoutputs/benchmarks/resistive_decay/decay_history.npzoutputs/benchmarks/resistive_decay/figures/decay_amplitude.pngoutputs/benchmarks/resistive_decay/figures/decay_energy.pngoutputs/benchmarks/resistive_decay/figures/decay_relative_error.png
Regenerate the documentation figures:
python examples/make_validation_media.py
Run every active FAST validation gate and write a single reviewer-facing summary:
mhx validate all --outdir outputs/validation_suite
The suite writes validation_suite.json, validation_suite.md,
artifact_manifest.json, and one subdirectory per validation case.
Nonlinear Orszag–Tang reduced-MHD gate¶
MHX includes a solver-generated nonlinear Orszag–Tang validation case:
mhx benchmark orszag-tang --outdir outputs/benchmarks/orszag_tang_vortex --movies
The initial condition adapts the classic Orszag–Tang two-dimensional MHD vortex to the incompressible reduced-MHD variables:
giving
The validation checks finite fields, monotone resistive-viscous energy decay, net dissipation, high-wavenumber growth in current density and vorticity, and spectral preservation of \(\nabla\cdot\mathbf{B}_\perp=0\). This is not a compressible full-MHD shock benchmark; it is the nonlinear reduced-MHD example used by the README media and extension tutorials.
Expected files:
outputs/benchmarks/orszag_tang_vortex/diagnostics.jsonoutputs/benchmarks/orszag_tang_vortex/validation.jsonoutputs/benchmarks/orszag_tang_vortex/orszag_tang_vortex.npzoutputs/benchmarks/orszag_tang_vortex/figures/orszag_tang_summary.pngoutputs/benchmarks/orszag_tang_vortex/figures/orszag_tang_current.gifoutputs/benchmarks/orszag_tang_vortex/figures/orszag_tang_vorticity.gif
Decaying turbulence and forced turbulent reconnection¶
The turbulence validations exercise nonlinear advection, current-sheet formation, and reconnection-proxy diagnostics without claiming converged turbulent reconnection rates. The reduced-MHD equations remain
where the decaying case sets \(F_\omega=0\) and the forced current-sheet case uses a weak deterministic large-scale vorticity forcing. The decaying gate checks finite arrays, total-energy decay, current amplification, and high-\(k\) transfer. The forced gate checks finite arrays, bounded injected energy, current amplification, and a reconnection proxy built from X/O critical-point flux separation when available, with a documented max-min flux fallback.
Run the validations:
mhx benchmark decaying-turbulence --outdir outputs/benchmarks/decaying_mhd_turbulence --movies
mhx benchmark forced-turbulent-reconnection --outdir outputs/benchmarks/forced_turbulent_reconnection --movies
mhx benchmark forced-turbulent-reconnection-readiness-check outputs/benchmarks/forced_turbulent_reconnection
Expected files:
outputs/benchmarks/decaying_mhd_turbulence/decaying_mhd_turbulence.npzoutputs/benchmarks/decaying_mhd_turbulence/figures/decaying_mhd_turbulence_summary.pngoutputs/benchmarks/forced_turbulent_reconnection/forced_turbulent_reconnection.npzoutputs/benchmarks/forced_turbulent_reconnection/figures/forced_turbulent_reconnection_summary.pngoutputs/benchmarks/forced_turbulent_reconnection/readiness/promotion_readiness.jsonoutputs/benchmarks/forced_turbulent_reconnection/readiness/figures/promotion_matrix.pngoptional flux/current GIFs under each
figures/directory
The readiness matrix is a validation-only claim boundary for the forced current-sheet replay. It requires finite histories, enough saved samples, minimum duration, nontrivial reconnecting-flux or reconnection-rate proxy, bounded total-energy growth, and the expected summary/movie artifacts.

These examples are literature-anchored to 2-D MHD turbulence and turbulent-reconnection studies, including the current-sheet/turbulence diagnostic tradition used by Servidio and collaborators and the broader Lazarian–Vishniac picture of turbulence-assisted reconnection. The current MHX examples are pedagogical 2-D reduced-MHD validation artifacts, not 3-D fast-reconnection production evidence.
Source links:
Validation figures¶
The numerical mode amplitude is visually indistinguishable from \(A_0\exp(-\eta |k|^2t)\) at FAST settings.

The magnetic energy follows the required \(E_B(0)\exp(-2\eta |k|^2t)\) law.

The relative-error plot is the reviewer-facing numerical gate. The corresponding unit test fails if amplitude, energy, fitted rate, monotonicity, or final-field L2 gates exceed documented tolerances.

Literature anchors¶
The exact-decay test is deliberately simpler than a tearing eigenvalue problem, but it validates the finite-resistivity induction term used in classical resistive-MHD reconnection theory. The benchmark roadmap then builds toward the FKR tearing mode, plasmoid instability scalings, and ideal-tearing regimes. For broader reconnection context, see Biskamp’s Magnetic Reconnection in Plasmas and the MHX literature page.
Source links¶
Seed-robust QI validation¶
MHX now includes a FAST seed-robust quality-indicator lane. It adds tiny
smooth, zero-mean perturbations to the reduced-MHD tearing initial condition and
gates whether gamma_fit, final energies, and spectral magnetic-divergence
diagnostics are stable across the seed ensemble.
The CLI command is:
mhx benchmark seed-robust-qi --outdir outputs/benchmarks/seed_robust_qi
The manifest is claim_level = "validation". This supports only local FAST
metric-sensitivity claims, not turbulent ensemble uncertainty quantification or
production plasmoid statistics.
Source anchors:
Reconnection scaling gates¶
The next validation layer checks that MHX’s analytic benchmark scaffolds encode the literature exponents that future numerical benchmarks must recover.
For constant-\(\psi\) FKR tearing, using the Harris-sheet proxy
MHX gates the order-unity-coefficient-free scalings

For a Sweet-Parker current sheet, the Loureiro–Schekochihin–Cowley plasmoid theory predicts

For ideal tearing, MHX checks the Pucci–Velli aspect-ratio scaling

Run the scaling gates:
mhx benchmark scaling --outdir outputs/benchmarks/reconnection_scaling
Expected files:
outputs/benchmarks/reconnection_scaling/diagnostics.jsonoutputs/benchmarks/reconnection_scaling/validation.jsonoutputs/benchmarks/reconnection_scaling/scaling_history.npzoutputs/benchmarks/reconnection_scaling/figures/fkr_scaling.pngoutputs/benchmarks/reconnection_scaling/figures/plasmoid_scaling.pngoutputs/benchmarks/reconnection_scaling/figures/ideal_tearing_scaling.png
These gates do not prove the PDE solver has recovered FKR or plasmoid growth. They make the expected exponents explicit, tested, plotted, and reviewable so that future eigenmode and nonlinear-current-sheet benchmarks have fixed targets.
FKR constant-psi regime window¶
The FKR estimate is only appropriate in a restricted asymptotic window. MHX now ships a separate analytic gate that samples wavenumbers at fixed local Lundquist number and checks:
The last condition is the constant-\(\psi\) gate; large values move toward the Coppi large-\(\Delta'\) regime and should not be judged against the FKR constant-\(\psi\) scaling.
mhx benchmark fkr-window --outdir outputs/benchmarks/fkr_window
Expected files:
outputs/benchmarks/fkr_window/diagnostics.jsonoutputs/benchmarks/fkr_window/validation.jsonoutputs/benchmarks/fkr_window/fkr_window.npzoutputs/benchmarks/fkr_window/figures/fkr_constant_psi_window.png

FKR growth-rate gate¶
The next layer converts the numerically recovered Harris outer-region \(\Delta'a\) into the FKR constant-\(\psi\) growth-rate estimate. MHX gates
at fixed \(ka\) and
at fixed \(S_a\). The \(\Delta'a\) values used in the second scan come from the same backward-integration outer solve used by the Harris Delta-prime gate, so the benchmark now checks propagation from numerical outer matching into the growth-rate assembly.
mhx benchmark fkr-growth --outdir outputs/benchmarks/fkr_growth_rate
Expected files:
outputs/benchmarks/fkr_growth_rate/diagnostics.jsonoutputs/benchmarks/fkr_growth_rate/validation.jsonoutputs/benchmarks/fkr_growth_rate/fkr_growth_rate.npzoutputs/benchmarks/fkr_growth_rate/figures/fkr_growth_rate.png

This is still an asymptotic growth-rate assembly gate, not a full resistive inner-layer or global eigenvalue solve. The direct eigenvalue gate below closes one targeted part of that gap for a published Harris-sheet test case; broader FKR/Coppi scans still require a documented asymptotic-resolution study.
Harris-sheet Delta-prime gate¶
The first numerical tearing-specific validation is the Harris-sheet ideal outer equation. With
the zero-inertia outer equation for the tearing-parity flux eigenfunction is
The decaying solution on each side of the sheet gives the FKR matching parameter
MHX now integrates this outer ODE numerically from large positive \(\xi\) back to the resonant surface and gates the recovered \(\Delta'a\) against the analytic formula. This is more substantial than plotting the formula, but it still is not the full resistive inner-layer eigenvalue solve.
mhx benchmark harris-delta-prime --outdir outputs/benchmarks/harris_delta_prime
Expected files:
outputs/benchmarks/harris_delta_prime/diagnostics.jsonoutputs/benchmarks/harris_delta_prime/validation.jsonoutputs/benchmarks/harris_delta_prime/harris_delta_prime.npzoutputs/benchmarks/harris_delta_prime/figures/harris_delta_prime.png

Direct Harris-sheet tearing eigenvalue gate¶
MHX now includes a direct 1D linear tearing eigenproblem benchmark anchored to published reduced-MHD calculations. For a Harris sheet,
normal-mode perturbations proportional to \(\exp(iky+\sigma t)\) satisfy the inviscid linear reduced-MHD system
The benchmark uses conducting/no-slip perturbation boundaries,
with \(S=1000\), \(ka=0.5\), and \(d/a=10\). It solves the dense finite-difference operator on three grids, extrapolates the growth rate linearly in \(\Delta x^2\), and gates against the published tearing eigenvalue \(\gamma\simeq0.0131\). Additional gates check that the selected eigenvalue is real and positive, the dense eigenpair residual is small, grid refinement decreases the finite-grid growth rate, and the selected mode has tearing parity: \(b(x)=b(-x)\) with odd stream-function perturbation. A stable-control solve at \(ka=1.2\) checks the same operator has no positive-growth eigenvalue outside the tearing-unstable \(0<ka<1\) interval.
Run the gate:
mhx benchmark linear-tearing-eigenvalue \
--outdir outputs/benchmarks/linear_tearing_eigenvalue
Expected files:
outputs/benchmarks/linear_tearing_eigenvalue/diagnostics.jsonoutputs/benchmarks/linear_tearing_eigenvalue/validation.jsonoutputs/benchmarks/linear_tearing_eigenvalue/linear_tearing_eigenvalue.npzoutputs/benchmarks/linear_tearing_eigenvalue/figures/linear_tearing_eigenvalue.png

This is a materially stronger tearing validation than the analytic scaling and outer-region gates, but it is still a single reference eigenproblem. It does not yet establish production nonlinear reconnection fidelity, Coppi-regime dispersion curves, or plasmoid dynamics.
Finite-domain tearing dispersion gate¶
The next validation layer repeats the same finite-difference eigenproblem over a small \(ka\) scan. This is deliberately a FAST finite-domain gate, not a production asymptotic scan. It checks:
plus dense eigenpair residuals and the same \(ka=0.5\) literature anchor used by the direct eigenvalue gate. The default samples are \(ka=(0.3,0.5,0.7,0.9,1.1,1.2)\) at \(S=1000\) and \(d/a=10\).
Run the scan:
mhx benchmark linear-tearing-dispersion \
--outdir outputs/benchmarks/linear_tearing_dispersion
Expected files:
outputs/benchmarks/linear_tearing_dispersion/diagnostics.jsonoutputs/benchmarks/linear_tearing_dispersion/validation.jsonoutputs/benchmarks/linear_tearing_dispersion/linear_tearing_dispersion.npzoutputs/benchmarks/linear_tearing_dispersion/figures/linear_tearing_dispersion.png

The scan is useful because it catches sign mistakes that a single unstable eigenvalue cannot: the code must recover an unstable tearing band below \(ka=1\) and stable oscillatory controls above \(ka=1\). The remaining research-grade target is a higher-resolution Lundquist-number sweep that separates constant-\(\psi\) FKR and large-\(\Delta'\) Coppi branches.
Harris eigenfunction layer gate¶
The direct eigenvalue and dispersion gates verify growth rates and residuals. They do not by themselves verify that the selected eigenfunction has the expected resonant-surface localization. MHX therefore adds a conservative FAST shape gate over a Lundquist-number scan. For each sampled \(S\), it solves the same Harris eigenproblem and measures half-maximum widths for:
The validation gates are deliberately qualitative:
where \(\Delta_u\) is the flow-layer half-width and \(\Delta_b\) is the outer flux half-width. The fitted slopes are recorded and checked only against broad FAST ranges. They should not be interpreted as production FKR/Coppi exponents.
mhx benchmark linear-tearing-layer \
--outdir outputs/benchmarks/linear_tearing_layer
Expected files:
outputs/benchmarks/linear_tearing_layer/diagnostics.jsonoutputs/benchmarks/linear_tearing_layer/validation.jsonoutputs/benchmarks/linear_tearing_layer/linear_tearing_layer.npzoutputs/benchmarks/linear_tearing_layer/figures/linear_tearing_layer.png

This gate is useful because it catches a different class of failure than a growth-rate check: an implementation can select a plausible eigenvalue while returning a poorly localized or mis-phased eigenfunction. The current gate confirms monotonic narrowing of the flow layer and stability of the outer flux envelope in the FAST scan.
Time-domain Harris eigenmode replay¶
A growth-rate diagnostic is only useful if it recovers the known rate from a time signal. MHX therefore reuses the same direct Harris-sheet operator \(L\) and selected eigenvector \(q_0\) from the eigenvalue gate, then integrates
For a pure eigenmode,
The benchmark advances the finite-dimensional system with RK4, fits \(\log\|q(t)\|_2\) over the configured window, and gates:
It also verifies that the final state remains aligned with the initial eigenvector. This closes the loop between eigenvalue calculation, time integration, and growth fitting. It is still a linear finite-domain replay; it does not claim nonlinear island growth or saturation.
mhx benchmark linear-tearing-timedomain \
--outdir outputs/benchmarks/linear_tearing_timedomain
Expected files:
outputs/benchmarks/linear_tearing_timedomain/diagnostics.jsonoutputs/benchmarks/linear_tearing_timedomain/validation.jsonoutputs/benchmarks/linear_tearing_timedomain/linear_tearing_timedomain.npzoutputs/benchmarks/linear_tearing_timedomain/figures/linear_tearing_timedomain.png

Matrix-free linearized RHS¶
Tearing eigenmode calculations require a linearized operator \(\mathcal{L}=\partial F/\partial q\) for the reduced-MHD state \(q=(\psi,\omega)\). MHX exposes this as a matrix-free Jacobian-vector product:
computed by JAX forward-mode automatic differentiation. The validation gate compares that JVP against the centered finite-difference approximation
mhx benchmark linearized-rhs --outdir outputs/benchmarks/linearized_rhs
Expected files:
outputs/benchmarks/linearized_rhs/diagnostics.jsonoutputs/benchmarks/linearized_rhs/validation.jsonoutputs/benchmarks/linearized_rhs/linearized_rhs.npzoutputs/benchmarks/linearized_rhs/figures/linearized_rhs_errors.png

Reduced-MHD linear eigenmode gate¶
At zero flux and zero flow, the reduced-MHD JVP operator decouples into two Fourier diffusion blocks:
For a periodic Fourier mode \(\sin(k_xx+k_yy)\), the expected eigenvalues are
This gate applies linearized_reduced_mhd_operator to flattened
\((\delta\psi,\delta\omega)\) vectors and checks Rayleigh quotients and
eigen-residuals for both blocks. It is the first physics-facing use of the full
flattened reduced-MHD linear operator; nonzero-equilibrium tearing eigenmodes
will build on this path.
mhx benchmark reduced-mhd-eigenmode --outdir outputs/benchmarks/reduced_mhd_eigenmode
Expected files:
outputs/benchmarks/reduced_mhd_eigenmode/diagnostics.jsonoutputs/benchmarks/reduced_mhd_eigenmode/validation.jsonoutputs/benchmarks/reduced_mhd_eigenmode/reduced_mhd_linear_eigenmode.npzoutputs/benchmarks/reduced_mhd_eigenmode/figures/reduced_mhd_linear_eigenmode_errors.png

Nonzero cosine-equilibrium linearization gate¶
This gate validates the linearized operator on a nonzero current-sheet equilibrium before the tearing eigenmode checks below. MHX uses the periodic equilibrium
and checks exact Poisson-bracket couplings for two perturbations.
First, a pure vorticity perturbation \(\delta\omega=\cos(k_xx)\) gives \(\delta\phi=-\cos(k_xx)/k_x^2\). The flux equation contains flow advection of the equilibrium field:
Second, a pure flux perturbation \(\delta\psi=\cos(k_xx)\cos(2k_yy)\) checks magnetic tension:
while the flux block diffuses as
This gate does not claim an FKR growth rate. It validates the exact nonzero equilibrium coupling terms that the FKR/plasmoid eigenmode benchmarks will depend on.
mhx benchmark cosine-equilibrium-linearization \
--outdir outputs/benchmarks/cosine_equilibrium_linearization
Expected files:
outputs/benchmarks/cosine_equilibrium_linearization/diagnostics.jsonoutputs/benchmarks/cosine_equilibrium_linearization/validation.jsonoutputs/benchmarks/cosine_equilibrium_linearization/cosine_equilibrium_linearization.npzoutputs/benchmarks/cosine_equilibrium_linearization/figures/cosine_equilibrium_linearization_errors.png

Periodic current-sheet eigenvalue gate¶
The first nonzero-equilibrium spectrum gate now assembles the full flattened JVP matrix on a deliberately tiny grid for
This is still not an FKR/Coppi growth-rate claim. It is a conservative operator-stability gate between exact bracket tests and future asymptotic tearing benchmarks. The benchmark checks:
for the two mean/gauge modes, solves the complete dense spectrum, and requires the non-gauge spectrum to be damped:
with \(c=0.25\) in the FAST gate. It also stores the selected dense eigenpair and checks the residual
against a tight x64 tolerance.
mhx benchmark current-sheet-eigenvalue \
--outdir outputs/benchmarks/periodic_current_sheet_eigenvalue
Expected files:
outputs/benchmarks/periodic_current_sheet_eigenvalue/diagnostics.jsonoutputs/benchmarks/periodic_current_sheet_eigenvalue/validation.jsonoutputs/benchmarks/periodic_current_sheet_eigenvalue/periodic_current_sheet_eigenvalue.npzoutputs/benchmarks/periodic_current_sheet_eigenvalue/figures/periodic_current_sheet_spectrum.png

Periodic current-sheet time-domain replay¶
The dense spectrum gate proves that the assembled periodic current-sheet JVP has the expected gauge modes and a damped non-gauge spectrum on the FAST grid. The time-domain replay adds the next solver-level check: select a real decaying eigenmode of the same operator and integrate
For this linear initial value problem the exact solution is
The benchmark advances \(q\) with the RK4 path used by MHX validation workflows, then gates both the full state-vector error and the decay-rate fit from \(\log\|q(t)\|_2\):
This is deliberately a linear operator/time-step bridge, not a nonlinear magnetic-island or FKR/Coppi tearing-growth claim.
mhx benchmark current-sheet-timedomain \
--outdir outputs/benchmarks/periodic_current_sheet_timedomain
Expected files:
outputs/benchmarks/periodic_current_sheet_timedomain/diagnostics.jsonoutputs/benchmarks/periodic_current_sheet_timedomain/validation.jsonoutputs/benchmarks/periodic_current_sheet_timedomain/periodic_current_sheet_timedomain.npzoutputs/benchmarks/periodic_current_sheet_timedomain/figures/periodic_current_sheet_timedomain.png

Nonlinear current-sheet differentiability bridge¶
The linear replay gate validates a frozen operator. The next differentiable solver gate validates the nonlinear RK4 time map used by actual MHX runs. Let \(\Phi(q_0)\) be the map from an initial reduced-MHD state to the saved trajectory vector after several RK4 steps. Around the periodic current sheet \(q_0=(\psi_0,\omega_0)\), JAX gives a tangent
MHX compares that tangent to centered finite differences of full nonlinear trajectories:
For a smooth RHS and x64 arithmetic, the error should converge as
until roundoff. This gate is specifically aimed at differentiable programming claims: before MHX trains neural ODEs, adjoints, or inverse-design loops on solver trajectories, the trajectory map itself must have a verified tangent.
mhx benchmark current-sheet-nonlinear-bridge \
--outdir outputs/benchmarks/periodic_current_sheet_nonlinear_bridge
Expected files:
outputs/benchmarks/periodic_current_sheet_nonlinear_bridge/diagnostics.jsonoutputs/benchmarks/periodic_current_sheet_nonlinear_bridge/validation.jsonoutputs/benchmarks/periodic_current_sheet_nonlinear_bridge/periodic_current_sheet_nonlinear_bridge.npzoutputs/benchmarks/periodic_current_sheet_nonlinear_bridge/figures/periodic_current_sheet_nonlinear_bridge.png

Periodic double-Harris nonlinear growth gate¶
The stable cosine-current-sheet spectrum above is intentionally conservative: it protects the code from spurious positive growth but does not demonstrate tearing. MHX now adds a small-grid instability gate using a periodic double-Harris sheet,
with a zero-mean flux \(\psi_0\) satisfying \(B_y=\partial_x\psi_0\) to the sign convention used by the reduced-MHD solver. The gate assembles the dense matrix-free Jacobian \(L=D F(\psi_0,0)\), selects the fastest non-gauge unstable eigenmode \(Lv=\gamma v\), and advances two full nonlinear trajectories:
The measured finite-amplitude difference
must grow by more than a factor of two and its fitted rate must remain within a documented tolerance of the frozen-base eigenvalue. This is the first MHX validation artifact that shows a physically unstable current sheet growing in the nonlinear solver. It is still not a Rutherford-island or plasmoid-chain production claim: the grid is deliberately tiny, the base sheet is periodic, and publication claims still require duration, resolution, time-step, seed, and aspect-ratio sweeps. The literature anchors are the classical tearing-mode instability of Furth–Killeen–Rosenbluth (Physics of Fluids 6, 459, 1963) and the high-Lundquist-number plasmoid-chain scalings of Loureiro–Schekochihin–Cowley (arXiv:astro-ph/0703631), with later nonlinear plasmoid-chain simulations by Samtaney et al. (arXiv:0903.0542).
mhx benchmark double-harris-growth \
--outdir outputs/benchmarks/periodic_double_harris_nonlinear_growth
Expected files:
outputs/benchmarks/periodic_double_harris_nonlinear_growth/diagnostics.jsonoutputs/benchmarks/periodic_double_harris_nonlinear_growth/validation.jsonoutputs/benchmarks/periodic_double_harris_nonlinear_growth/periodic_double_harris_nonlinear_growth.npzoutputs/benchmarks/periodic_double_harris_nonlinear_growth/figures/periodic_double_harris_nonlinear_growth.png

Seeded double-Harris long-run validation¶
The dense eigenmode gate above is intentionally tiny because it assembles the full Jacobian. The next bridge is a scalable nonlinear run that does not assemble the dense spectrum. It advances a base periodic double-Harris sheet and a seeded sheet,
and tracks the normalized difference, dominant reconnecting-flux proxy, local Rutherford-width proxy, total energy, kinetic energy, peak current density, and X/O critical-point counts:
This command is meant for bounded nonlinear evidence runs under laptop/CI
budgets and for producing reviewer-visible movies before a full production
campaign. It gates finite histories, full-duration completion, an early-time
growth fit, visible maximum amplification, and dissipative total-energy
behavior. The reconnection proxy is deliberately stated as a dominant
low-mode perturbation-flux diagnostic for periodic double-Harris validation:
the configured seed-mode amplitude is archived separately as
seed_mode_reconnected_flux, so mode transfer is visible rather than hidden.
The committed 64×64, t_end=30 evidence bundle gives
gamma_early = 0.118, early amplification 5.27×, maximum amplification
7.89×, and zero measured total-energy increase. The result is stronger than
a smoke test, but it remains a validation artifact rather than a converged
Rutherford/plasmoid claim because the late-time perturbation saturates/relaxes
and no resolution/seed/aspect-ratio sweep has yet closed.
mhx benchmark double-harris-long-run \
--outdir outputs/benchmarks/periodic_double_harris_seeded_long_run \
--nx 64 --ny 64 --t-end 30 --save-every 100 --movies
Expected files:
outputs/benchmarks/periodic_double_harris_seeded_long_run/diagnostics.jsonoutputs/benchmarks/periodic_double_harris_seeded_long_run/validation.jsonoutputs/benchmarks/periodic_double_harris_seeded_long_run/periodic_double_harris_seeded_long_run.npzoutputs/benchmarks/periodic_double_harris_seeded_long_run/figures/periodic_double_harris_seeded_long_run.pngoutputs/benchmarks/periodic_double_harris_seeded_long_run/figures/periodic_double_harris_flux.gifoutputs/benchmarks/periodic_double_harris_seeded_long_run/figures/periodic_double_harris_current.gif
Once a convergence bundle exists, the promotion-boundary report is:
mhx benchmark double-harris-promotion-check \
outputs/benchmarks/periodic_double_harris_seeded_long_run \
--convergence-dir outputs/benchmarks/periodic_double_harris_convergence
This writes promotion/promotion_readiness.json,
promotion/validation.json, and promotion/figures/promotion_matrix.png.
Passing means the run is convergence-backed validation evidence; it still does
not authorize Rutherford, Sweet–Parker, or plasmoid production claims.



Source anchors:
Seeded double-Harris convergence evidence¶
This gate asks whether the measured early growth and nonlinear amplification are artifacts of one tiny grid or one RK4 step size. The command
mhx benchmark double-harris-convergence \
--outdir outputs/benchmarks/periodic_double_harris_convergence \
--resolutions 16,24 --dt-values 0.02,0.01 \
--reference-resolution 16 --t-end 8 --fit-stop 4
runs the same base-vs-seeded replay across a small resolution sweep and a small time-step sweep. For each case it records
The gate requires finite metrics, positive early growth, dissipative total
energy, successful subcase gates, and bounded relative spread in
gamma_fit/G_max. The same code path has also been exercised on a
GPU-assisted medium sweep with resolutions 32,48,64, t_end=16, and
0.41% growth-rate spread. This is intentionally validation evidence, not
a production claim: it prevents single-run overclaiming before larger
aspect-ratio, Lundquist-number, seed, and duration sweeps are executed.
Expected files:
outputs/benchmarks/periodic_double_harris_convergence/diagnostics.jsonoutputs/benchmarks/periodic_double_harris_convergence/validation.jsonoutputs/benchmarks/periodic_double_harris_convergence/periodic_double_harris_convergence.npzoutputs/benchmarks/periodic_double_harris_convergence/figures/periodic_double_harris_convergence.png


Seeded double-Harris parameter sweeps¶
Convergence sweeps ask whether one numerical setting dominates the result. Parameter sweeps ask a different question: do the nonlinear response diagnostics remain finite, dissipative, and visibly reconnecting when the seed mode, sheet width, or resistivity is changed? The command
mhx benchmark double-harris-parameter-sweep \
--outdir outputs/benchmarks/periodic_double_harris_parameter_sweep \
--sweep-axis width --widths 0.35,0.4,0.45 \
--t-end 6 --fit-stop 3
runs three seeded base-vs-perturbed replays and records
The gate requires all cases to pass the underlying seeded-long-run checks, and also requires finite per-case metrics, at least three cases, positive fitted growth, visible amplification, reconnecting-flux and island-width response, dissipative total energy, and bounded anomaly-scale spreads. The spread gates are deliberately loose because physically different sheets need not agree; they catch runaway or degenerate cases before figures are promoted.
Expected files:
outputs/benchmarks/periodic_double_harris_parameter_sweep/diagnostics.jsonoutputs/benchmarks/periodic_double_harris_parameter_sweep/validation.jsonoutputs/benchmarks/periodic_double_harris_parameter_sweep/periodic_double_harris_parameter_sweep.npzoutputs/benchmarks/periodic_double_harris_parameter_sweep/figures/periodic_double_harris_parameter_sweep.png

Source anchors:
Nonlinear reduced-MHD energy budget¶
The first full nonlinear PDE gate is deliberately not a plasmoid claim. It checks the periodic reduced-MHD energy theorem under the complete nonlinear Poisson-bracket RHS. For
periodic integration by parts gives
This identity is a strong nonlinear sign/cancellation check: the advection and magnetic-tension brackets must cancel in the energy balance, while the resistive and viscous terms must remove energy. MHX starts from a multi-mode state with active nonlinear RHS, advances the full nonlinear RK4 solver, and gates:
all saved arrays are finite;
the initial nonlinear RHS norm is a nontrivial fraction of the full RHS;
total energy is nonincreasing;
the integrated residual \(|E(t)-E(0)+\int_0^t[\eta\langle j^2\rangle+\nu\langle\omega^2\rangle]dt|/E(0)\) stays below tolerance;
net dissipative energy loss is observed.
mhx benchmark nonlinear-energy-budget \
--outdir outputs/benchmarks/nonlinear_energy_budget
Expected files:
outputs/benchmarks/nonlinear_energy_budget/diagnostics.jsonoutputs/benchmarks/nonlinear_energy_budget/validation.jsonoutputs/benchmarks/nonlinear_energy_budget/nonlinear_energy_budget.npzoutputs/benchmarks/nonlinear_energy_budget/figures/nonlinear_energy_budget.png

This is the most important nonlinear solver gate currently in MHX. It supports claims about nonlinear reduced-MHD consistency, but it still does not validate nonlinear island growth, Rutherford saturation, Sweet–Parker reconnection rates, or plasmoid chains.
Nonlinear duration audit¶
The nonlinear energy-budget gate is intentionally short. To prevent accidental overclaiming, MHX includes a reviewer-facing duration audit. For a linear tearing eigenmode with growth rate \(\gamma\), observing \(N_e\) e-folds requires
Using the direct Harris benchmark anchor \(\gamma\simeq0.0131\) for \(S=1000\), \(ka=0.5\), ten e-folds require \(t_\mathrm{end}\approx763.4\). The default FAST nonlinear budget run reaches \(t=0.8\), so it is a code-validity gate, not a nonlinear island or plasmoid physics result. Longer validation runs are documented separately and still require convergence and seed-QI promotion evidence before supporting production physics claims. The audit also records Loureiro-type Sweet–Parker plasmoid one-e-fold estimates \(1/\gamma_{\max}\sim S^{-1/4}\) as a separate linear-timescale reference.
mhx benchmark nonlinear-duration-audit \
--outdir outputs/benchmarks/nonlinear_duration_audit
Expected files:
outputs/benchmarks/nonlinear_duration_audit/diagnostics.jsonoutputs/benchmarks/nonlinear_duration_audit/validation.jsonoutputs/benchmarks/nonlinear_duration_audit/nonlinear_duration_audit.npzoutputs/benchmarks/nonlinear_duration_audit/figures/nonlinear_duration_audit.png

This audit is a pass/fail gate on scientific honesty: it passes only when the current FAST nonlinear runs are explicitly flagged as too short for Rutherford-island or plasmoid-chain claims and when the production time windows are recorded in machine-readable artifacts.
Duration-policy gate¶
The duration audit is the figure-facing view. The duration-policy gate is the machine-readable rule that future production workflows should call before launching long nonlinear runs:
mhx benchmark duration-policy --outdir outputs/benchmarks/duration_policy
Expected files:
outputs/benchmarks/duration_policy/duration_policy.jsonoutputs/benchmarks/duration_policy/duration_policy.mdoutputs/benchmarks/duration_policy/validation.jsonoutputs/benchmarks/duration_policy/manifest.json
The policy gate passes when short historical/CI runs are scoped as validation-only and when future production templates satisfy \(t_\mathrm{end}\ge s_f N_e/\gamma\). This prevents a future script from silently using a smoke-test time window for a nonlinear reconnection claim.
Diffusion eigenvalue scaffold¶
Before applying eigenvalue machinery to tearing equilibria, MHX validates the matrix-free operator path on a single Fourier eigenfunction of the periodic diffusion operator:
The benchmark computes the Rayleigh quotient
and the relative eigen-residual
mhx benchmark diffusion-eigenvalue --outdir outputs/benchmarks/diffusion_eigenvalue
Expected files:
outputs/benchmarks/diffusion_eigenvalue/diagnostics.jsonoutputs/benchmarks/diffusion_eigenvalue/validation.jsonoutputs/benchmarks/diffusion_eigenvalue/diffusion_eigenvalue.npzoutputs/benchmarks/diffusion_eigenvalue/figures/diffusion_eigenvalue_errors.png

Power-iteration scaffold¶
The next eigenvalue-control-path gate validates the dominant-eigenpair iteration on a diagonal matrix-free operator
whose dominant eigenvalue is known exactly:
Power iteration repeatedly applies
and records the Rayleigh quotient
plus residual \(\|\mathcal{A}u_n-\lambda_nu_n\|_2\). This is intentionally a known finite-dimensional operator, not a tearing benchmark. It makes the dominant-eigenpair loop, convergence history, plotting, schemas, CLI, and CI artifact checks deterministic before coupling the same machinery to the reduced-MHD JVP operator.
mhx benchmark power-iteration --outdir outputs/benchmarks/power_iteration
Expected files:
outputs/benchmarks/power_iteration/diagnostics.jsonoutputs/benchmarks/power_iteration/validation.jsonoutputs/benchmarks/power_iteration/power_iteration_history.npzoutputs/benchmarks/power_iteration/figures/power_iteration_history.png

Arnoldi Ritz-spectrum scaffold¶
Tearing eigenmode validation needs more than a dominant-mode iteration: the linearized reduced-MHD operator can be non-normal, and nearby Ritz values must be handled explicitly. MHX therefore includes a deterministic Arnoldi gate on a small non-normal upper-triangular fixture,
whose exact spectrum is the diagonal:
The Arnoldi process constructs an orthonormal Krylov basis \(Q_m\) and projected Hessenberg matrix \(H_m\),
The eigenvalues of \(H_m\) are Ritz values approximating the spectrum of \(\mathcal{A}\). The validation gate checks the recovered fixture spectrum, negligible imaginary parts for this real fixture, and residual estimates \(|h_{m+1,m}e_m^\top y_i|\).
mhx benchmark arnoldi --outdir outputs/benchmarks/arnoldi
Expected files:
outputs/benchmarks/arnoldi/diagnostics.jsonoutputs/benchmarks/arnoldi/validation.jsonoutputs/benchmarks/arnoldi/arnoldi_spectrum.npzoutputs/benchmarks/arnoldi/figures/arnoldi_ritz_values.png

Additional source links: