Skip to content

Commit

Permalink
Add six Krylov processes
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison authored Sep 28, 2022
1 parent 100792f commit 426557d
Show file tree
Hide file tree
Showing 17 changed files with 962 additions and 20 deletions.
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ makedocs(
sitename = "Krylov.jl",
pages = ["Home" => "index.md",
"API" => "api.md",
"Krylov processes" => "processes.md",
"Krylov methods" => ["Symmetric positive definite linear systems" => "solvers/spd.md",
"Symmetric indefinite linear systems" => "solvers/sid.md",
"Unsymmetric linear systems" => "solvers/unsymmetric.md",
Expand Down
Binary file added docs/src/graphics/arnoldi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/graphics/golub_kahan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/graphics/hermitian_lanczos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/graphics/montoison_orban.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/graphics/nonhermitian_lanczos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/graphics/saunders_simon_yip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
278 changes: 278 additions & 0 deletions docs/src/processes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
# [Krylov processes](@id krylov-processes)

Krylov processes are the foundation of Krylov methods, they generate bases of Krylov subspaces.

### Notation

Define $V_k := \begin{bmatrix} v_1 & \ldots & v_k \end{bmatrix} \enspace$ and $\enspace U_k := \begin{bmatrix} u_1 & \ldots & u_k \end{bmatrix}$.

For a matrix $C \in \mathbb{C}^{n \times n}$ and a vector $t \in \mathbb{C}^{n}$, the $k$-th Krylov subspace generated by $C$ and $t$ is
```math
\mathcal{K}_k(C, t) :=
\left\{\sum_{i=0}^{k-1} \omega_i C^i t \, \middle \vert \, \omega_i \in \mathbb{C},~0 \le i \le k-1 \right\}.
```

For matrices $C \in \mathbb{C}^{n \times n} \enspace$ and $\enspace T \in \mathbb{C}^{n \times p}$, the $k$-th block Krylov subspace generated by $C$ and $T$ is
```math
\mathcal{K}_k^{\square}(C, T) :=
\left\{\sum_{i=0}^{k-1} C^i T \, \Omega_i \, \middle \vert \, \Omega_i \in \mathbb{C}^{p \times p},~0 \le i \le k-1 \right\}.
```

## Hermitian Lanczos

![hermitian_lanczos](./graphics/hermitian_lanczos.png)

After $k$ iterations of the Hermitian Lanczos process, the situation may be summarized as
```math
\begin{align*}
A V_k &= V_k T_k + \beta_{k+1,k} v_{k+1} e_k^T = V_{k+1} T_{k+1,k}, \\
V_k^H V_k &= I_k,
\end{align*}
```
where $V_k$ is an orthonormal basis of the Krylov subspace $\mathcal{K}_k (A,b)$,
```math
T_k =
\begin{bmatrix}
\alpha_1 & \beta_2 & & \\
\beta_2 & \alpha_2 & \ddots & \\
& \ddots & \ddots & \beta_k \\
& & \beta_k & \alpha_k
\end{bmatrix}
, \qquad
T_{k+1,k} =
\begin{bmatrix}
T_{k} \\
\beta_{k+1} e_{k}^T
\end{bmatrix}.
```
Note that $T_{k+1,k}$ is a real tridiagonal matrix even if $A$ is a complex matrix.

The function [`hermitian_lanczos`](@ref hermitian_lanczos) returns $V_{k+1}$ and $T_{k+1,k}$.

Related methods: [`SYMMLQ`](@ref symmlq), [`CG`](@ref cg), [`CR`](@ref cr), [`MINRES`](@ref minres), [`MINRES-QLP`](@ref minres_qlp), [`CGLS`](@ref cgls), [`CRLS`](@ref crls), [`CGNE`](@ref cgne), [`CRMR`](@ref crmr), [`CG-LANCZOS`](@ref cg_lanczos) and [`CG-LANCZOS-SHIFT`](@ref cg_lanczos_shift).

```@docs
hermitian_lanczos
```

## Non-Hermitian Lanczos

![nonhermitian_lanczos](./graphics/nonhermitian_lanczos.png)

After $k$ iterations of the non-Hermitian Lanczos process (also named the Lanczos biorthogonalization process), the situation may be summarized as
```math
\begin{align*}
A V_k &= V_k T_k + \beta_{k+1} v_{k+1} e_k^T = V_{k+1} T_{k+1,k}, \\
B U_k &= U_k T_k^H + \bar{\gamma}_{k+1} u_{k+1} e_k^T = U_{k+1} T_{k,k+1}^H, \\
V_k^H U_k &= U_k^H V_k = I_k,
\end{align*}
```
where $V_k$ and $U_k$ are bases of the Krylov subspaces $\mathcal{K}_k (A,b)$ and $\mathcal{K}_k (A^H,c)$, respectively,
```math
T_k =
\begin{bmatrix}
\alpha_1 & \gamma_2 & & \\
\beta_2 & \alpha_2 & \ddots & \\
& \ddots & \ddots & \gamma_k \\
& & \beta_k & \alpha_k
\end{bmatrix}
, \qquad
T_{k+1,k} =
\begin{bmatrix}
T_{k} \\
\beta_{k+1} e_{k}^T
\end{bmatrix}
, \qquad
T_{k,k+1} =
\begin{bmatrix}
T_{k} & \gamma_{k+1} e_k
\end{bmatrix}.
```

The function [`nonhermitian_lanczos`](@ref nonhermitian_lanczos) returns $V_{k+1}$, $T_{k+1,k}$, $U_{k+1}$ and $T_{k,k+1}^H$.

Related methods: [`BiLQ`](@ref bilq), [`QMR`](@ref qmr), [`BiLQR`](@ref bilqr), [`CGS`](@ref cgs) and [`BICGSTAB`](@ref bicgstab).

!!! note
The scaling factors used in our implementation are $\beta_k = |u_k^H v_k|^{\tfrac{1}{2}}$ and $\gamma_k = (u_k^H v_k) / \beta_k$.

```@docs
nonhermitian_lanczos
```

## Arnoldi

![arnoldi](./graphics/arnoldi.png)

After $k$ iterations of the Arnoldi process, the situation may be summarized as
```math
\begin{align*}
A V_k &= V_k H_k + h_{k+1,k} v_{k+1} e_k^T = V_{k+1} H_{k+1,k}, \\
V_k^H V_k &= I_k,
\end{align*}
```
where $V_k$ is an orthonormal basis of the Krylov subspace $\mathcal{K}_k (A,b)$,
```math
H_k =
\begin{bmatrix}
h_{1,1}~ & h_{1,2}~ & \ldots & h_{1,k} \\
h_{2,1}~ & \ddots~ & \ddots & \vdots \\
& \ddots~ & \ddots & h_{k-1,k} \\
& & h_{k,k-1} & h_{k,k}
\end{bmatrix}
, \qquad
H_{k+1,k} =
\begin{bmatrix}
H_{k} \\
h_{k+1,k} e_{k}^T
\end{bmatrix}.
```

The function [`arnoldi`](@ref arnoldi) returns $V_{k+1}$ and $H_{k+1,k}$.

Related methods: [`DIOM`](@ref diom), [`FOM`](@ref fom), [`DQGMRES`](@ref dqgmres) and [`GMRES`](@ref gmres).


```@docs
arnoldi
```

## Golub-Kahan

![golub_kahan](./graphics/golub_kahan.png)

After $k$ iterations of the Golub-Kahan bidiagonalization process, the situation may be summarized as
```math
\begin{align*}
A V_k &= U_{k+1} B_k, \\
A^H U_{k+1} &= V_k B_k^H + \alpha_{k+1} v_{k+1} e_{k+1}^T = V_{k+1} L_{k+1}^H, \\
V_k^H V_k &= U_k^H U_k = I_k,
\end{align*}
```
where $V_k$ and $U_k$ are bases of the Krylov subspaces $\mathcal{K}_k (A^HA,A^Hb)$ and $\mathcal{K}_k (AA^H,b)$, respectively,
```math
L_k =
\begin{bmatrix}
\alpha_1 & & & \\
\beta_2 & \alpha_2 & & \\
& \ddots & \ddots & \\
& & \beta_k & \alpha_k
\end{bmatrix}
, \qquad
B_k =
\begin{bmatrix}
\alpha_1 & & & \\
\beta_2 & \alpha_2 & & \\
& \ddots & \ddots & \\
& & \beta_k & \alpha_k \\
& & & \beta_{k+1} \\
\end{bmatrix}
=
\begin{bmatrix}
L_{k} \\
\beta_{k+1} e_{k}^T
\end{bmatrix}.
```
Note that $L_k$ is a real bidiagonal matrix even if $A$ is a complex matrix.

The function [`golub_kahan`](@ref golub_kahan) returns $V_{k+1}$, $U_{k+1}$ and $L_{k+1}$.

Related methods: [`LNLQ`](@ref lnlq), [`CRAIG`](@ref craig), [`CRAIGMR`](@ref craigmr), [`LSLQ`](@ref lslq), [`LSQR`](@ref lsqr) and [`LSMR`](@ref lsmr).

```@docs
golub_kahan
```

## Saunders-Simon-Yip

![saunders_simon_yip](./graphics/saunders_simon_yip.png)

After $k$ iterations of the Saunders-Simon-Yip process (also named the orthogonal tridiagonalization process), the situation may be summarized as
```math
\begin{align*}
A U_k &= V_k T_k + \beta_{k+1} v_{k+1} e_k^T = V_{k+1} T_{k+1,k}, \\
B V_k &= U_k T_k^H + \gamma_{k+1} u_{k+1} e_k^T = U_{k+1} T_{k,k+1}^H, \\
V_k^H V_k &= U_k^H U_k = I_k,
\end{align*}
```
where $\begin{bmatrix} V_k & 0 \\ 0 & U_k \end{bmatrix}$ is an orthonormal basis of the block Krylov subspace $\mathcal{K}^{\square}_k \left(\begin{bmatrix} 0 & A \\ A^H & 0 \end{bmatrix}, \begin{bmatrix} b & 0 \\ 0 & c \end{bmatrix}\right)$,
```math
T_k =
\begin{bmatrix}
\alpha_1 & \gamma_2 & & \\
\beta_2 & \alpha_2 & \ddots & \\
& \ddots & \ddots & \gamma_k \\
& & \beta_k & \alpha_k
\end{bmatrix}
, \qquad
T_{k+1,k} =
\begin{bmatrix}
T_{k} \\
\beta_{k+1} e_{k}^T
\end{bmatrix}
, \qquad
T_{k,k+1} =
\begin{bmatrix}
T_{k} & \gamma_{k+1} e_{k}
\end{bmatrix}.
```

The function [`saunders_simon_yip`](@ref saunders_simon_yip) returns $V_{k+1}$, $T_{k+1,k}$, $U_{k+1}$ and $T_{k,k+1}^H$.

Related methods: [`USYMLQ`](@ref usymlq), [`USYMQR`](@ref usymqr), [`TriLQR`](@ref trilqr), [`TriCG`](@ref tricg) and [`TriMR`](@ref trimr).

```@docs
saunders_simon_yip
```

## Montoison-Orban

![montoison_orban](./graphics/montoison_orban.png)

After $k$ iterations of the Montoison-Orban process (also named the orthogonal Hessenberg reduction process), the situation may be summarized as
```math
\begin{align*}
A U_k &= V_k H_k + h_{k+1,k} v_{k+1} e_k^T = V_{k+1} H_{k+1,k}, \\
B V_k &= U_k F_k + f_{k+1,k} u_{k+1} e_k^T = U_{k+1} F_{k+1,k}, \\
V_k^H V_k &= U_k^H U_k = I_k,
\end{align*}
```
where $\begin{bmatrix} V_k & 0 \\ 0 & U_k \end{bmatrix}$ is an orthonormal basis of the block Krylov subspace $\mathcal{K}^{\square}_k \left(\begin{bmatrix} 0 & A \\ B & 0 \end{bmatrix}, \begin{bmatrix} b & 0 \\ 0 & c \end{bmatrix}\right)$,
```math
H_k =
\begin{bmatrix}
h_{1,1}~ & h_{1,2}~ & \ldots & h_{1,k} \\
h_{2,1}~ & \ddots~ & \ddots & \vdots \\
& \ddots~ & \ddots & h_{k-1,k} \\
& & h_{k,k-1} & h_{k,k}
\end{bmatrix}
, \qquad
F_k =
\begin{bmatrix}
f_{1,1}~ & f_{1,2}~ & \ldots & f_{1,k} \\
f_{2,1}~ & \ddots~ & \ddots & \vdots \\
& \ddots~ & \ddots & f_{k-1,k} \\
& & f_{k,k-1} & f_{k,k}
\end{bmatrix},
```
```math
H_{k+1,k} =
\begin{bmatrix}
H_{k} \\
h_{k+1,k} e_{k}^T
\end{bmatrix}
, \qquad
F_{k+1,k} =
\begin{bmatrix}
F_{k} \\
f_{k+1,k} e_{k}^T
\end{bmatrix}.
```

The function [`montoison_orban`](@ref montoison_orban) returns $V_{k+1}$, $H_{k+1,k}$, $U_{k+1}$ and $F_{k+1,k}$.

Related methods: [`GPMR`](@ref gpmr).

```@docs
montoison_orban
```
1 change: 1 addition & 0 deletions src/Krylov.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ using LinearAlgebra, SparseArrays, Printf
include("krylov_utils.jl")
include("krylov_stats.jl")
include("krylov_solvers.jl")
include("krylov_processes.jl")

include("cg.jl")
include("cr.jl")
Expand Down
Loading

0 comments on commit 426557d

Please sign in to comment.