|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "metadata": {}, |
| 6 | + "source": [ |
| 7 | + "# Documentation \n", |
| 8 | + "**Disclaimer**: *this document is not meant to be neither a formal nor an exhaustive description of the iterative method to solve the eigenvalue problem. The aim of this text is only to provide the necessary and minimal information needed for the reader to understand the code implementation. We will use these pages to document, explain and justify the choice made from a numerical and scientific computing standpoint*.\n", |
| 9 | + "\n", |
| 10 | + "## Problem statement\n", |
| 11 | + "Given a matrix $\\boldsymbol{A} \\in \\mathbb{C}^{n, n}$, with $n \\in \\mathbb{N}$ the matrix dimension, the eigenvalue problem can be formulated as finding the eigenpair $\\{(\\lambda_i, \\boldsymbol{v}_i)\\}_{i=1} ^ n$, with $\\lambda_i \\in \\mathbb{C}$, $\\boldsymbol{v}_i \\in \\mathbb{C}^{n ,1}$ and $\\boldsymbol{v}_i \\ne \\boldsymbol{0}$ such that \n", |
| 12 | + "$$\\boldsymbol{A} \\boldsymbol{v}_i = \\lambda_i \\boldsymbol{v}_i, \\quad i=1, 2, ..., n $$\n", |
| 13 | + "\n", |
| 14 | + "$\\lambda_i$ are called eigenvalue, while $\\boldsymbol{v}_i$ are the corresponding eigenvectors. Theoretically, finding the matrix's eigenvalue is possible by imposing the following condition:\n", |
| 15 | + "$$ \\det(A-\\lambda I)=0 $$\n", |
| 16 | + "which lead to the well known characteristic polynomial of degree $n$. The eigenvalue are the roots of the characteristic polynomial. Although correct, this apporach is not viable, due to the difficulties in both expressing the characteristic polynomial and find its roots, when the Matrix gets very large.\n", |
| 17 | + "\n", |
| 18 | + "Numerical methods takle the eigenproblem using a different strategy, most of the time being a iterative methods. Rather than aspire to get the exact solution, they seek after an approximation of the solution, which hopefully, under a set of conditions, converges to the exact solution.\n", |
| 19 | + "Among all the method devolped to solve the eigenproblem, the power method, along with its variants suct that the inverse power method and power method with shift, and the QR are the widest spread and the most used.\n", |
| 20 | + "\n", |
| 21 | + "## Power method\n", |
| 22 | + "Let $\\boldsymbol{A}$ being a matric and $\\lambda _i$ the eigenvalue already sorted accordingly to their module. If\n", |
| 23 | + "$$ |\\lambda_1| > |\\lambda _i | \\quad i=2, 3, ..., n$$\n", |
| 24 | + "then the power method allow to recover the eigenpair $(\\lambda_1, \\boldsymbol{v}_1)$ by applying iteratively, the following steps\n", |
| 25 | + "\n", |
| 26 | + "\n", |
| 27 | + "$$\n", |
| 28 | + "\\begin{array}{l}\n", |
| 29 | + "\\textbf{Power Method Algorithm} \\\\\n", |
| 30 | + "\\textbf{Input:} A \\in \\mathbb{C}^{n \\times n}, \\text{initial vector } x_0, \\text{ tolerance } \\text{tol}, \\text{ max iterations } \\text{max\\_iter} \\\\\n", |
| 31 | + "\\textbf{Output:} \\lambda \\text{ (dominant eigenvalue approximation), } x \\text{ (eigenvector approximation)} \\\\\n", |
| 32 | + "\n", |
| 33 | + "1.\\ \\text{Initialize } x = x_0 \\text{ (random or chosen guess)} \\\\\n", |
| 34 | + "2.\\ \\text{Normalize } x \\text{: } y^{(1)} = x/ \\| x\\| \\\\\n", |
| 35 | + "3.\\ \\lambda_{\\text{old}} = 0 \\\\\n", |
| 36 | + "\n", |
| 37 | + "4.\\ \\textbf{for } k = 1 \\textbf{ to } \\text{max\\_iter} \\textbf{ do} \\\\\n", |
| 38 | + "\\quad 5.\\ x^{(k+1)} = A \\cdot y^{(k)} \\\\\n", |
| 39 | + "\\quad 6.\\ y^{(k+1)} = x^{(k+1)}/ \\| x^{(k+1)}\\| \\\\\n", |
| 40 | + "\\quad 7.\\ \\lambda^{(k+1)} = (y^{(k+1)})^H \\boldsymbol{A} y^{(k+1)} \\\\\n", |
| 41 | + "\\quad 8.\\ \\textbf{if } |\\lambda^{(k+1)} - \\lambda^{(k)}| < \\text{tol} \\textbf{ then} \\\\\n", |
| 42 | + "\\quad \\quad \\text{Break (convergence reached)} \\\\\n", |
| 43 | + "\n", |
| 44 | + "9.\\ \\textbf{Return } \\lambda, x\n", |
| 45 | + "\\end{array}\n", |
| 46 | + "$$\n", |
| 47 | + "\n", |
| 48 | + "By exploiting Matrix properties, it is also possible to find the eigenvalue with the smallest norm, and its associated eigenvector, or either the the eigenvalue closest to a given number.\n", |
| 49 | + "\n", |
| 50 | + "## QR algorithm\n", |
| 51 | + "Being the problem we are interested in to solve incolve a symmetric Matrix, we will start introduce the QR alforithm in a general way and specialize it for the case of symmetric matrices as soon as we have the chance.\n", |
| 52 | + "\n", |
| 53 | + "The QR algorithm can be divide in to two stages: during the first stage, the matrix is reduced, by means of similar trasformation, into a Hessemberg matrix, or, for Hermetian matrix, into a tridiagonal matrix. Although the QR algorithm can be applied directly to a full matrix, it converges faster if it is applied to Hessemberg Matrix or triagular matrices, with also a smaller computational cost.\n" |
| 54 | + ] |
| 55 | + } |
| 56 | + ], |
| 57 | + "metadata": { |
| 58 | + "kernelspec": { |
| 59 | + "display_name": "Python 3", |
| 60 | + "language": "python", |
| 61 | + "name": "python3" |
| 62 | + }, |
| 63 | + "language_info": { |
| 64 | + "name": "python", |
| 65 | + "version": "3.12.7" |
| 66 | + } |
| 67 | + }, |
| 68 | + "nbformat": 4, |
| 69 | + "nbformat_minor": 2 |
| 70 | +} |
0 commit comments