Gram product (source code)

= Gram product
{title2=$T^\top T\text{ or }TT^\top$}

For a complex $m$-by-$n$ <matrix> $T$, the products $T^*T$ and $TT^*$ are Gram products; the star denotes the <conjugate transpose>. For a real <matrix>, it reduces to the <matrix transpose>. If the columns of $T$ are $v_1,\ldots,v_n$, then $T^*T$ is their <Gram matrix> under the standard complex <inner product>:
$$
(T^*T)_{ij}=v_i^*v_j.
$$
Thus a rectangular <matrix> gives square <Hermitian> <positive semidefinite matrices>. The identity
$$
x^*T^*Tx=\|Tx\|^2
$$
proves nonnegativity and gives $\ker(T^*T)=\ker T$. Similarly, $\ker(TT^*)=\ker T^*$. These are the <kernel of a Gram product> identities; combined with the <rank-nullity theorem>, they show that each Gram product has the same <matrix rank> as $T$.

For example, $T=(1\ \ 2)$ gives $TT^*=5$, while $T^*T=\begin{pmatrix}1&2\\2&4\end{pmatrix}$. Both have <matrix rank> one despite their different sizes. The second is singular because the two columns of $T$ are <linearly dependent>.