← Exercise library← All exercises for this theme
Theme 2 — Hilbert Spaces and Dirac Notation

The Hilbert—Schmidt inner product

Keywords: Hilbert--Schmidt inner product · matrix space · trace · orthonormal basis · Pauli matrices · Cauchy--Schwarz inequality

Exercise 1 : The Hilbert—Schmidt inner product

Let Mn(C)M_n(\C) denote the set of complex n×nn\times n matrices, which is a complex vector space of dimension n2n^2, and define, for A,B∈Mn(C)A,B\in M_n(\C),

⟨A,B⟩HS=tr⁡(A†B).\langle A,B\rangle_{\rm HS}=\tr\bigl(A^\dagger B\bigr).
Question 1
Show that ⟨A,B⟩HS=∑i,jAij∗Bij\langle A,B\rangle_{\rm HS}=\sum_{i,j}A_{ij}^*B_{ij}, then show that ⟨⋅,⋅⟩HS\langle\cdot,\cdot\rangle_{\rm HS} is a Hermitian inner product on Mn(C)M_n(\C). What is the associated norm?

Solution
By definition, (A†B)jj=∑i(A†)jiBij=∑iAij∗Bij(A^\dagger B)_{jj}=\sum_i(A^\dagger)_{ji}B_{ij}=\sum_iA_{ij}^*B_{ij}, and summing over jj gives tr⁡(A†B)=∑i,jAij∗Bij\tr(A^\dagger B)=\sum_{i,j}A_{ij}^*B_{ij}. This is exactly the usual Hermitian inner product on Cn2\C^{n^2} when the n2n^2 entries of a matrix are arranged into a single vector. It is therefore linear in BB, satisfies Hermitian symmetry ⟨B,A⟩HS=⟨A,B⟩HS∗\langle B,A\rangle_{\rm HS}=\langle A,B\rangle_{\rm HS}^*, and is positive definite: ⟨A,A⟩HS=∑i,j∣Aij∣2≥0\langle A,A\rangle_{\rm HS}=\sum_{i,j}|A_{ij}|^2\geq0, with equality if and only if all entries vanish. The associated norm, ∥A∥HS=∑i,j∣Aij∣2\norm A_{\rm HS}=\sqrt{\sum_{i,j}|A_{ij}|^2}, is called the Hilbert—Schmidt norm, or Frobenius norm. The space Mn(C)M_n(\C) equipped with this inner product is a Hilbert space of dimension n2n^2.

Question 2
Show that the elementary matrices Ekl=∣ek⟩⟨el∣E_{kl}=\ket{e_k}\bra{e_l}, whose only nonzero entry is 11 in position (k,l)(k,l), form an orthonormal basis of Mn(C)M_n(\C). What is ∥U∥HS\norm U_{\rm HS} for a unitary matrix UU?

Solution
From the previous question, ⟨Ekl,Ek′l′⟩HS=∑i,j(Ekl)ij(Ek′l′)ij=δkk′δll′\langle E_{kl},E_{k'l'}\rangle_{\rm HS}=\sum_{i,j}(E_{kl})_{ij}(E_{k'l'})_{ij}=\delta_{kk'}\delta_{ll'}, since each matrix has a nonzero entry in only one position. These n2n^2 orthonormal matrices form a basis, and the expansion of a matrix in this basis is simply A=∑k,lAklEklA=\sum_{k,l}A_{kl}E_{kl}, the formula A^=∑k,lAkl∣ek⟩⟨el∣\hat A=\sum_{k,l}A_{kl}\ket{e_k}\bra{e_l} in Dirac notation. For a unitary matrix, ∥U∥HS2=tr⁡(U†U)=tr⁡1=n\norm U_{\rm HS}^2=\tr(U^\dagger U)=\tr\mathbf{1}=n.

Question 3
For n=2n=2, show that the four matrices 121\frac{1}{\sqrt2}\mathbf{1}, 12σx\frac{1}{\sqrt2}\sigma_x, 12σy\frac{1}{\sqrt2}\sigma_y, 12σz\frac{1}{\sqrt2}\sigma_z form an orthonormal basis of M2(C)M_2(\C). Use the relations σj†=σj\sigma_j^\dagger=\sigma_j, σj2=1\sigma_j^2=\mathbf{1}, tr⁡σj=0\tr\sigma_j=0, and σjσk=iσl\sigma_j\sigma_k=i\sigma_l for (j,k,l)(j,k,l) a cyclic permutation of (x,y,z)(x,y,z).

Solution
Since the Pauli matrices are self-adjoint, ⟨σj,σk⟩HS=tr⁡(σjσk)\langle\sigma_j,\sigma_k\rangle_{\rm HS}=\tr(\sigma_j\sigma_k). For j=kj=k, this gives tr⁡1=2\tr\mathbf{1}=2. For j≠kj\neq k, the product σjσk\sigma_j\sigma_k is ±iσl\pm i\sigma_l, whose trace vanishes. Finally, ⟨1,σj⟩HS=tr⁡σj=0\langle\mathbf{1},\sigma_j\rangle_{\rm HS}=\tr\sigma_j=0 and ⟨1,1⟩HS=2\langle\mathbf{1},\mathbf{1}\rangle_{\rm HS}=2. The four matrices 1,σx,σy,σz\mathbf{1},\sigma_x,\sigma_y,\sigma_z are therefore orthogonal and have norm 2\sqrt2; dividing them by 2\sqrt2 gives four orthonormal matrices in a space of dimension 44: this is an orthonormal basis.

Question 4
Write the Cauchy—Schwarz inequality for this inner product. Deduce that ∣tr⁡A∣2≤n tr⁡(A†A)|\tr A|^2\leq n\,\tr(A^\dagger A) for every matrix AA, and state the equality condition.

Solution
The Cauchy—Schwarz inequality reads ∣tr⁡(A†B)∣2≤tr⁡(A†A) tr⁡(B†B)|\tr(A^\dagger B)|^2\leq\tr(A^\dagger A)\,\tr(B^\dagger B). Taking A=1A=\mathbf{1} and renaming BB as AA, we obtain ∣tr⁡A∣2≤tr⁡(1) tr⁡(A†A)=n tr⁡(A†A)|\tr A|^2\leq\tr(\mathbf{1})\,\tr(A^\dagger A)=n\,\tr(A^\dagger A). Equality holds if and only if AA is proportional to the identity. For example, for a Hermitian matrix with eigenvalues λk\lambda_k, this inequality reads (∑kλk)2≤n∑kλk2\bigl(\sum_k\lambda_k\bigr)^2\leq n\sum_k\lambda_k^2: the square of the mean of the eigenvalues is less than or equal to the mean of their squares.