Source: /cirosantilli/eigendecomposition-of-a-matrix

= Eigendecomposition of a matrix
{wiki}

= Eigendecomposition
{synonym}

Every <invertible matrix> $M$ can be written as:
$$
M = QDQ^{-1}
$$
where:
* $D$ is a <diagonal matrix> containing the <eigenvalues> of $M$
* columns of $Q$ are <eigenvectors> of $M$
Note therefore that this decomposition is unique up to swapping the order of eigenvectors. We could fix a canonical form by sorting eigenvectors from smallest to largest in the case of a <real number>.

Intuitively, Note that this is just the \x[change of basis]{magic} formula, and so:
* $Q^{-1}$ changes basis to align to the eigenvectors
* $D$ multiplies eigenvectors simply by eigenvalues
* $Q$ changes back to the original basis