Gauss-Seidel iteration can diverge for an invertible matrix (source code)

= Gauss-Seidel iteration can diverge for an invertible matrix
{c}
{title2=$\rho(H)=4$}

An <invertible matrix> and nonzero diagonal entries make the update well defined, but do not guarantee convergence. For the original <linear system>
$$
A=\begin{pmatrix}1&2\\2&1\end{pmatrix},\qquad b=\begin{pmatrix}1\\1\end{pmatrix},\qquad x_*=\begin{pmatrix}1/3\\1/3\end{pmatrix},\qquad \det A=-3,
$$
the <Gauss-Seidel method> updates $x^{(k+1)}=1-2y^{(k)}$ and $y^{(k+1)}=1-2x^{(k+1)}=-1+4y^{(k)}$. Starting at zero gives $(1,-1)$, then $(3,-5)$. The second-coordinate <forward error> is $e_y^{(k)}=-4^k/3$, and the <iteration matrix> $H=\begin{pmatrix}0&-2\\0&4\end{pmatrix}$ has <spectral radius> $4$. The <linear system> has a unique solution while this particular <stationary iterative method for a linear system> diverges.