Skip to content

Add Configurable Lossy Optimizations (Hydrogen SCF, Cutoff, Hydrogen Inner Iters) #15

@TKanX

Description

@TKanX

Description:

Introduce three opt-in knobs that can trade exactness for performance or stability tweaks. Defaults remain numerically identical to current behavior (lossless). Hard cutoff only (no pre-baked abstractions for KD-tree). Hydrogen inner iterations must end with a full constrained solve to restore total charge.

Tasks:

  • Hydrogen SCF Toggle (Default: On, Lossless)

    • Add hydrogen_scf: bool to SolverOptions; wire CLI --hydrogen-scf/--no-hydrogen-scf and config key.
    • When off, keep hydrogen hardness fixed; when on, retain current per-iteration hardness update.
  • Cutoff Radius (Default: Off, Hard Cutoff, Lossy)

    • Add cutoff_radius: Option<f64> to SolverOptions; wire CLI --cutoff <angstrom> and config key.
    • Implement hard cutoff in compute_off_diagonal_rows using a cell-list neighbor table (no KD-tree abstractions left unused).
    • Ensure matrix symmetry and clear documentation that this is a lossy mode with discontinuity at r_cut.
  • Hydrogen Inner Iterations (Default: 0, Off, Lossy)

    • Add hydrogen_inner_iters: u32 to SolverOptions; wire CLI --hydrogen-inner-iters <u32> and config key.
    • Run up to N inner hydrogen-only steps per global iteration (small fixed cap), then always perform one full constrained solve to restore charge conservation.
    • Reuse global tolerance; no extra tol knob; document trade-offs and expected benefit limits.
  • Docs & Validation

    • Update README/USAGE to describe the three knobs, defaults (lossless), and lossy nature of cutoff/inner iters.
    • Add/adjust tests to assert defaults remain unchanged; add a sanity test for cutoff path symmetry/constraint hold after the final full solve.

Metadata

Metadata

Assignees

Labels

enhancement ✨New feature or requestperformance ⚡Performance improvements and code optimizations

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions