NLAlib.countSketchMatrix
Library · def
The CountSketch matrix of a hash h : n \to k and signs \sigma : n \to \mathbb{R}: \mathbf{S}_{a,i} = \sigma_i if h(i) = a and 0 otherwise, so column i is \sigma_i \mathbf{e}_{h(i)} and \mathbf{S} = \mathbf{P}_h \operatorname{diag}(\sigma) for the selection matrix \mathbf{P}_h of h (NLAlib.selectionMatrix h). Real entries, in any RCLike field. Its law for uniform hashes and Rademacher signs is NLAlib.countSketch. [Woodruff2014, §2.1, before Theorem 8] (the sparse embedding matrix, S_{h(i),i} = \sigma(i)); [CamanoEpperlyMeyerTropp2025, (B.1)] (there \mathbf{\Phi} = \mathbf{S}^{\mathsf{T}}, over \mathbb{C} with Rademacher signs); [MartinssonTropp2020, Remark 9.1] (history).
NLAlib.countSketchMatrix.{u_2, u_3, u_4} {𝕜 : Type u_2} [RCLike 𝕜] {k : Type u_3} {n : Type u_4}
[DecidableEq k] (h : n → k) (σ : n → ℝ) : Matrix k n 𝕜Import NLAlib.Sketching.Sparse.CountSketch.