Skip to content

feat(#162): use exponential action for relaxation trajectories - #175

Draft
marcohost33-maker wants to merge 12 commits into
codex/trajectory-failclosed-current-main-20260927from
codex/issue162-expm-multiply-action
Draft

marcohost33-maker wants to merge 12 commits into
codex/trajectory-failclosed-current-main-20260927from
codex/issue162-expm-multiply-action

Conversation

@marcohost33-maker

Copy link
Copy Markdown
Owner

Summary

Stacked on PR #174, which establishes the fail-closed trajectory-domain contract. This PR changes only the propagation method and adds backend/audit evidence.

SciPy documents scipy.sparse.linalg.expm_multiply as computing the action exp(tA) B directly, with an interval API for evenly spaced times. LiouScope now uses that action instead of materialising the full dense expm(tL) matrix.

Backend contract

  • exact NumPy-linspace grids -> one expm_multiply(..., start, stop, num) interval call;
  • arbitrary/non-uniform/two-scale grids -> independent actions from the same initial state, avoiding stepwise error accumulation;
  • exact t=0 state is restored explicitly;
  • low-level propagation accepts both dense and SciPy sparse matrices;
  • top-level diagnose() remains dense-only: this PR does not claim sparse-native orchestration or sparse steady-state solving.

Fail-closed preservation

PR #174 remains the prerequisite. Before entering the action algorithm LiouScope checks that L*t and its 1-norm are representable. Runtime failures or non-finite action outputs raise UnrepresentableTrajectoryError. The astronomical #156 fixture is therefore still a domain refusal rather than a hang/NaN.

No physics cutoff is introduced: the preflight refuses only non-finite represented entries or an unrepresentable mathematical 1-norm.

Numerical audit

RelaxationResult gains additive/defaulted fields:

  • trajectory_backend;
  • trajectory_max_trace_error;
  • trajectory_max_hermiticity_defect;
  • trajectory_min_eigenvalue.

These are measurements, not repair operations. Negative positivity drift is recorded; no eigenvalue clipping is performed.

Discrimination

  • dense action vs former scipy.linalg.expm(L*t) @ rho0 reference on uniform and non-uniform grids;
  • sparse vs dense propagation;
  • exact linspace interval-path selection and exact t=0;
  • non-uniform pointwise-path selection;
  • rate-unit metamorphism L -> cL, t -> t/c;
  • trace/Hermiticity/min-eigenvalue trajectory audit;
  • inherited fix(#127): handle zero-resolution and unrepresentable propagation limits #156 non-representability tests under the action backend;
  • manual benchmark benchmarks/issue162_expm_action.py runs full dense expm and action in separate processes, reporting elapsed time, peak RSS and relative error.

Scientific / release impact

This is a numerical methodology change, not a mathematical-model change. Floating-point trajectories can move at round-off level relative to full dense expm, so README / CHANGELOG / CITATION are updated. No D1-D24 definition, classifier threshold, manifest field or schema changes.

Dependency

Must not merge before #174. Once #174 is integrated, this stack should be rebuilt/rebased non-destructively from then-current main if required by base movement.

Test plan

Refs #156. Closes #162 when merged after #174.

This branch has not been deployed

No deployments
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