forked from Jutho/KrylovKit.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
major changes in docs, GKL iterator and svdsolve based thereon
- Loading branch information
Showing
29 changed files
with
935 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,3 @@ | |
*.jl.*.cov | ||
*.jl.mem | ||
.DS_Store | ||
docs/build/ | ||
docs/site/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build/ | ||
site/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,29 @@ | ||
using Documenter, KrylovKit | ||
using Documenter | ||
using KrylovKit | ||
|
||
makedocs(modules=[KrylovKit], | ||
format=:html, | ||
sitename="KrylovKit.jl", | ||
pages = [ | ||
"Home" => "index.md", | ||
"Linear systems and least square problems" => "linear.md", | ||
"Eigenvalues and singular values" => "eigsvd.md", | ||
"Matrix functions" => "matfun.md", | ||
"Available algorithms" => "algorithms.md", | ||
"Implementation" => "implementation.md" | ||
"Manual" => [ | ||
"man/linear.md", | ||
"man/eig.md", | ||
"man/svd.md", | ||
"man/matfun.md", | ||
"man/algorithms.md", | ||
"man/implementation.md" | ||
] | ||
# "Linear systems" => "linear.md", | ||
# "Eigenvalues and singular values" => "eigsvd.md", | ||
# "Matrix functions" => "matfun.md", | ||
# "Available algorithms" => "algorithms.md", | ||
# "Implementation" => "implementation.md" | ||
]) | ||
|
||
# Documenter can also automatically deploy documentation to gh-pages. | ||
# See "Hosting Documentation" and deploydocs() in the Documenter manual | ||
# for more information. | ||
#=deploydocs( | ||
repo = "<repository url>" | ||
)=# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# See the mkdocs user guide for more information on these settings. | ||
# http://www.mkdocs.org/user-guide/configuration/ | ||
|
||
site_name: KrylovKit.jl | ||
#repo_url: https://github.com/USER_NAME/PACKAGE_NAME.jl | ||
#site_description: Description... | ||
#site_author: USER_NAME | ||
|
||
theme: readthedocs | ||
|
||
extra_css: | ||
- assets/Documenter.css | ||
|
||
extra_javascript: | ||
- https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML | ||
- assets/mathjaxhelper.js | ||
|
||
markdown_extensions: | ||
- extra | ||
- tables | ||
- fenced_code | ||
- mdx_math | ||
|
||
docs_dir: 'build' | ||
|
||
pages: | ||
- Home: index.md |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Available algorithms | ||
|
||
## Orthogonalization algorithms | ||
```@docs | ||
ClassicalGramSchmidt | ||
ModifiedGramSchmidt | ||
ClassicalGramSchmidt2 | ||
ModifiedGramSchmidt2 | ||
ClassicalGramSchmidtIR | ||
ModifiedGramSchmidtIR | ||
``` | ||
|
||
## General Krylov algorithms | ||
```@docs | ||
Lanczos | ||
Arnoldi | ||
``` | ||
|
||
## Specific algorithms for linear systems | ||
```@docs | ||
GMRES | ||
``` | ||
|
||
## Default values | ||
```@docs | ||
KrylovDefaults | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Finding eigenvalues and eigenvectors | ||
Finding a selection of eigenvalues and corresponding (right) eigenvectors of a linear map can | ||
be accomplished with the `eigsolve` routine: | ||
```@docs | ||
eigsolve | ||
``` | ||
|
||
For a general matrix, eigenvalues and eigenvectors will always be returned with complex values | ||
for reasons of type stability. However, if the linear map and initial guess are real, most of | ||
the computation is actually performed using real arithmetic, as in fact the first step is to | ||
compute an approximate partial Schur factorization. If one is not interested in the eigenvectors, | ||
one can also just compute this partial Schur factorization using `schursolve`. | ||
```@docs | ||
schursolve | ||
``` | ||
Note that, for symmetric or hermitian linear maps, the eigenvalue and Schur factorizaion are | ||
equivalent, and one can only use `eigsolve`. | ||
|
||
Another example of a possible use case of `schursolve` is if the linear map is known to have | ||
a unique eigenvalue of, e.g. largest magnitude. Then, if the linear map is real valued, that | ||
largest magnitude eigenvalue and its corresponding eigenvector are also real valued. `eigsolve` | ||
will automatically return complex valued eigenvectors for reasons of type stability. However, | ||
as the first Schur vector will coincide with the first eigenvector, one can instead use | ||
```julia | ||
T, vecs, vals, info = schursolve(A, x₀, 1, :LM, Arnoldi(...)) | ||
``` | ||
and use `vecs[1]` as the real valued eigenvector (after checking `info.converged`) corresponding | ||
to the largest magnitude eigenvalue of `A`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Details of the implementation | ||
|
||
## Krylov factorizations | ||
The central ingredient in a Krylov based algorithm is a Krylov factorization or decomposition | ||
of a linear map. Such partial factorizations are represented as a `KrylovFactorization`, of | ||
which `LanczosFactorization` and `ArnoldiFactorization` are two concrete implementations: | ||
```@docs | ||
KrylovKit.KrylovFactorization | ||
``` | ||
A `KrylovFactorization` can be destructered into its defining components using iteration, but | ||
these can also be accessed using the following functions | ||
```@docs | ||
basis | ||
rayleighquotient | ||
residual | ||
normres | ||
rayleighextension | ||
``` | ||
|
||
## Krylov iterators | ||
Given a linear map ``A`` and a starting vector ``x₀``, a Krylov factorization is obtained by sequentially | ||
building a Krylov subspace ``{x₀, A x₀, A² x₀, ...}``. Rather then using this set of vectors | ||
as a basis, an orthonormal basis is generated by a process known as Lanczos or Arnoldi iteration | ||
(for symmetric/hermitian and for general matrices, respectively). These processes are represented | ||
as iterators in Julia: | ||
```@docs | ||
KrylovKit.KrylovIterator | ||
``` | ||
The following functions allow to manipulate a `KrylovFactorization` obtained from such a | ||
`KrylovIterator`: | ||
|
||
```@docs | ||
expand! | ||
shrink! | ||
initialize! | ||
initialize | ||
``` | ||
|
||
## Orthogonalization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
## Introduction | ||
The high level interface of KrylovKit is provided by the following functions: | ||
* [`linsolve`](@ref): solve linear systems | ||
* [`eigsolve`](@ref): find a few eigenvalues and corresponding eigenvectors | ||
* [`svdsolve`](@ref): find a few singular values and corresponding left and right singular vectors | ||
* [`exponentiate`](@ref): apply the exponential of a linear map to a vector | ||
|
||
They all follow the standard format | ||
```julia | ||
results..., info = problemsolver(A, args...; kwargs...) | ||
``` | ||
where `problemsolver` is one of the functions above. Here, `A` is the linear map in the problem, | ||
which could be an instance of `AbstractMatrix`, or any function or callable object that encodes | ||
the action of the linear map on a vector. In particular, one can write the linear map using | ||
Julia's `do` block syntax as | ||
```julia | ||
results..., info = method(args...; kwargs...) do x | ||
# implement linear map on x | ||
end | ||
``` | ||
Furthermore, `args` is a set of additional arguments to specify the problem. The keyword arguments | ||
`kwargs` contain information about the linear map (`issymmetric`, `ishermitian`, `isposdef`) and | ||
about the solution strategy (`tol`, `krylovdim`, `maxiter`). A suitable algorithm for the problem | ||
is then chosen. The return value contains one or more entries that define the solution, and a final | ||
entry `info` of type [`ConvergeInfo`](@ref) that encodes information about the solution, i.e. wether it | ||
has converged, the residual(s) and the norm thereof, the number of operations used. | ||
|
||
There is also an expert interface where the user specifies the algorithm that should be used | ||
explicitly, i.e. | ||
```julia | ||
results..., info = method(A, args..., algorithm) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Solving linear systems | ||
|
||
Linear systems are of the form `A*x=b` where `A` should be a linear map that has the same type | ||
of output as input, i.e. the solution `x` should be of the same type as the right hand side `b`. | ||
They can be solved using the function `linsolve`: | ||
|
||
```@docs | ||
linsolve | ||
``` | ||
|
||
Currently supported algorithms are | ||
```@docs | ||
GMRES | ||
``` |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Finding singular values and singular vectors | ||
```@docs | ||
svdsolve | ||
``` |
Oops, something went wrong.