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/eigen/lowest

The lowest eigenpairs of a symmetric operator, by Lanczos or from its matrix

lowest_eigenpairs(apply_h, n, k) is a contract: the k lowest eigenvalues of a symmetric operator on n-vectors, with their eigenvectors, lowest first. The operator is a function, apply_h(x) returning H x (the methods call it op), so the caller never builds the matrix unless a method does.

  • lanczos keeps every vector and orthogonalizes each new one against all of them twice (full reorthogonalization), and restarts with the lowest Ritz vectors when the basis reaches krylov vectors (thick restart, Wu and Simon, SIAM Journal on Matrix Analysis and Applications 22, 602 (2000)). It stops when the k lowest Ritz pairs all have residual norm under tol, or after max_iter products.
  • the dense methods form the matrix (build_matrix applies H to every unit vector), then find every eigenpair: householder_ql by Householder reduction and implicit QL, jacobi by cyclic Jacobi rotations (both from lib/hf/eigen). The matrix holds n^2 numbers, so they stop above LOWEST_DENSE_MAX.

The Lanczos loop came from lib/nuclear/shell, whose design follows BIGSTICK, which carries this notice:

Copyright (c) 2017 Lawrence Livermore National Security and San Diego State University Research Foundation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.

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 38–354