Skip to content

IRAxis construction is unreliable at small beta*wmax: LinAlgError crash, or silently wrong transform matrices #153

Description

@k-yoshimi

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions