From 15619d8f358e8535ef8d0211856796be77ae8146 Mon Sep 17 00:00:00 2001 From: Benjamin Cohen-Stead Date: Thu, 19 Sep 2024 17:02:38 -0400 Subject: [PATCH] Minor Typo Corrections --- examples/usage.jl | 9 ++++----- src/lanczos.jl | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/examples/usage.jl b/examples/usage.jl index a395d78..0a1a2c8 100644 --- a/examples/usage.jl +++ b/examples/usage.jl @@ -12,7 +12,7 @@ # ```math # f(\epsilon) = \frac{1}{1+e^{\beta (\epsilon-\mu)}} = \frac{1}{2} \left[ 1 + \tanh\left(\tfrac{\beta(\epsilon-\mu)}{2}\right) \right] # ``` -# is the Fermi function, with ``\beta = 1/T`` is the inverse temperature and ``\mu`` is the chemical potential. +# is the Fermi function, with ``\beta = 1/T`` the inverse temperature and ``\mu`` the chemical potential. # Here we will applying the kernel polynomial method (KPM) algorithm to approximate the density matrix ``\rho`` by # a Chebyshev polynomial expansion. @@ -58,10 +58,9 @@ fermi(ϵ, μ, β) = (1+tanh(β*(ϵ-μ)/2))/2 ρ = U * Diagonal(fermi.(ϵ, μ, β)) * adjoint(U) # Now let use the KPM to approximate ``\rho``. We will need to define the order ``M`` of the expansion -# and give approximate bounds for the egenspectrum of ``H``, making sure to overestimate the the true -# interval spanned by the egienvalues of ``H``. Note that because we are considering the simple -# non-interacting model here, the exact eigenspectrum of ``H`` is known and spans -# the interval ``\epsilon \in [-2t, 2t].`` +# and give approximate bounds for the eigenspectrum of ``H``, making sure to overestimate the the true +# interval spanned by the eigenvalues of ``H``. Because we are considering the simple non-interacting model, +# the exact eigenspectrum of ``H`` is known and spans the interval ``\epsilon \in [-2t, 2t].`` ## Define eigenspectrum bounds. bounds = (-3.0t, 3.0t) diff --git a/src/lanczos.jl b/src/lanczos.jl index 9334df2..6bef86c 100644 --- a/src/lanczos.jl +++ b/src/lanczos.jl @@ -34,6 +34,15 @@ Note that the [`eigmin`](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/# and [`eigmax`](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#LinearAlgebra.eigmax) routines have [specialized implementations](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#Elementary-operations) for a [`SymTridiagonal`](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#LinearAlgebra.SymTridiagonal) matrix type. + +# Similar generalizations of Lanczos have been considered in [2] and [3]. +# +# 1. C. C. Paige, IMA J. Appl. Math., 373-381 (1972), +# https://doi.org/10.1093%2Fimamat%2F10.3.373. +# 2. H. A. van der Vorst, Math. Comp. 39, 559-561 (1982), +# https://doi.org/10.1090/s0025-5718-1982-0669648-0 +# 3. M. Grüning, A. Marini, X. Gonze, Comput. Mater. Sci. 50, 2148-2156 (2011), +# https://doi.org/10.1016/j.commatsci.2011.02.021. """ function lanczos(niters, v, A, S = I, rng = Random.default_rng()) @@ -67,6 +76,15 @@ based on the contents of the vectors `αs` and `βs`. Note that the [`eigmin`](h and [`eigmax`](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#LinearAlgebra.eigmax) routines have [specialized implementations](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#Elementary-operations) for a [`SymTridiagonal`](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#LinearAlgebra.SymTridiagonal) matrix type. + +# Similar generalizations of Lanczos have been considered in [2] and [3]. +# +# 1. C. C. Paige, IMA J. Appl. Math., 373-381 (1972), +# https://doi.org/10.1093%2Fimamat%2F10.3.373. +# 2. H. A. van der Vorst, Math. Comp. 39, 559-561 (1982), +# https://doi.org/10.1090/s0025-5718-1982-0669648-0 +# 3. M. Grüning, A. Marini, X. Gonze, Comput. Mater. Sci. 50, 2148-2156 (2011), +# https://doi.org/10.1016/j.commatsci.2011.02.021. """ function lanczos!( αs::AbstractVector, βs::AbstractVector, v::AbstractVector,