From e02bbda3b15c67a6bd09d18b945e1de1a5cf642c Mon Sep 17 00:00:00 2001 From: mohamed82008 Date: Wed, 18 Jul 2018 01:02:15 +1000 Subject: [PATCH 1/2] Add LOBPCG docs and bump docs/make.jl Julia version to v0.7 --- docs/make.jl | 3 ++- docs/src/eigenproblems/lobpcg.md | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 docs/src/eigenproblems/lobpcg.md diff --git a/docs/make.jl b/docs/make.jl index 422b3487..c617fe54 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -23,6 +23,7 @@ makedocs( ], "Eigenproblems" => [ "Power method" => "eigenproblems/power_method.md", + "LOBPCG" => "eigenproblems/lobpcg.md" ], "SVDL" => "svd/svdl.md", "The iterator approach" => "iterators.md", @@ -37,7 +38,7 @@ deploydocs( repo = "github.com/JuliaMath/IterativeSolvers.jl.git", target = "build", osname = "linux", - julia = "0.6", + julia = "0.7", deps = nothing, make = nothing, ) diff --git a/docs/src/eigenproblems/lobpcg.md b/docs/src/eigenproblems/lobpcg.md new file mode 100644 index 00000000..ee06375a --- /dev/null +++ b/docs/src/eigenproblems/lobpcg.md @@ -0,0 +1,27 @@ +# [Locally optimal block preconditioned conjugate gradient (LOBPCG)](@id LOBPCG) + +Solves the generalized eigenproblem $Ax = λBx$ approximately where $A$ and $B$ are Hermitian linear maps, and $B$ is positive definite. $B$ is taken to be the identity by default. It can find the smallest (or largest) `k` eigenvalues and their corresponding eigenvectors which are B-orthonormal. It also admits a preconditioner and a "constraints" matrix `C`, such that the algorithm returns the smallest (or largest) eigenvalues associated with the eigenvectors in the nullspace of `C'B`. + +## Usage + +```@docs +lobpcg +lobpcg! +``` + +## Implementation Details + +A `LOBPCGIterator` is created to pre-allocate all the memory required by the method using the constructor `LOBPCGIterator(A, B, largest, X, P, C)` where `A` and `B` are the matrices from the generalized eigenvalue problem, `largest` indicates if the problem is a maximum or minimum eigenvalue problem, `X` is the initial eigenbasis, randomly sampled if not input, where `size(X, 2)` is the block size `bs`. `P` is the preconditioner, `nothing` by default, and `C` is the constraints matrix. The desired `k` eigenvalues are found `bs` at a time. + + +## References + +[Knyazev1993]: + + Andrew V. Knyazev. "Toward the Optimal Preconditioned Eigensolver: Locally + Optimal Block Preconditioned Conjugate Gradient Method" SIAM Journal + on Scientific Computing, 23(2):517–541, 2001. + +[Scipy LOBPCG implementation]: + + https://github.com/scipy/scipy/blob/v1.1.0/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py#L109-L568 From c4a60a127a8c651a426020533abdc80f03ac497b Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Wed, 18 Jul 2018 08:47:49 +0300 Subject: [PATCH 2/2] Formatting --- docs/src/eigenproblems/lobpcg.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/docs/src/eigenproblems/lobpcg.md b/docs/src/eigenproblems/lobpcg.md index ee06375a..609ca0fd 100644 --- a/docs/src/eigenproblems/lobpcg.md +++ b/docs/src/eigenproblems/lobpcg.md @@ -15,13 +15,8 @@ A `LOBPCGIterator` is created to pre-allocate all the memory required by the met ## References +Implementation is based on [^Knyazev1993] and [^Scipy]. -[Knyazev1993]: +[^Knyazev1993]: Andrew V. Knyazev. "Toward the Optimal Preconditioned Eigensolver: Locally Optimal Block Preconditioned Conjugate Gradient Method" SIAM Journal on Scientific Computing, 23(2):517–541 2001. - Andrew V. Knyazev. "Toward the Optimal Preconditioned Eigensolver: Locally - Optimal Block Preconditioned Conjugate Gradient Method" SIAM Journal - on Scientific Computing, 23(2):517–541, 2001. - -[Scipy LOBPCG implementation]: - - https://github.com/scipy/scipy/blob/v1.1.0/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py#L109-L568 +[^Scipy]: See [Scipy LOBPCG implementation](https://github.com/scipy/scipy/blob/v1.1.0/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py#L109-L568)