# Jacobi's Rotation has two possibilities, why do they both result in same upper triangular magnitude norm?

The Jacobi's rotation is the complex Givens rotation (unitary similarity) that results in a zero for a specified element of a matrix. If the element is not adjacent to the diagonal, then there are rows/columns below the diagonal that mix with rows/columns above the diagonal. Here is the general form (where eventually $x$ will be the element to zero):

\begin{align} & \pmatrix{c & \mathbf{0} & s \\ \mathbf{0}^\top & \mathbf{I} & \mathbf{0}^\top \\ -\bar{s} & \mathbf{0} & \bar{c} \\ } \pmatrix{d_0 & \mathbf{g} & x \\ \mathbf{a}^\top & \mathbf{D} & \mathbf{b}^\top \\ y & \mathbf{h} & d_1 \\ } \pmatrix{\bar{c} & \mathbf{0} & -s \\ \mathbf{0}^\top & \mathbf{I} & \mathbf{0}^\top \\ \bar{s} & \mathbf{0} & c \\ } \\ =& \pmatrix{c & \mathbf{0} & s \\ \mathbf{0}^\top & \mathbf{I} & \mathbf{0}^\top \\ -\bar{s} & \mathbf{0} & \bar{c} \\ } \pmatrix{d_0\bar{c}+x\bar{s} & \mathbf{g} & -d_0 s + x c \\ \mathbf{a}^\top\bar{c} + \mathbf{b}^\top\bar{s}& \mathbf{D} & -\mathbf{a}^\top s + \mathbf{b}^\top c \\ y \bar{c} + d_1 \bar{s} & \mathbf{h} & -y s + d_1 c \\ } \\ =& \pmatrix{d_0c\bar{c} + d_1s\bar{s} + c\bar{s}x + \bar{c}sy & c\mathbf{g}+ s\mathbf{h} & (d_1 - d_0)cs + x c^2 - ys^2 \\ \mathbf{a}^\top \bar{c} + \mathbf{b}^\top \bar{s} & \mathbf{D} & -\mathbf{a}^\top s + \mathbf{b}^\top c \\ (d_1 -d_0)\bar{c}\bar{s} -x\bar{s}^2 + y\bar{c}^2 & -\bar{s}\mathbf{g} + \bar{c}\mathbf{h} & d_0s\bar{s} + d_1c\bar{c} - c\bar{s}x - \bar{c}sy } \end{align}

Specifically $\mathbf{g} \leftarrow c\mathbf{g}+ s\mathbf{h}$, so that row vector $\mathbf{g}$ is mixed with row vector $\mathbf{h}$.

Now solving for $c$ and $s$ in the complex numbers that give $x \leftarrow 0$ results in two solutions. Both of which end with the same magnitude in the upper triangular portion $$\Vert \mathbf{g} \Vert^2 + \Vert \mathbf{b} \Vert^2 \quad\text{is same for both solutions that give x=0}$$

I have yet to find the formulation that shows this, but multiple experimentation has yet to fail.

EDIT I have made a silly mistake in that all tests were done on Hermitian matrices. Now I guess I solved my question, but any discussions or error corrections are welcome...

Here is the formula for the rotation:

\begin{align} \delta &= d_1 - d_0 \\ \Delta &= \pm\sqrt{\delta^2 + 4xy} \\ k^2 &= \delta\bar{\delta} + \delta\bar{\Delta} + \bar{\delta}\Delta + \Delta\bar{\Delta} +4y\bar{y}\\ c & = \frac{2y}{k} \\ s & = \frac{\delta + \Delta}{k} \\ \end{align}

The following is the derivation.

Using $d_1 - d_0 = \delta$, the top right element is desired to be zero

$$\delta cs + x c^2 - ys^2 = 0$$

Use the substitution $$\alpha = \frac{s}{c}$$ then \begin{align} \delta c^2\alpha + x c^2 - y\alpha^2c^2 = c^2\left(\delta\alpha + x - y\alpha^2\right) = 0 \end{align}

The equation $\delta\alpha + x - y\alpha^2=0$ is easily solved using the quadratic formula: $$\alpha = \frac{-\delta \pm \sqrt{\delta^2 - 4(-y)x}}{2(-y)} = \frac{\delta \mp \sqrt{\delta^2 + 4xy}}{2y} = \frac{k\cdot s}{k\cdot c}$$ Here $k$ is the real and non-zero scale factor that gives $c\bar{c} + s\bar{s} = 1$.
Denote $\Delta = \pm\sqrt{\delta^2 + 4xy}$. Then we have \begin{align} c &= \frac{2y}{k} \\ s &= \frac{\delta+\Delta}{k} \\ s\bar{s} + c\bar{c} &= \frac{(\delta+\Delta)(\bar{\delta} + \bar{\Delta}) + 4y\bar{y}}{k^2} = 1 \\ \Rightarrow k^2 &= \delta\bar{\delta} + \delta\bar{\Delta} + \bar{\delta}\Delta + \Delta\bar{\Delta} +4y\bar{y}\\ \end{align} This formulation gives the desired results for both $\pm\Delta$ (as is confirmed with computations).

