This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

Notebooks · lib/randla/gallery_trace

Trace estimation by Hutch++, drawn

A smaller version of the first figure of vipyr's gallery example plot_randomized_trace_and_lowrank.py, drawn in Viv: the trace of a matrix with eigenvalues 1/k^2, estimated from m matrix-vector products by Hutch++ (Meyer, Musco, Musco and Woodruff 2021) and by Hutchinson's estimator, both from lib/randla/api.viv, as the mean relative error over seeds. vipyr's figure uses n = 400, 20 seeds and m up to 384; this one uses n = 100, 10 seeds and m up to 96, to keep the run short. The exact trace is the sum of the eigenvalues. Hutchinson falls like 1/sqrt(m). Hutch++'s bound is 1/m, and on this quickly decaying spectrum it falls like 1/m^2: vipyr's run fits slopes of -2.05 and -0.50. With 10 seeds the fitted slopes are rougher, so the test asks for a slope steeper than -1.5 and a tenfold advantage at the largest m.

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.

[1]lines 19–74