{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/analysis-of-stochastic-lanczos-quadrature-for","title":"Analysis of stochastic Lanczos quadrature for spectrum approximation","arxiv_id":"2105.06595","date":"2021-05-13","proceeding":null,"authors":["Tyler Chen","Thomas Trogdon","Shashanka Ubaru"],"abstract":"The cumulative empirical spectral measure (CESM) $\\Phi[\\mathbf{A}] : \\mathbb{R} \\to [0,1]$ of a $n\\times n$ symmetric matrix $\\mathbf{A}$ is defined as the fraction of eigenvalues of $\\mathbf{A}$ less than a given threshold, i.e., $\\Phi[\\mathbf{A}](x) := \\sum_{i=1}^{n} \\frac{1}{n} {\\large\\unicode{x1D7D9}}[ \\lambda_i[\\mathbf{A}]\\leq x]$. Spectral sums $\\operatorname{tr}(f[\\mathbf{A}])$ can be computed as the Riemann--Stieltjes integral of $f$ against $\\Phi[\\mathbf{A}]$, so the task of estimating CESM arises frequently in a number of applications, including machine learning. We present an error analysis for stochastic Lanczos quadrature (SLQ). We show that SLQ obtains an approximation to the CESM within a Wasserstein distance of $t \\: | \\lambda_{\\text{max}}[\\mathbf{A}] - \\lambda_{\\text{min}}[\\mathbf{A}] |$ with probability at least $1-\\eta$, by applying the Lanczos algorithm for $\\lceil 12 t^{-1} + \\frac{1}{2} \\rceil$ iterations to $\\lceil 4 ( n+2 )^{-1}t^{-2} \\ln(2n\\eta^{-1}) \\rceil$ vectors sampled independently and uniformly from the unit sphere. We additionally provide (matrix-dependent) a posteriori error bounds for the Wasserstein and Kolmogorov--Smirnov distances between the output of this algorithm and the true CESM. The quality of our bounds is demonstrated using numerical experiments.","url_abs":"https://arxiv.org/abs/2105.06595v2","url_pdf":"https://arxiv.org/pdf/2105.06595v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"analysis-of-stochastic-lanczos-quadrature-for","repo_url":"https://github.com/chentyl/SLQ_analysis","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2105.06595","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2105.06595"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/chentyl/SLQ_analysis","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":8},"by_repo_kind":{"official":{"samples":8,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"6c36e794e77bd139","entry":"KS_experiment","repo":"chentyl/SLQ_analysis","repo_kind":"official","path":"lanczos_bin/experiment.py","file_url":"https://github.com/chentyl/SLQ_analysis/blob/HEAD/lanczos_bin/experiment.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6c36e794e77bd139"}},{"code_sha256_prefix":"80d8322f32714259","entry":"W_experiment","repo":"chentyl/SLQ_analysis","repo_kind":"official","path":"lanczos_bin/experiment.py","file_url":"https://github.com/chentyl/SLQ_analysis/blob/HEAD/lanczos_bin/experiment.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"80d8322f32714259"}},{"code_sha256_prefix":"a6056659586ac90a","entry":"exact_lanczos","repo":"chentyl/SLQ_analysis","repo_kind":"official","path":"lanczos_bin/lanczos.py","file_url":"https://github.com/chentyl/SLQ_analysis/blob/HEAD/lanczos_bin/lanczos.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a6056659586ac90a"}},{"code_sha256_prefix":"968e6247740721c1","entry":"get_GQ_distr","repo":"chentyl/SLQ_analysis","repo_kind":"official","path":"lanczos_bin/distribution.py","file_url":"https://github.com/chentyl/SLQ_analysis/blob/HEAD/lanczos_bin/distribution.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"968e6247740721c1"}},{"code_sha256_prefix":"c1a7a9095963298f","entry":"get_GQ_lower_bound","repo":"chentyl/SLQ_analysis","repo_kind":"official","path":"lanczos_bin/distribution.py","file_url":"https://github.com/chentyl/SLQ_analysis/blob/HEAD/lanczos_bin/distribution.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c1a7a9095963298f"}},{"code_sha256_prefix":"f2c3f40937a32999","entry":"get_GQ_upper_bound","repo":"chentyl/SLQ_analysis","repo_kind":"official","path":"lanczos_bin/distribution.py","file_url":"https://github.com/chentyl/SLQ_analysis/blob/HEAD/lanczos_bin/distribution.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f2c3f40937a32999"}},{"code_sha256_prefix":"41440c88f8c9abf1","entry":"get_GQs","repo":"chentyl/SLQ_analysis","repo_kind":"official","path":"lanczos_bin/experiment.py","file_url":"https://github.com/chentyl/SLQ_analysis/blob/HEAD/lanczos_bin/experiment.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"41440c88f8c9abf1"}},{"code_sha256_prefix":"2f29ca9e1829c7e1","entry":"mystep","repo":"chentyl/SLQ_analysis","repo_kind":"official","path":"lanczos_bin/misc.py","file_url":"https://github.com/chentyl/SLQ_analysis/blob/HEAD/lanczos_bin/misc.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2f29ca9e1829c7e1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}