Unit 7, lesson 36

Positive Square Roots of Matrices

The unique positive semidefinite square root of a Hermitian positive semidefinite matrix, its construction from the spectral theorem, other square roots of a matrix, and how it differs from a Cholesky factor.

  • Video 36
  • Square Roots and Polar Factors

Squaring the symmetric matrix with rows (2,1)(2, 1) and (1,2)(1, 2) gives the matrix with rows (5,4)(5, 4) and (4,5)(4, 5), so the first is a square root of the second. Its negative has the same square, and so does the matrix with rows (1,2)(1, 2) and (2,1)(2, 1). In what sense, then, can a matrix have one square root? This lesson proves that a Hermitian positive semidefinite matrix has exactly one Hermitian positive semidefinite square root, builds it from the spectral theorem, and separates it from the Cholesky factor and from the many other square roots a matrix can have.

Key terms

Positive semidefinite square root

Definition Let F\mathbb{F} be R\mathbb{R} or C\mathbb{C}, and let H∈Fn×nH \in \mathbb{F}^{n \times n} be Hermitian, which means real symmetric when F=R\mathbb{F} = \mathbb{R}, and positive semidefinite, meaning x∗Hx≥0x^{*}Hx \ge 0 for every x∈Fnx \in \mathbb{F}^n. A positive semidefinite square root of HH is a Hermitian positive semidefinite matrix S∈Fn×nS \in \mathbb{F}^{n \times n} with

S2=H.S^2 = H .

Every such HH has exactly one, written H1/2H^{1/2}. The construction and the uniqueness proof below show this. The root has the same eigenvectors as HH, with eigenvalue λ\sqrt{\lambda} wherever HH has eigenvalue λ\lambda, so ker⁡H1/2=ker⁡H\ker H^{1/2} = \ker H, and H1/2H^{1/2} is positive definite exactly when HH is. For a diagonal H=diag⁡(d1,…,dn)H = \operatorname{diag}(d_1, \dots, d_n) with every di≥0d_i \ge 0, the root is diag⁡(d1,…,dn)\operatorname{diag}(\sqrt{d_1}, \dots, \sqrt{d_n}). The same definition applies to a positive semidefinite operator on a finite-dimensional inner product space over F\mathbb{F}.

In plain words Among all matrices whose square is HH, take the one that is itself Hermitian with no negative eigenvalues. The qualifier plays the role that “nonnegative” plays for the square root of a number.

Example For

H=[5445],S=[2112],H = \begin{bmatrix} 5 & 4 \\ 4 & 5 \end{bmatrix}, \qquad S = \begin{bmatrix} 2 & 1 \\ 1 & 2 \end{bmatrix},

multiplication gives S2=HS^2 = H. The matrix SS is symmetric with eigenvalues 33 on (1,1)(1, 1) and 11 on (1,−1)(1, -1), so it is positive definite, and S=H1/2S = H^{1/2}. The matrices −S-S and the one with rows (1,2)(1, 2) and (2,1)(2, 1) also square to HH. But −S-S has eigenvalues −3-3 and −1-1, and the other matrix has eigenvalues 33 and −1-1, so neither is positive semidefinite.

Spectral construction of a square root

Definition Let H∈Fn×nH \in \mathbb{F}^{n \times n} be Hermitian positive semidefinite, with F\mathbb{F} equal to R\mathbb{R} or C\mathbb{C}. The spectral theorem gives H=QΛQ∗H = Q\Lambda Q^{*} with QQ unitary, real orthogonal when F=R\mathbb{F} = \mathbb{R}, and Λ=diag⁡(λ1,…,λn)\Lambda = \operatorname{diag}(\lambda_1, \dots, \lambda_n). Every λi\lambda_i is nonnegative, because the iith column qiq_i of QQ gives λi=qi∗Hqi≥0\lambda_i = q_i^{*}Hq_i \ge 0. Define

S=QΛ1/2Q∗,Λ1/2=diag⁡(λ1,…,λn),\begin{aligned} S &= Q\Lambda^{1/2}Q^{*}, \\[0.4em] \Lambda^{1/2} &= \operatorname{diag}(\sqrt{\lambda_1}, \dots, \sqrt{\lambda_n}), \end{aligned}

with nonnegative scalar roots. Then S∗=SS^{*} = S because the diagonal entries are real, and with y=Q∗xy = Q^{*}x

x∗Sx=∑i=1nλi ∣yi∣2≥0,x^{*}Sx = \sum_{i=1}^{n} \sqrt{\lambda_i}\,\lvert y_i \rvert^2 \ge 0,

