Summary
IRAxis construction (src/hwave/solver/ir_axis.py) becomes numerically unreliable at very small beta*wmax, in two distinct ways (both reproduced at wmax=5, eps=1e-8):
beta = 0.02: construction crashes with a LinAlgError from the pinv-based transform-matrix build.
beta <= 0.001: construction succeeds but the resulting transform matrices are silently wrong — roundtrip checks are off by roughly 4x, with no exception raised.
The second mode is the dangerous one: a FLEX run configured with an unusually low ir_wmax at high temperature (small beta) would produce plausible-looking but wrong susceptibilities with no warning.
How this was found
While building an independent Lehmann-sum oracle for the IR bond bubble, fixture selection at wmax=5, eps=1e-8 showed that beta <~ 0.03-0.04 hits this conditioning boundary. The oracle work moved its fixture to beta=0.1 (cross-checked against an nmat=65536 dense ladder, rel diff ~6e-6), so no shipped test depends on the fragile region — but nothing guards production against entering it either.
Suggested direction
- Detect the ill-conditioned regime at
IRAxis construction time (e.g. a conditioning/roundtrip self-check on the fitted matrices) and raise a clear error naming beta, wmax, and eps, instead of crashing deep in pinv or silently degrading.
- A regression test at the two reproduced points (expect: clean error, never silent wrongness).
Found during the bubble-kernel unification work (#152); out of that PR's scope since it predates it and lives in IRAxis construction.
Summary
IRAxisconstruction (src/hwave/solver/ir_axis.py) becomes numerically unreliable at very smallbeta*wmax, in two distinct ways (both reproduced atwmax=5, eps=1e-8):beta = 0.02: construction crashes with aLinAlgErrorfrom the pinv-based transform-matrix build.beta <= 0.001: construction succeeds but the resulting transform matrices are silently wrong — roundtrip checks are off by roughly 4x, with no exception raised.The second mode is the dangerous one: a FLEX run configured with an unusually low
ir_wmaxat high temperature (smallbeta) would produce plausible-looking but wrong susceptibilities with no warning.How this was found
While building an independent Lehmann-sum oracle for the IR bond bubble, fixture selection at
wmax=5, eps=1e-8showed thatbeta <~ 0.03-0.04hits this conditioning boundary. The oracle work moved its fixture tobeta=0.1(cross-checked against annmat=65536dense ladder, rel diff ~6e-6), so no shipped test depends on the fragile region — but nothing guards production against entering it either.Suggested direction
IRAxisconstruction time (e.g. a conditioning/roundtrip self-check on the fitted matrices) and raise a clear error namingbeta,wmax, andeps, instead of crashing deep inpinvor silently degrading.Found during the bubble-kernel unification work (#152); out of that PR's scope since it predates it and lives in
IRAxisconstruction.