Now looking at the magnitude $\Vert c\mathbf{g}+ s\mathbf{h} \Vert^2 + \Vert c\mathbf{b} -s\mathbf{a} \Vert^2$ we have

\begin{align} \Vert c\mathbf{g}+ s\mathbf{h} \Vert^2 + \Vert c\mathbf{b} -s\mathbf{a} \Vert^2 = & (c\mathbf{g}+ s\mathbf{h} )(\bar{\mathbf{g}}^\top \bar{c}+ \bar{\mathbf{h}}^\top\bar{s}) \\ & + (c\mathbf{b} - s\mathbf{a} )(\bar{\mathbf{b}}^\top \bar{c} - \bar{\mathbf{a}}^\top\bar{s})\\ = & c\bar{c}\mathbf{g}\bar{\mathbf{g}}^\top + s\bar{s}\mathbf{h}\bar{\mathbf{h}}^\top + \bar{c}s\mathbf{h}\bar{\mathbf{g}}^\top + c\bar{s}\mathbf{g}\bar{\mathbf{h}}^\top\\ & + c\bar{c}\mathbf{b}\bar{\mathbf{b}}^\top + s\bar{s}\mathbf{a}\bar{\mathbf{a}}^\top - \bar{c}s\mathbf{a}\bar{\mathbf{b}}^\top - c\bar{s}\mathbf{b}\bar{\mathbf{a}}^\top \\ = & c\bar{c}(\underbrace{\mathbf{g}\bar{\mathbf{g}}^\top + \mathbf{b}\bar{\mathbf{b}}^\top}_{\omega}) + s\bar{s}(\underbrace{\mathbf{h}\bar{\mathbf{h}}^\top + \mathbf{a}\bar{\mathbf{a}}^\top}_{\theta}) + \bar{c}s(\underbrace{\mathbf{h}\bar{\mathbf{g}}^\top - \mathbf{a}\bar{\mathbf{b}}^\top}_{\mu}) + c\bar{s}(\underbrace{\mathbf{g}\bar{\mathbf{h}}^\top - \mathbf{b}\bar{\mathbf{a}}^\top}_{\bar{\mu}}) \\ = & c\bar{c}\omega + s\bar{s}\theta + \bar{c}s\mu + c\bar{s}\bar{\mu} \end{align}

EXPERIMENT SHOWS that this magnitude is constant with choice of $\pm\Delta$

What is even more confounding to me is that when $x=0$ is true already, and the non trivial rotation that retains the zero is performed, in THAT case the magnitude does indeed change. Yet should it not be the same if the two choices from the original position of $x \ne 0$ give no change?

The non-trivial rotation that retains the zero (and which actually gives a diagonal swap $d_0 \leftrightarrow d_1$ and $y \leftarrow \bar{y}$): \begin{align} \delta cs + x c^2 - ys^2 &= s(\delta c + 0 - ys) = 0\\ \Rightarrow \frac{k\cdot s}{k\cdot c} &= \frac{\delta}{y} \\ c & = \frac{y}{k} \\ s & = \frac{\delta}{k} \\ k^2 & = y\bar{y} + \delta\bar{\delta} \\ \end{align}

The magnitude $c\bar{c}\omega + s\bar{s}\theta + \bar{c}s\mu + c\bar{s}\bar{\mu}$ then is $$\frac{y\bar{y}\omega + \delta\bar{\delta}\theta + \bar{y}\delta\mu + y\bar{\delta}\bar{\mu}}{k^2} = \frac{y\bar{y}\omega + \delta\bar{\delta}\theta + \bar{y}\delta\mu + y\bar{\delta}\bar{\mu}}{y\bar{y} + \delta\bar{\delta}}$$

The change in the upper triangular norm then is

\begin{align} & \frac{y\bar{y}\omega + \delta\bar{\delta}\theta + \bar{y}\delta\mu + y\bar{\delta}\bar{\mu}}{y\bar{y} + \delta\bar{\delta}} - \omega \\ = & \frac{y\bar{y}\omega + \delta\bar{\delta}\theta + \bar{y}\delta\mu + y\bar{\delta}\bar{\mu}-\omega(y\bar{y} + \delta\bar{\delta})}{y\bar{y} + \delta\bar{\delta}} =\frac{N}{D}\\ N = & y\bar{y}\omega + \delta\bar{\delta}\theta + \bar{y}\delta\mu + y\bar{\delta}\bar{\mu}-\omega y\bar{y} -\omega \delta\bar{\delta}\\ = & \delta\bar{\delta}\theta + \bar{y}\delta\mu + y\bar{\delta}\bar{\mu} -\omega \delta\bar{\delta}\\ = & \delta\bar{\delta}(\theta - \omega) + \bar{y}\delta\mu + y\bar{\delta}\bar{\mu} \\ \end{align}

-