so SS is Hermitian positive semidefinite. In the product S2=QΛ1/2Q∗QΛ1/2Q∗S^2 = Q\Lambda^{1/2}Q^{*}Q\Lambda^{1/2}Q^{*} the middle factor Q∗QQ^{*}Q is the identity, so S2=QΛQ∗=HS^2 = Q\Lambda Q^{*} = H. Nothing is divided by a root, so zero eigenvalues cause no trouble, and Sx=0Sx = 0 exactly when Hx=0Hx = 0. Grouping equal eigenvalues,

H=∑λλ Pλ,S=∑λλ Pλ,\begin{aligned} H &= \sum_{\lambda} \lambda\,P_{\lambda}, \\[0.4em] S &= \sum_{\lambda} \sqrt{\lambda}\,P_{\lambda}, \end{aligned}

where the sums run over the distinct eigenvalues of HH and PλP_{\lambda} is the orthogonal projector onto the eigenspace of λ\lambda. These projectors depend only on HH, so SS does not depend on which orthonormal eigenvectors were chosen inside a repeated eigenspace.

In plain words Find the perpendicular directions along which HH only scales, take the nonnegative root of each scale factor, and put the directions back. A direction that HH flattens stays flattened.

Example The complex matrix

H=[54i−4i5]H = \begin{bmatrix} 5 & 4i \\ -4i & 5 \end{bmatrix}

is Hermitian. It sends (1,−i)(1, -i) to 9(1,−i)9(1, -i) and fixes (1,i)(1, i), so its eigenvalues are 99 and 11, with eigenspace projectors

P9=12[1i−i1],P1=12[1−ii1].\begin{gathered} P_9 = \frac{1}{2}\begin{bmatrix} 1 & i \\ -i & 1 \end{bmatrix}, \\[0.4em] P_1 = \frac{1}{2}\begin{bmatrix} 1 & -i \\ i & 1 \end{bmatrix}. \end{gathered}

The positive root is

H1/2=3P9+P1=[2i−i2],H^{1/2} = 3P_9 + P_1 = \begin{bmatrix} 2 & i \\ -i & 2 \end{bmatrix},

and indeed its square has diagonal entries 4+i(−i)=54 + i(-i) = 5 and upper right entry 2i+2i=4i2i + 2i = 4i. For a singular example, diag⁡(0,9,4)\operatorname{diag}(0, 9, 4) has positive root diag⁡(0,3,2)\operatorname{diag}(0, 3, 2), and both have the kernel spanned by e1e_1.

Uniqueness of the positive root

Definition Let H∈Fn×nH \in \mathbb{F}^{n \times n} be Hermitian positive semidefinite, with F\mathbb{F} equal to R\mathbb{R} or C\mathbb{C}. If R∈Fn×nR \in \mathbb{F}^{n \times n} is Hermitian positive semidefinite and R2=HR^2 = H, then RR equals the matrix SS built above. The proof does not assume that RR and SS share eigenvectors. First, RR commutes with HH, because RH=R3=HRRH = R^3 = HR. So if Hv=λvHv = \lambda v, then

H(Rv)=R(Hv)=λRv,H(Rv) = R(Hv) = \lambda Rv,

and RR maps every eigenspace EλE_{\lambda} of HH into itself. On EλE_{\lambda}, with the inherited inner product, RR is still Hermitian and positive semidefinite, so the spectral theorem gives an orthonormal basis of EλE_{\lambda} made of eigenvectors of RR. If Rw=μwRw = \mu w for a nonzero w∈Eλw \in E_{\lambda}, then μ≥0\mu \ge 0 and

μ2w=R2w=Hw=λw,\mu^2 w = R^2 w = Hw = \lambda w,

so μ2=λ\mu^2 = \lambda and μ=λ\mu = \sqrt{\lambda}, the only nonnegative number with that square. Every eigenvalue of RR on EλE_{\lambda} is λ\sqrt{\lambda}, so RR acts on EλE_{\lambda} as λ\sqrt{\lambda} times the identity, exactly as SS does. The eigenspaces of HH together span Fn\mathbb{F}^n, so R=SR = S. The argument covers repeated eigenvalues and the eigenvalue 00 as well.

In plain words A positive root has no freedom left. It must keep every eigenspace of HH, and on each one the only nonnegative number whose square is λ\lambda is λ\sqrt{\lambda}.

Example Take H=4I2H = 4I_2, with the repeated eigenvalue 44. The construction gives H1/2=2I2H^{1/2} = 2I_2. Many Hermitian matrices square to 4I24I_2, for instance

[0220],[200−2],2[111−1].\begin{gathered} \begin{bmatrix} 0 & 2 \\ 2 & 0 \end{bmatrix}, \qquad \begin{bmatrix} 2 & 0 \\ 0 & -2 \end{bmatrix}, \\[0.4em] \sqrt{2}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}. \end{gathered}

