diff --git a/cleared-demos/eigenvalue/Householder Similarity Transforms.ipynb b/cleared-demos/eigenvalue/Householder Similarity Transforms.ipynb index 4d2d1b4..0eb6563 100644 --- a/cleared-demos/eigenvalue/Householder Similarity Transforms.ipynb +++ b/cleared-demos/eigenvalue/Householder Similarity Transforms.ipynb @@ -115,7 +115,31 @@ "\n", "## Starting in the second row\n", "\n", - "To avoid this, we define the Householder transformation to annihilate elements below the first subdiagonal. That way, the first transformation does not affect the first row when applied from the left, and consequently does not affect the first column when applied for the right, preserving the zeros we've annihilated." + "To avoid this, we define the Householder transformation to annihilate elements below the first subdiagonal. That way, the first transformation does not affect the first row when applied from the left, and consequently does not affect the first column when applied for the right, preserving the zeros we've annihilated.\n", + "\n", + "For example, we would build the first Householder reflection, $H_1$, such that:\n", + "\n", + "$$\n", + "H_1 \\begin{pmatrix}A_{11} \\\\ A_{21} \\\\ A_{31} \\\\ \\vdots & \\end{pmatrix} = \n", + "\\begin{pmatrix}A_{11} \\\\ \\sqrt{A_{21}^2 + A_{31}^2 + \\cdots} \\\\ 0 \\\\ \\vdots \\end{pmatrix}\n", + "$$\n", + "In order to preserve the first element, the first _row_ of $H_1$ should be $e_1^T$. Because all the rows are orthogonal, every subsequent row has a zero in the first index. Let's apply this to $H_1 A$,\n", + "$$\n", + "H_1 A = \n", + "\\begin{pmatrix}1 & 0 & 0 & \\cdots \\\\ 0 & * & * & \\cdots \\\\ 0 & * & * & \\cdots \\\\ \\vdots & \\vdots & \\vdots & \\ddots \\end{pmatrix} \\begin{pmatrix}A_{11} & A_{12} & A_{13} & \\cdots \\\\ A_{21} & A_{22} & A_{23} & \\cdots \\\\ A_{31} & A_{32} & A_{33} & \\cdots \\\\ \\vdots & \\vdots & \\vdots & \\ddots \\end{pmatrix} = \n", + "\\begin{pmatrix}A_{11} & A_{12} & A_{13} & \\cdots \\\\ \\sqrt{A_{21}^2 + A_{31}^2 + \\cdots} & * & * & \\cdots \\\\ 0 & * & * & \\cdots \\\\ \\vdots & \\vdots & \\vdots & \\ddots \\end{pmatrix}\n", + "$$\n", + "\n", + "where * can be any real number; everything outside of the first row and column could change. Now taking $(H_1A) \\cdot H_1^T$, we have\n", + "\n", + "$$\n", + "(H_1A) H_1^T = \n", + "\\begin{pmatrix}A_{11} & A_{12} & A_{13} & \\cdots \\\\ \\sqrt{A_{21}^2 + A_{31}^2 \\cdots} & * & * & \\cdots \\\\ 0 & * & * & \\cdots \\\\ \\vdots & \\vdots & \\vdots & \\ddots \\end{pmatrix}\n", + "\\begin{pmatrix}1 & 0 & 0 & \\cdots \\\\ 0 & * & * & \\cdots \\\\ 0 & * & * & \\cdots \\\\ \\vdots & \\vdots & \\vdots & \\ddots \\end{pmatrix} = \n", + "\\begin{pmatrix}A_{11} & * & * & \\cdots \\\\ \\sqrt{A_{21}^2 + A_{31}^2 \\cdots} & * & * & \\cdots \\\\ 0 & * & * & \\cdots \\\\ \\vdots & \\vdots & \\vdots & \\ddots \\end{pmatrix}\n", + "$$\n", + "\n", + "i.e., the first column of $H_1AH_1^T$ is preserved from $H_1A$, and everything else can change." ] }, { diff --git a/demos/eigenvalue/Householder Similarity Transforms.ipynb b/demos/eigenvalue/Householder Similarity Transforms.ipynb index b4967da..3d57e0d 100644 --- a/demos/eigenvalue/Householder Similarity Transforms.ipynb +++ b/demos/eigenvalue/Householder Similarity Transforms.ipynb @@ -178,7 +178,31 @@ "\n", "## Starting in the second row\n", "\n", - "To avoid this, we define the Householder transformation to annihilate elements below the first subdiagonal. That way, the first transformation does not affect the first row when applied from the left, and consequently does not affect the first column when applied for the right, preserving the zeros we've annihilated." + "To avoid this, we define the Householder transformation to annihilate elements below the first subdiagonal. That way, the first transformation does not affect the first row when applied from the left, and consequently does not affect the first column when applied for the right, preserving the zeros we've annihilated.\n", + "\n", + "For example, we would build the first Householder reflection, $H_1$, such that:\n", + "\n", + "$$\n", + "H_1 \\begin{pmatrix}A_{11} \\\\ A_{21} \\\\ A_{31} \\\\ \\vdots & \\end{pmatrix} = \n", + "\\begin{pmatrix}A_{11} \\\\ \\sqrt{A_{21}^2 + A_{31}^2 + \\cdots} \\\\ 0 \\\\ \\vdots \\end{pmatrix}\n", + "$$\n", + "In order to preserve the first element, the first _row_ of $H_1$ should be $e_1^T$. Because all the rows are orthogonal, every subsequent row has a zero in the first index. Let's apply this to $H_1 A$,\n", + "$$\n", + "H_1 A = \n", + "\\begin{pmatrix}1 & 0 & 0 & \\cdots \\\\ 0 & * & * & \\cdots \\\\ 0 & * & * & \\cdots \\\\ \\vdots & \\vdots & \\vdots & \\ddots \\end{pmatrix} \\begin{pmatrix}A_{11} & A_{12} & A_{13} & \\cdots \\\\ A_{21} & A_{22} & A_{23} & \\cdots \\\\ A_{31} & A_{32} & A_{33} & \\cdots \\\\ \\vdots & \\vdots & \\vdots & \\ddots \\end{pmatrix} = \n", + "\\begin{pmatrix}A_{11} & A_{12} & A_{13} & \\cdots \\\\ \\sqrt{A_{21}^2 + A_{31}^2 + \\cdots} & * & * & \\cdots \\\\ 0 & * & * & \\cdots \\\\ \\vdots & \\vdots & \\vdots & \\ddots \\end{pmatrix}\n", + "$$\n", + "\n", + "where * can be any real number; everything outside of the first row and column could change. Now taking $(H_1A) \\cdot H_1^T$, we have\n", + "\n", + "$$\n", + "(H_1A) H_1^T = \n", + "\\begin{pmatrix}A_{11} & A_{12} & A_{13} & \\cdots \\\\ \\sqrt{A_{21}^2 + A_{31}^2 \\cdots} & * & * & \\cdots \\\\ 0 & * & * & \\cdots \\\\ \\vdots & \\vdots & \\vdots & \\ddots \\end{pmatrix}\n", + "\\begin{pmatrix}1 & 0 & 0 & \\cdots \\\\ 0 & * & * & \\cdots \\\\ 0 & * & * & \\cdots \\\\ \\vdots & \\vdots & \\vdots & \\ddots \\end{pmatrix} = \n", + "\\begin{pmatrix}A_{11} & * & * & \\cdots \\\\ \\sqrt{A_{21}^2 + A_{31}^2 \\cdots} & * & * & \\cdots \\\\ 0 & * & * & \\cdots \\\\ \\vdots & \\vdots & \\vdots & \\ddots \\end{pmatrix}\n", + "$$\n", + "\n", + "i.e., the first column of $H_1AH_1^T$ is preserved from $H_1A$, and everything else can change." ] }, {