6.694395 seconds
Cours ENPC — Pratique du calcul scientifique
$$
% % %
%
$$
\[ \definecolor{gris_C}{RGB}{96,96,96} \definecolor{blanc_C}{RGB}{255,255,255} \definecolor{pistache_C}{RGB}{176,204,78} \definecolor{pistache2_C}{RGB}{150,171,91} \definecolor{jaune_C}{RGB}{253,235,125} \definecolor{jaune2_C}{RGB}{247,208,92} \definecolor{orange_C}{RGB}{244,157,84} \definecolor{orange2_C}{RGB}{239,119,87} \definecolor{bleu_C}{RGB}{126,151,206} \definecolor{bleu2_C}{RGB}{90,113,180} \definecolor{vert_C}{RGB}{96,180,103} \definecolor{vert2_C}{RGB}{68,141,96} \definecolor{pistache_light_C}{RGB}{235,241,212} \definecolor{jaune_light_C}{RGB}{254,250,224} \definecolor{orange_light_C}{RGB}{251,230,214} \definecolor{bleu_light_C}{RGB}{222,229,241} \definecolor{vert_light_C}{RGB}{216,236,218} \]
Goal of this chapter
Study numerical methods to find the eigenpairs \((\mathbf{\boldsymbol{v}}_i, \mathbf{\boldsymbol{\lambda}}_i)\) satisfying \[ \mathsf A \mathbf{\boldsymbol{v}} = \lambda \mathbf{\boldsymbol{v}}, \] where \(\mathsf A \in \mathbf C^{n \times n}\) and \(b \in \mathbf C^n.\)
\(~\)
Simple vector iterations, for calculating just one eigenpair;
Subspace iterations: generalization to calculate multiple eigenpairs at the same time;
Projection methods: approximate large eigenvalue problem by a smaller one.
Remark: can we calculate the eigenvalues as roots of the characteristic polynomial?
Cost of calculating the characteristic polynomial scales as \({\color{red}n!}\)
\({\color{green} \rightarrow}\) not a viable approach…
Before we begin:
We present a motivating example;
We discuss sparse matrix formats
Consider a random walk on the graph:
Assumption: jumps to adjacent nodes equi-probable.
The associated adjacency matrix \(\mathsf A \in \{0, 1\}^{n \times n}\) is given by \[ a_{ij} = \begin{cases} 1 & \text{if there is an edge between $i$ and $j$,} \\ 0 & \text{otherwise.} \end{cases} \]
\(~\)
Probability of transition \(i \rightarrow j\) given by \[ p_{ij} = \frac{a_{ij}}{n_e(i)}, \] where \(n_e(i)\) is the number of edges connected to node \(i\).
\({\color{green} \rightarrow}\) note that \(\mathsf A\) is symmetric but \(\mathsf P := (p_{ij})\) is not.
\(~\)
Steady state probability distribution \(\mathbf{\boldsymbol{v}}_1 \in \mathbf R_{\geqslant 0}^n\) satisfies \[ \mathsf P^T\mathbf{\boldsymbol{v}}_1 = \mathbf{\boldsymbol{v}}_1, \qquad \mathbf{\boldsymbol{1}}^T\mathbf{\boldsymbol{v}}_1 = 1. \] (it is possible to show that \(1\) is the dominant eigenvalue)
\({\color{green} \rightarrow}\) eigenvalue problem for matrix \(\mathsf P^T\).
function adj(m)
x = vcat([collect(0:i) for i in 0:m-1]...)
y = vcat([fill(m-i, i) for i in 1:m]...)
row_lengths = 1:m
row_indices = [0; cumsum(row_lengths)]
A = zeros(Int, length(x), length(x))
for i in 1:m-1
for j in 1:row_lengths[i]
r1 = row_indices[i]
r2 = row_indices[i+1]
A[r2 + j, r2 + j + 1] = 1 # Horizontal
A[r1 + j, r2 + j] = 1 # Vertical
A[r1 + j, r2 + j + 1] = 1 # Diagonal
end
end
x, y, A + A'
endHere ... is the splat operator (?... for more info)
Steady state probability distribution satisfies \[ \mathsf P^T\mathbf{\boldsymbol{v}}_1 = \mathbf{\boldsymbol{v}}_1 \]
Strategy for finding \(\mathbf{\boldsymbol{v}}_1\): evolve probability vector until equilibrium: \[ \mathbf{\boldsymbol{x}}^{(k+1)} = \mathsf P^T\mathbf{\boldsymbol{x}}^{(k)} \qquad \Leftrightarrow \qquad x^{(k+1)}_i = \sum_{j=1}^{n_n} p_{ji} x^{(k)}_j \]
\(x^{(k)}_i\) is the probability of being at node \(i\) at iteration \(k\);
This is an example of the power iteration;
Below we take \(\mathbf{\boldsymbol{x}}^{(0)} = \mathbf{\boldsymbol{e}}_1\).