Each has eigenvalues 22 and −2-2, so none is positive semidefinite. Because the eigenvalue is repeated, any line through the origin can carry the eigenvalue 22 while the perpendicular line carries −2-2, so there are infinitely many such roots, yet 2I22I_2 remains the only positive semidefinite one.

Square roots of a matrix

Definition A square root of a matrix A∈Fn×nA \in \mathbb{F}^{n \times n} is any R∈Fn×nR \in \mathbb{F}^{n \times n} with R2=AR^2 = A. Without further conditions a matrix may have finitely many square roots, infinitely many, or none, and the answer depends on the field. If RR is a square root, so is −R-R. A Hermitian matrix HH can have a Hermitian square root only if it is positive semidefinite, because a Hermitian RR gives

x∗R2x=(Rx)∗(Rx)=∥Rx∥2≥0\begin{aligned} x^{*}R^2x &= (Rx)^{*}(Rx) \\[0.4em] &= \lVert Rx \rVert^2 \ge 0 \end{aligned}

for every xx. So a Hermitian matrix with a negative eigenvalue has no Hermitian square root. Over R\mathbb{R} the 1×11 \times 1 matrix [−1][-1] has no square root at all, while over C\mathbb{C} it has the two roots [i][i] and [−i][-i], neither of them Hermitian. The matrix

N=[0100]N = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix}

has no square root over R\mathbb{R} or C\mathbb{C}. A root RR would commute with NN, since RN=R3=NRRN = R^3 = NR, and the matrices that commute with NN have rows (a,b)(a, b) and (0,a)(0, a). Their squares have rows (a2,2ab)(a^2, 2ab) and (0,a2)(0, a^2), which equal NN only if a=0a = 0 and 2ab=12ab = 1, a contradiction. At the other extreme, I2I_2 has infinitely many square roots, such as the matrix with rows (1,a)(1, a) and (0,−1)(0, -1) for every scalar aa. The positive root theorem picks out one root only in its own setting, a Hermitian positive semidefinite matrix and a Hermitian positive semidefinite root.

In plain words “The square root of a matrix” does not name one matrix unless the conditions are stated. Signs, phases and choices inside repeated eigenspaces multiply the possibilities, and some matrices have no square root at all.

Example Return to HH with rows (5,4)(5, 4) and (4,5)(4, 5). Any square root RR, real or complex, commutes with HH, so it maps each eigenline of HH into itself, the line of (1,1)(1, 1) with eigenvalue 99 and the line of (1,−1)(1, -1) with eigenvalue 11. On those lines RR acts by a number whose square is 99 or 11, that is by ±3\pm 3 and ±1\pm 1. So HH has exactly four square roots,

±[2112],±[1221],\pm\begin{bmatrix} 2 & 1 \\ 1 & 2 \end{bmatrix}, \qquad \pm\begin{bmatrix} 1 & 2 \\ 2 & 1 \end{bmatrix},

all real symmetric. The matrix with rows (1,2)(1, 2) and (2,1)(2, 1) acts by 33 and −1-1, so it is indefinite, and only the matrix with rows (2,1)(2, 1) and (1,2)(1, 2) is positive semidefinite.

Cholesky factor versus square root

Definition Let H∈Fn×nH \in \mathbb{F}^{n \times n} be Hermitian positive definite, with F\mathbb{F} equal to R\mathbb{R} or C\mathbb{C}. Its Cholesky factorization is

H=R∗R,H = R^{*}R,

where R∈Fn×nR \in \mathbb{F}^{n \times n} is upper triangular with positive real diagonal entries. This factor RR exists and is unique. Many books write H=LL∗H = LL^{*} with L=R∗L = R^{*} lower triangular. The positive root also gives H=S∗SH = S^{*}S with S=H1/2S = H^{1/2}, since S∗=SS^{*} = S, but the two factors meet different requirements. The Cholesky factor is triangular and usually not Hermitian, and the positive root is Hermitian and usually not triangular. A matrix that is both upper triangular and Hermitian is diagonal, so R=H1/2R = H^{1/2} exactly when HH is diagonal. The two factors differ by a unitary matrix on the left. The matrix W=RS−1W = RS^{-1} satisfies

W∗W=S−1R∗RS−1=S−1HS−1=I,\begin{aligned} W^{*}W &= S^{-1}R^{*}RS^{-1} \\[0.4em] &= S^{-1}HS^{-1} = I, \end{aligned}

so R=WSR = WS with WW unitary. When HH is only positive semidefinite and singular, the positive root still exists and is unique, but a triangular factor with nonnegative diagonal can fail to be unique. For example, diag⁡(0,1)=RTR\operatorname{diag}(0, 1) = R^{\mathsf{T}}R for every real RR with rows (0,s)(0, s) and (0,c)(0, c) where s2+c2=1s^2 + c^2 = 1 and c≥0c \ge 0.

