NLA-lib Explorer

NLAlib.eighStep

Library · def

One node of randomized spectral bisection on the machine M, for a stored \mathbf{A} of size k with stored window R and tolerance \varepsilon, depth counter \ell, ideal sample (\mathbf{v}, \mathbf{G}_{\pm}), stored root scale R_0 and accuracy \beta, and at most N sign steps: a leaf (\mathbf{I}, \operatorname{Re}\operatorname{diag}\mathbf{A}) for k \le 1, a leaf (\mathbf{I}, \mathbf{0}) when the machine finds R \le \mathrm{fl}(\varepsilon R_0); otherwise the computed shift c = \mathrm{unif}(\mathrm{fl}(R/\ell), \mathbf{v}), \mathbf{B} the Newton–Schulz sign of \mathbf{A} - c\mathbf{I} at accuracy \beta and scale \mathrm{fl}(2R), the stored projectors \mathbf{P}_+ = (\mathbf{B} + \mathbf{I})/2 and \mathbf{P}_- = -(\mathbf{B} - \mathbf{I})/2 (each a shift, then a rounded division by 2: one rounding per operation), k_+ = \min(k, \lfloor\mathrm{fl}(t + \mathrm{fl}(1/2))\rfloor_+) for t the rounded trace of \mathbf{P}_+ (the machine's floor, 0 below zero; the program NLAlib.eighProg clamps \mathrm{fl}(t + \mathrm{fl}(1/2)) to [0, k] by two counted comparisons before its index binder, which computes the same k_+ under exact comparisons and conversion); one child on \mathbf{A} \mp \mathrm{fl}(R/2)\mathbf{I} when k_+ \in \{k, 0\}, and otherwise the deflated bases \mathbf{Q}_{\pm} and the stored (\mathbf{C}_\pm + \mathbf{C}_\pm^{\mathsf{H}})/2 \mp \mathrm{fl}(R/2)\mathbf{I}, \mathbf{C}_\pm = \mathrm{mm}(\mathrm{mm}(\mathbf{Q}_\pm^{\mathsf{H}}, \mathbf{A}), \mathbf{Q}_\pm). [Shah2024, Algorithm 3]. Algorithm: spectral-bisection

NLAlib.eighStep.{u_1, u_2, u_3} {F : Type u_1} {Su : Type u_2} {Sg : Type u_3} [Inhabited Sg]
  (M : FloatMachine F Su Sg) (N signFuel : ℕ) (R₀ β : F) {k : ℕ}
  (A : Matrix (Fin k) (Fin k) (F × F)) (R ε : F) (ℓ : ℕ) (s : EighSample Su Sg N) : EighStep F k

Full source on GitHub

Import NLAlib.Matrix.FinitePrecision.SpectralBisection.