Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion cleared-demos/eigenvalue/Householder Similarity Transforms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]
},
{
Expand Down
26 changes: 25 additions & 1 deletion demos/eigenvalue/Householder Similarity Transforms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]
},
{
Expand Down