In plain words Both factorizations write HH as a factor’s adjoint times the factor. Cholesky asks for a triangular factor, which is what forward and back substitution need, while the positive root asks for a Hermitian positive semidefinite factor that shares the eigenvectors of HH.

Example For HH with rows (5,4)(5, 4) and (4,5)(4, 5),

R=[54/503/5].R = \begin{bmatrix} \sqrt{5} & 4/\sqrt{5} \\ 0 & 3/\sqrt{5} \end{bmatrix}.

The product RTRR^{\mathsf{T}}R has entries 55, 44, 44 and 16/5+9/5=516/5 + 9/5 = 5, so it equals HH. But R2R^2 is upper triangular, with lower left entry 00 instead of 44, so RR is not a square root of HH and differs from H1/2H^{1/2}, the matrix with rows (2,1)(2, 1) and (1,2)(1, 2). Their quotient is the rotation

W=RS−1=15[21−12].W = RS^{-1} = \frac{1}{\sqrt{5}}\begin{bmatrix} 2 & 1 \\ -1 & 2 \end{bmatrix}.

Check yourself

  1. Find the positive square root of the matrix HH with rows (13,12)(13, 12) and (12,13)(12, 13), and check both the square and the positivity.
Show the answer

The vector (1,1)(1, 1) is an eigenvector with eigenvalue 2525 and (1,−1)(1, -1) one with eigenvalue 11. The root acts by 55 and 11 on these directions, so

H1/2=52[1111]+12[1−1−11]=[3223].\begin{aligned} H^{1/2} &= \frac{5}{2}\begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix} \\[0.4em] &\quad + \frac{1}{2}\begin{bmatrix} 1 & -1 \\ -1 & 1 \end{bmatrix} \\[0.4em] &= \begin{bmatrix} 3 & 2 \\ 2 & 3 \end{bmatrix}. \end{aligned}

Its square has diagonal entries 9+4=139 + 4 = 13 and off-diagonal entries 6+6=126 + 6 = 12, so it equals HH. It is symmetric with eigenvalues 55 and 11, both positive, so it is positive definite.

  1. A student takes the square root of every entry of the matrix with rows (5,4)(5, 4) and (4,5)(4, 5) and proposes the matrix with rows (5,2)(\sqrt{5}, 2) and (2,5)(2, \sqrt{5}) as its positive square root. Is that right?
Show the answer

No. The proposed matrix squares to the matrix with diagonal entries 5+4=95 + 4 = 9 and off-diagonal entries 25+25=452\sqrt{5} + 2\sqrt{5} = 4\sqrt{5}, which is not the original matrix. It is even positive definite, with eigenvalues 5±2\sqrt{5} \pm 2, so positivity alone proves nothing, and the square has to be checked too. Entrywise roots give the positive root only when the matrix is diagonal. The positive root is the matrix with rows (2,1)(2, 1) and (1,2)(1, 2), obtained from the eigenvalues 99 and 11.

  1. Let HH be the matrix with rows (25,24)(25, 24) and (24,25)(24, 25). Find its Cholesky factor RR and its positive square root SS, and find the orthogonal matrix WW with R=WSR = WS.
Show the answer

For the Cholesky factor, r11=25=5r_{11} = \sqrt{25} = 5, then r12=24/5r_{12} = 24/5, and r22=25−576/25=49/25=7/5r_{22} = \sqrt{25 - 576/25} = \sqrt{49/25} = 7/5. The eigenvalues of HH are 4949 on (1,1)(1, 1) and 11 on (1,−1)(1, -1), so SS acts by 77 and 11 there. This gives

R=[524/507/5],S=[4334].\begin{gathered} R = \begin{bmatrix} 5 & 24/5 \\ 0 & 7/5 \end{bmatrix}, \\[0.4em] S = \begin{bmatrix} 4 & 3 \\ 3 & 4 \end{bmatrix}. \end{gathered}

Check that S2S^2 has entries 16+9=2516 + 9 = 25 and 12+12=2412 + 12 = 24. The inverse of SS has rows (4,−3)/7(4, -3)/7 and (−3,4)/7(-3, 4)/7, so

W=RS−1=15[43−34],W = RS^{-1} = \frac{1}{5}\begin{bmatrix} 4 & 3 \\ -3 & 4 \end{bmatrix},

a rotation, since WTW=IW^{\mathsf{T}}W = I and det⁡W=1\det W = 1. Multiplying confirms WS=RWS = R.

How this lesson connects

Used later in