QuantumCore

Lesson 7 · 60 min · core

Spectral Theorem & Functions of Operators

Loading progress…

Every normal operator — in particular every Hermitian observable and every unitary gate — is diagonal in some orthonormal basis: A=∑kλk∣ek⟩⟨ek∣A=\sum_k\lambda_k\lvert e_k\rangle\langle e_k\rvert. We prove this spectral theorem by induction on the dimension, decompose XX, YY and a complex Hermitian matrix explicitly, define functions of operators f(A)f(A), and derive the rotation-gate formula e−iθP/2=cos⁡θ2 I−isin⁡θ2 Pe^{-i\theta P/2}=\cos\tfrac\theta2\,I-i\sin\tfrac\theta2\,P from the power series.

Prerequisites: Hermitian & Unitary Operators

Objectives and key results
  • State and prove the spectral theorem for normal operators on Cd\mathbb C^d and diagonalise a 2×22\times2 Hermitian matrix as A=∑kλk∣ek⟩⟨ek∣A=\sum_k\lambda_k\lvert e_k\rangle\langle e_k\rvert.

  • Define f(A)=∑λf(λ)Pλf(A)=\sum_\lambda f(\lambda)P_\lambda and show that it agrees with the power series for polynomials and for exp⁡\exp.

  • Derive e−iθP/2=cos⁡θ2 I−isin⁡θ2 Pe^{-i\theta P/2}=\cos\tfrac\theta2\,I-i\sin\tfrac\theta2\,P for any PP with P2=IP^2=I and write RX,RY,RZR_X,R_Y,R_Z explicitly.

  • Prove that e−iHte^{-iHt} is unitary for Hermitian HH, that det⁡eA=eTrA\det e^{A}=e^{\mathrm{Tr}A}, and that eA+B≠eAeBe^{A+B}\ne e^Ae^B in general.

theorem · Spectral theorem
AA†=A†A  ⟺  A=∑k=1dλk∣ek⟩⟨ek∣, ⟨ej∣ek⟩=δjkAA^\dagger=A^\dagger A\iff A=\sum_{k=1}^{d}\lambda_k\lvert e_k\rangle\langle e_k\rvert,\ \langle e_j\vert e_k\rangle=\delta_{jk}
definition · Functional calculus
f(A)=∑kf(λk) ∣ek⟩⟨ek∣f(A)=\sum_k f(\lambda_k)\,\lvert e_k\rangle\langle e_k\rvert
identity · Involutory exponential
P2=I ⇒ e−iαP=cos⁡α I−isin⁡α PP^2=I\ \Rightarrow\ e^{-i\alpha P}=\cos\alpha\,I-i\sin\alpha\,P
identity · Determinant of an exponential
det⁡eA=eTrA\det e^{A}=e^{\mathrm{Tr}A}
formula · Time evolution is unitary
H=H† ⇒ (e−iHt)†e−iHt=IH=H^\dagger\ \Rightarrow\ (e^{-iHt})^\dagger e^{-iHt}=I

The spectral theorem#

In the previous lesson we saw that Hermitian operators have real eigenvalues and orthogonal eigenvectors for distinct eigenvalues. That alone does not guarantee that there are enough eigenvectors to form a basis — the matrix (0100)\begin{pmatrix}0&1\\0&0\end{pmatrix} has only one eigen-direction. The spectral theorem closes this gap: for every normal operator (one that commutes with its adjoint) there is an orthonormal basis of eigenvectors. Hermitian operators (A†=AA^\dagger=A) and unitaries (U†=U−1U^\dagger=U^{-1}) are normal, so the theorem covers every observable and every gate.

Definition

Normal operator

AA is normal if AA†=A†AAA^\dagger=A^\dagger A. Hermitian: AA†=A2=A†AAA^\dagger=A^2=A^\dagger A. Unitary: UU†=I=U†UUU^\dagger=I=U^\dagger U. The lowering operator σ−=∣0⟩⟨1∣\sigma^-=\lvert0\rangle\langle1\rvert is not normal: σ−(σ−)†=∣0⟩⟨0∣≠∣1⟩⟨1∣=(σ−)†σ−\sigma^-(\sigma^-)^\dagger=\lvert0\rangle\langle0\rvert\ne\lvert1\rangle\langle1\rvert=(\sigma^-)^\dagger\sigma^-.

Lemma

Eigenvectors of a normal operator are eigenvectors of its adjoint

If AA is normal and A∣v⟩=λ∣v⟩A\lvert v\rangle=\lambda\lvert v\rangle, then A†∣v⟩=λˉ∣v⟩A^\dagger\lvert v\rangle=\bar\lambda\lvert v\rangle.

Proof (4 steps)
  1. Step 1:
    N:=A−λI,N†=A†−λˉIN:=A-\lambda I,\qquad N^\dagger=A^\dagger-\bar\lambda I
    Antilinearity of the dagger and I†=II^\dagger=I.
  2. Step 2:
    NN†=AA†−λˉA−λA†+∣λ∣2I=A†A−λˉA−λA†+∣λ∣2I=N†NNN^\dagger=AA^\dagger-\bar\lambda A-\lambda A^\dagger+\lvert\lambda\rvert^2I=A^\dagger A-\bar\lambda A-\lambda A^\dagger+\lvert\lambda\rvert^2I=N^\dagger N
    Expand both products; they differ only in AA†AA^\dagger versus A†AA^\dagger A, which are equal because AA is normal. So NN is normal too.
  3. Step 3:
    ∥Nv∥2=⟨Nv∣Nv⟩=⟨v∣N†Nv⟩=⟨v∣NN†v⟩=⟨N†v∣N†v⟩=∥N†v∥2\lVert Nv\rVert^2=\langle Nv\vert Nv\rangle=\langle v\vert N^\dagger Nv\rangle=\langle v\vert NN^\dagger v\rangle=\langle N^\dagger v\vert N^\dagger v\rangle=\lVert N^\dagger v\rVert^2
    Move operators across the inner product with the adjoint identity and use N†N=NN†N^\dagger N=NN^\dagger.
  4. Step 4:
    Nv=0 ⇒ ∥N†v∥=0 ⇒ A†v=λˉvNv=0\ \Rightarrow\ \lVert N^\dagger v\rVert=0\ \Rightarrow\ A^\dagger v=\bar\lambda v
    Nv=0Nv=0 is the eigen-equation; a vector of norm zero is the zero vector.

∎

Theorem

Spectral theorem (finite dimension)

Let AA be a normal operator on H≅Cd\mathcal H\cong\mathbb C^d. Then there is an orthonormal basis {∣e1⟩,…,∣ed⟩}\{\lvert e_1\rangle,\dots,\lvert e_d\rangle\} of eigenvectors, A∣ek⟩=λk∣ek⟩A\lvert e_k\rangle=\lambda_k\lvert e_k\rangle, and A=∑k=1dλk∣ek⟩⟨ek∣.A=\sum_{k=1}^{d}\lambda_k\lvert e_k\rangle\langle e_k\rvert . Equivalently U†AU=diag(λ1,…,λd)U^\dagger AU=\mathrm{diag}(\lambda_1,\dots,\lambda_d) for the unitary UU whose columns are the ∣ek⟩\lvert e_k\rangle. If AA is Hermitian all λk\lambda_k are real.

Proof (12 steps)
  1. Step 1:
    d=1: A=λ1I,  ∣e1⟩ any unit vectord=1:\ A=\lambda_1 I,\ \ \lvert e_1\rangle\ \text{any unit vector}
    Base case of the induction on d=dim⁡Hd=\dim\mathcal H: every operator on a one-dimensional space is multiplication by a scalar.
  2. Step 2:
    p(λ)=det⁡(A−λI) has a root λ1∈Cp(\lambda)=\det(A-\lambda I)\ \text{has a root}\ \lambda_1\in\mathbb C
    Induction step, d≥2d\ge2, assuming the theorem in dimension d−1d-1. pp is a polynomial of degree d≥1d\ge1; by the fundamental theorem of algebra it has a complex root.
  3. Step 3:
    ∃ ∣e1⟩: A∣e1⟩=λ1∣e1⟩,  ⟨e1∣e1⟩=1\exists\,\lvert e_1\rangle:\ A\lvert e_1\rangle=\lambda_1\lvert e_1\rangle,\ \ \langle e_1\vert e_1\rangle=1
    A−λ1IA-\lambda_1I is singular, so it has a non-zero kernel vector, which we normalise.
  4. Step 4:
    A†∣e1⟩=λˉ1∣e1⟩A^\dagger\lvert e_1\rangle=\bar\lambda_1\lvert e_1\rangle
    The lemma above, because AA is normal.
  5. Step 5:
    W:={∣w⟩: ⟨e1∣w⟩=0},dim⁡W=d−1W:=\{\lvert w\rangle:\ \langle e_1\vert w\rangle=0\},\qquad \dim W=d-1
    The orthogonal complement of a unit vector is a subspace of codimension one.
  6. Step 6:
    w∈W: ⟨e1∣Aw⟩=⟨A†e1∣w⟩=⟨λˉ1e1∣w⟩=λ1⟨e1∣w⟩=0w\in W:\ \langle e_1\vert Aw\rangle=\langle A^\dagger e_1\vert w\rangle=\langle\bar\lambda_1e_1\vert w\rangle=\lambda_1\langle e_1\vert w\rangle=0
    So AA maps WW into WW (WW is AA-invariant). Antilinearity turns λˉ1\bar\lambda_1 back into λ1\lambda_1.
  7. Step 7:
    w∈W: ⟨e1∣A†w⟩=⟨Ae1∣w⟩=⟨λ1e1∣w⟩=λˉ1⟨e1∣w⟩=0w\in W:\ \langle e_1\vert A^\dagger w\rangle=\langle Ae_1\vert w\rangle=\langle\lambda_1e_1\vert w\rangle=\bar\lambda_1\langle e_1\vert w\rangle=0
    WW is also A†A^\dagger-invariant.
  8. Step 8:
    B:=A∣W:W→W,B†=A†∣W,BB†=(AA†)∣W=(A†A)∣W=B†BB:=A\vert_W:W\to W,\qquad B^\dagger=A^\dagger\vert_W,\qquad BB^\dagger=(AA^\dagger)\vert_W=(A^\dagger A)\vert_W=B^\dagger B
    For u,w∈Wu,w\in W, ⟨u∣Bw⟩=⟨A†u∣w⟩\langle u\vert Bw\rangle=\langle A^\dagger u\vert w\rangle with A†u∈WA^\dagger u\in W, so the adjoint of the restriction is the restriction of the adjoint; hence BB is a normal operator on the (d−1)(d-1)-dimensional space WW.
  9. Step 9:
    ∃ orthonormal ∣e2⟩,…,∣ed⟩∈W: B∣ek⟩=λk∣ek⟩\exists\ \text{orthonormal}\ \lvert e_2\rangle,\dots,\lvert e_d\rangle\in W:\ B\lvert e_k\rangle=\lambda_k\lvert e_k\rangle
    Induction hypothesis applied to BB on WW (with any orthonormal basis of WW identifying it with Cd−1\mathbb C^{d-1}).
  10. Step 10:
    {∣e1⟩,…,∣ed⟩} orthonormal basis of H,A∣ek⟩=λk∣ek⟩ ∀k\{\lvert e_1\rangle,\dots,\lvert e_d\rangle\}\ \text{orthonormal basis of}\ \mathcal H,\quad A\lvert e_k\rangle=\lambda_k\lvert e_k\rangle\ \forall k
    Each ∣ek⟩\lvert e_k\rangle, k≥2k\ge2, lies in W⊥∣e1⟩W\perp\lvert e_1\rangle; dd orthonormal vectors in a dd-dimensional space form a basis; AA agrees with BB on WW.
  11. Step 11:
    A=A∑k∣ek⟩⟨ek∣=∑k(A∣ek⟩)⟨ek∣=∑kλk∣ek⟩⟨ek∣A=A\sum_k\lvert e_k\rangle\langle e_k\rvert=\sum_k\big(A\lvert e_k\rangle\big)\langle e_k\rvert=\sum_k\lambda_k\lvert e_k\rangle\langle e_k\rvert
    Multiply AA by the completeness relation of the new basis.
  12. Step 12:
    (U†AU)jk=⟨ej∣A∣ek⟩=λkδjk(U^\dagger AU)_{jk}=\langle e_j\vert A\vert e_k\rangle=\lambda_k\delta_{jk}
    Matrix form: column kk of UU is ∣ek⟩\lvert e_k\rangle, so U†AUU^\dagger AU is diagonal. For Hermitian AA each λk\lambda_k is real by the previous lesson.

∎

Corollary

The converse: unitarily diagonalisable operators are normal

If A=UDU†A=UDU^\dagger with UU unitary and DD diagonal, then AA†=A†AAA^\dagger=A^\dagger A. Hence "normal" is exactly the class of operators with an orthonormal eigenbasis.

Proof (3 steps)
  1. Step 1:
    A†=(UDU†)†=UD†U†=UDˉU†A^\dagger=(UDU^\dagger)^\dagger=UD^\dagger U^\dagger=U\bar DU^\dagger
    Adjoint of a product reverses the order; the adjoint of a diagonal matrix conjugates its entries.
  2. Step 2:
    AA†=UDU†UDˉU†=UDDˉU†AA^\dagger=UDU^\dagger U\bar DU^\dagger=UD\bar DU^\dagger
    U†U=IU^\dagger U=I.
  3. Step 3:
    A†A=UDˉDU†=UDDˉU†=AA†A^\dagger A=U\bar DDU^\dagger=UD\bar DU^\dagger=AA^\dagger
    Diagonal matrices commute: (DˉD)kk=∣λk∣2=(DDˉ)kk(\bar DD)_{kk}=\lvert\lambda_k\rvert^2=(D\bar D)_{kk}.

∎

Worked eigendecompositions#

Derivation

Pauli-X

  1. Step 1:
    det⁡(X−λI)=det⁡(−λ11−λ)=λ2−1=0 ⇒ λ=±1\det(X-\lambda I)=\det\begin{pmatrix}-\lambda&1\\1&-\lambda\end{pmatrix}=\lambda^2-1=0\ \Rightarrow\ \lambda=\pm1
    Characteristic polynomial (TrX=0\mathrm{Tr}X=0, det⁡X=−1\det X=-1).
  2. Step 2:
    (X−I)v=0⇒v1=v2: ∣+⟩=12(∣0⟩+∣1⟩);(X+I)v=0⇒v1=−v2: ∣−⟩=12(∣0⟩−∣1⟩)(X-I)v=0\Rightarrow v_1=v_2:\ \lvert+\rangle=\tfrac1{\sqrt2}(\lvert0\rangle+\lvert1\rangle);\quad (X+I)v=0\Rightarrow v_1=-v_2:\ \lvert-\rangle=\tfrac1{\sqrt2}(\lvert0\rangle-\lvert1\rangle)
    Solve each kernel equation and normalise.
  3. Step 3:
    ∣+⟩⟨+∣=12(1111),∣−⟩⟨−∣=12(1−1−11)\lvert+\rangle\langle+\rvert=\tfrac12\begin{pmatrix}1&1\\1&1\end{pmatrix},\qquad \lvert-\rangle\langle-\rvert=\tfrac12\begin{pmatrix}1&-1\\-1&1\end{pmatrix}
    Outer products (∣a⟩⟨b∣)ij=aibˉj(\lvert a\rangle\langle b\rvert)_{ij}=a_i\bar b_j.
  4. Step 4:
    (+1)∣+⟩⟨+∣+(−1)∣−⟩⟨−∣=12(0220)=X(+1)\lvert+\rangle\langle+\rvert+(-1)\lvert-\rangle\langle-\rvert=\tfrac12\begin{pmatrix}0&2\\2&0\end{pmatrix}=X
    Reconstruction confirms the spectral decomposition.
Derivation

Pauli-Y

  1. Step 1:
    det⁡(Y−λI)=λ2−(−i)(i)=λ2−1 ⇒ λ=±1\det(Y-\lambda I)=\lambda^2-(-i)(i)=\lambda^2-1\ \Rightarrow\ \lambda=\pm1
    TrY=0\mathrm{Tr}Y=0 and det⁡Y=0⋅0−(−i)(i)=−1\det Y=0\cdot0-(-i)(i)=-1.
  2. Step 2:
    (Y−I)v=(−1−ii−1)v=0⇒v2=iv1: ∣+i⟩=12(∣0⟩+i∣1⟩)(Y-I)v=\begin{pmatrix}-1&-i\\i&-1\end{pmatrix}v=0\Rightarrow v_2=iv_1:\ \lvert{+i}\rangle=\tfrac1{\sqrt2}(\lvert0\rangle+i\lvert1\rangle)
    First row: −v1−iv2=0⇒v2=iv1-v_1-iv_2=0\Rightarrow v_2=iv_1 (multiply by ii: −iv1+v2=0-iv_1+v_2=0).
  3. Step 3:
    (Y+I)v=(1−ii1)v=0⇒v2=−iv1: ∣−i⟩=12(∣0⟩−i∣1⟩)(Y+I)v=\begin{pmatrix}1&-i\\i&1\end{pmatrix}v=0\Rightarrow v_2=-iv_1:\ \lvert{-i}\rangle=\tfrac1{\sqrt2}(\lvert0\rangle-i\lvert1\rangle)
    First row: v1−iv2=0⇒v2=v1/i=−iv1v_1-iv_2=0\Rightarrow v_2=v_1/i=-iv_1.
  4. Step 4:
    ∣+i⟩⟨+i∣=12(1−ii1),∣−i⟩⟨−i∣=12(1i−i1)\lvert{+i}\rangle\langle{+i}\rvert=\tfrac12\begin{pmatrix}1&-i\\i&1\end{pmatrix},\qquad \lvert{-i}\rangle\langle{-i}\rvert=\tfrac12\begin{pmatrix}1&i\\-i&1\end{pmatrix}
    The bra conjugates the second component: ⟨+i∣=12(1,−i)\langle{+i}\rvert=\tfrac1{\sqrt2}(1,-i).
  5. Step 5:
    ∣+i⟩⟨+i∣−∣−i⟩⟨−i∣=12(0−2i2i0)=Y\lvert{+i}\rangle\langle{+i}\rvert-\lvert{-i}\rangle\langle{-i}\rvert=\tfrac12\begin{pmatrix}0&-2i\\2i&0\end{pmatrix}=Y
    Reconstruction.
Derivation

A Hermitian matrix with complex off-diagonal entries

  1. Step 1:
    A=(21−i1+i3),λ∈{1,4},e4=13(11+i),e1=13(1−i−1)A=\begin{pmatrix}2&1-i\\1+i&3\end{pmatrix},\quad \lambda\in\{1,4\},\quad e_4=\tfrac1{\sqrt3}\begin{pmatrix}1\\1+i\end{pmatrix},\quad e_1=\tfrac1{\sqrt3}\begin{pmatrix}1-i\\-1\end{pmatrix}
    Eigenpairs computed in the previous lesson from TrA=5\mathrm{Tr}A=5, det⁡A=4\det A=4.
  2. Step 2:
    P4=∣e4⟩⟨e4∣=13(11−i1+i2)P_4=\lvert e_4\rangle\langle e_4\rvert=\tfrac13\begin{pmatrix}1&1-i\\1+i&2\end{pmatrix}
    Entries (e4)i(e4)j‾(e_4)_i\overline{(e_4)_j}: e.g. 1⋅1+i‾=1−i1\cdot\overline{1+i}=1-i and ∣1+i∣2=2\lvert1+i\rvert^2=2.
  3. Step 3:
    P1=∣e1⟩⟨e1∣=13(2−1+i−1−i1)=I−P4P_1=\lvert e_1\rangle\langle e_1\rvert=\tfrac13\begin{pmatrix}2&-1+i\\-1-i&1\end{pmatrix}=I-P_4
    Entries ∣1−i∣2=2\lvert1-i\rvert^2=2, (1−i)⋅−1‾=−1+i(1-i)\cdot\overline{-1}=-1+i; completeness P1+P4=IP_1+P_4=I holds.
  4. Step 4:
    1⋅P1+4⋅P4=13(2+4(−1+i)+4(1−i)(−1−i)+4(1+i)1+8)=13(63−3i3+3i9)=A1\cdot P_1+4\cdot P_4=\tfrac13\begin{pmatrix}2+4&(-1+i)+4(1-i)\\(-1-i)+4(1+i)&1+8\end{pmatrix}=\tfrac13\begin{pmatrix}6&3-3i\\3+3i&9\end{pmatrix}=A
    Reconstruction from the spectral decomposition.

Result

A=1⋅P1+4⋅P4,P1P4=0,rank⁡P1=rank⁡P4=1\boxed{A=1\cdot P_1+4\cdot P_4,\qquad P_1P_4=0,\quad \operatorname{rank}P_1=\operatorname{rank}P_4=1}

Quick check

In the decomposition A=1⋅P1+4⋅P4A=1\cdot P_1+4\cdot P_4 above, what is Tr P4\mathrm{Tr}\,P_4?

tolerance ±0.001

Functions of operators#

Definition

Function of a normal operator

For a normal A=∑kλk∣ek⟩⟨ek∣A=\sum_k\lambda_k\lvert e_k\rangle\langle e_k\rvert and any function ff defined on its eigenvalues, f(A):=∑kf(λk) ∣ek⟩⟨ek∣.f(A):=\sum_k f(\lambda_k)\,\lvert e_k\rangle\langle e_k\rvert . Examples: ρ\sqrt{\rho} for a density matrix, log⁡ρ\log\rho in the von Neumann entropy, and the time-evolution operator e−iHte^{-iHt}.

Worked examples. For A=1⋅P1+4⋅P4A=1\cdot P_1+4\cdot P_4 from the previous section:

  • the square root is A=1⋅P1+2⋅P4=13(2+2(−1+i)+2(1−i)(−1−i)+2(1+i)1+4)=13(41−i1+i5)\sqrt A=1\cdot P_1+2\cdot P_4=\tfrac13\begin{pmatrix}2+2&(-1+i)+2(1-i)\\(-1-i)+2(1+i)&1+4\end{pmatrix}=\tfrac13\begin{pmatrix}4&1-i\\1+i&5\end{pmatrix}, and one checks (A)2=12P1+22P4=A(\sqrt A)^2=1^2P_1+2^2P_4=A because P1P4=0P_1P_4=0;
  • the inverse is A−1=1⋅P1+14P4A^{-1}=1\cdot P_1+\tfrac14P_4, since f(λ)=1/λf(\lambda)=1/\lambda is defined on the eigenvalues {1,4}\{1,4\}; indeed AA−1=P1+P4=IAA^{-1}=P_1+P_4=I;
  • the logarithm log⁡2A=0⋅P1+2⋅P4\log_2A=0\cdot P_1+2\cdot P_4 is exactly the kind of expression that appears in the von Neumann entropy S(ρ)=−Tr ρlog⁡2ρS(\rho)=-\mathrm{Tr}\,\rho\log_2\rho of Module 1.4.

For the simplest Hamiltonian H=ω2Z=ω2∣0⟩⟨0∣−ω2∣1⟩⟨1∣H=\tfrac{\omega}{2}Z=\tfrac\omega2\lvert0\rangle\langle0\rvert-\tfrac\omega2\lvert1\rangle\langle1\rvert, the time-evolution operator is e−iHt=e−iωt/2∣0⟩⟨0∣+eiωt/2∣1⟩⟨1∣=RZ(ωt)e^{-iHt}=e^{-i\omega t/2}\lvert0\rangle\langle0\rvert+e^{i\omega t/2}\lvert1\rangle\langle1\rvert=R_Z(\omega t): free precession of a qubit about the zz-axis of the Bloch sphere at angular frequency ω\omega. Functions are only defined where ff makes sense on the spectrum: log⁡A\log A requires no zero eigenvalue, and A\sqrt A is the unique positive square root only when all eigenvalues are non-negative.

Proposition

Consistency with powers, polynomials and the exponential series

For every n≥0n\ge0, An=∑kλkn∣ek⟩⟨ek∣A^n=\sum_k\lambda_k^n\lvert e_k\rangle\langle e_k\rvert. Hence for a polynomial pp the definition agrees with p(A)=∑ncnAnp(A)=\sum_nc_nA^n, and exp⁡(A):=∑n≥0An/n!\exp(A):=\sum_{n\ge0}A^n/n! equals ∑keλk∣ek⟩⟨ek∣\sum_ke^{\lambda_k}\lvert e_k\rangle\langle e_k\rvert.

Proof (6 steps)
  1. Step 1:
    A0=I=∑k∣ek⟩⟨ek∣=∑kλk0∣ek⟩⟨ek∣A^0=I=\sum_k\lvert e_k\rangle\langle e_k\rvert=\sum_k\lambda_k^0\lvert e_k\rangle\langle e_k\rvert
    Base case: completeness relation.
  2. Step 2:
    An+1=A⋅An=(∑jλj∣ej⟩⟨ej∣)(∑kλkn∣ek⟩⟨ek∣)A^{n+1}=A\cdot A^n=\Big(\sum_j\lambda_j\lvert e_j\rangle\langle e_j\rvert\Big)\Big(\sum_k\lambda_k^n\lvert e_k\rangle\langle e_k\rvert\Big)
    Induction step: multiply the spectral form of AA by the hypothesis for AnA^n.
  3. Step 3:
    =∑j,kλjλkn∣ej⟩⟨ej∣ek⟩⟨ek∣=∑j,kλjλknδjk∣ej⟩⟨ek∣=\sum_{j,k}\lambda_j\lambda_k^n\lvert e_j\rangle\langle e_j\vert e_k\rangle\langle e_k\rvert=\sum_{j,k}\lambda_j\lambda_k^n\delta_{jk}\lvert e_j\rangle\langle e_k\rvert
    Expand the product; orthonormality gives ⟨ej∣ek⟩=δjk\langle e_j\vert e_k\rangle=\delta_{jk}.
  4. Step 4:
    =∑kλkn+1∣ek⟩⟨ek∣=\sum_k\lambda_k^{n+1}\lvert e_k\rangle\langle e_k\rvert
    Only the diagonal terms j=kj=k survive.
  5. Step 5:
    p(A)=∑ncnAn=∑k(∑ncnλkn)∣ek⟩⟨ek∣=∑kp(λk)∣ek⟩⟨ek∣p(A)=\sum_nc_nA^n=\sum_k\Big(\sum_nc_n\lambda_k^n\Big)\lvert e_k\rangle\langle e_k\rvert=\sum_kp(\lambda_k)\lvert e_k\rangle\langle e_k\rvert
    Linearity: swap the two finite sums.
  6. Step 6:
    ∑n=0NAnn!=∑k(∑n=0Nλknn!)∣ek⟩⟨ek∣ →N→∞ ∑keλk∣ek⟩⟨ek∣\sum_{n=0}^{N}\frac{A^n}{n!}=\sum_k\Big(\sum_{n=0}^{N}\frac{\lambda_k^n}{n!}\Big)\lvert e_k\rangle\langle e_k\rvert\ \xrightarrow{N\to\infty}\ \sum_ke^{\lambda_k}\lvert e_k\rangle\langle e_k\rvert
    Apply the polynomial case to the partial sums; each scalar series converges to eλke^{\lambda_k}, and there are finitely many kk, so the matrices converge entry-wise.

∎

Corollary

e−iHte^{-iHt} is unitary for Hermitian HH

If H=H†H=H^\dagger and t∈Rt\in\mathbb R then U(t)=e−iHtU(t)=e^{-iHt} is unitary, with U(t)†=eiHt=U(−t)U(t)^\dagger=e^{iHt}=U(-t).

Proof (3 steps)
  1. Step 1:
    U(t)=∑ke−iλkt∣ek⟩⟨ek∣,λk∈RU(t)=\sum_ke^{-i\lambda_kt}\lvert e_k\rangle\langle e_k\rvert,\qquad \lambda_k\in\mathbb R
    Functional calculus with f(λ)=e−iλtf(\lambda)=e^{-i\lambda t}; Hermitian eigenvalues are real.
  2. Step 2:
    U(t)†=∑ke−iλkt‾ (∣ek⟩⟨ek∣)†=∑keiλkt∣ek⟩⟨ek∣=U(−t)U(t)^\dagger=\sum_k\overline{e^{-i\lambda_kt}}\,\big(\lvert e_k\rangle\langle e_k\rvert\big)^\dagger=\sum_ke^{i\lambda_kt}\lvert e_k\rangle\langle e_k\rvert=U(-t)
    Dagger is antilinear; projectors are Hermitian; e−ix‾=eix\overline{e^{-ix}}=e^{ix} for real xx.
  3. Step 3:
    U(t)†U(t)=∑j,keiλjte−iλkt∣ej⟩⟨ej∣ek⟩⟨ek∣=∑k∣ek⟩⟨ek∣=IU(t)^\dagger U(t)=\sum_{j,k}e^{i\lambda_jt}e^{-i\lambda_kt}\lvert e_j\rangle\langle e_j\vert e_k\rangle\langle e_k\rvert=\sum_k\lvert e_k\rangle\langle e_k\rvert=I
    Orthonormality kills j≠kj\ne k and eiλkte−iλkt=1e^{i\lambda_kt}e^{-i\lambda_kt}=1.

∎

Derivation

det⁡eA=eTrA\det e^{A}=e^{\mathrm{Tr}A} and rotations lie in SU(2)SU(2)

  1. Step 1:
    A=VDV−1,D=diag(λ1,…,λd)A=VDV^{-1},\quad D=\mathrm{diag}(\lambda_1,\dots,\lambda_d)
    Assume AA is diagonalisable (every normal AA is, with VV unitary).
  2. Step 2:
    An=VDnV−1 ⇒ eA=VeDV−1,eD=diag(eλ1,…,eλd)A^n=VD^nV^{-1}\ \Rightarrow\ e^{A}=Ve^{D}V^{-1},\quad e^{D}=\mathrm{diag}(e^{\lambda_1},\dots,e^{\lambda_d})
    Telescoping V−1V=IV^{-1}V=I inside AnA^n, then sum the power series term by term.
  3. Step 3:
    det⁡eA=det⁡V det⁡eD det⁡V−1=∏keλk\det e^{A}=\det V\,\det e^{D}\,\det V^{-1}=\prod_ke^{\lambda_k}
    Multiplicativity of the determinant and det⁡Vdet⁡V−1=1\det V\det V^{-1}=1.
  4. Step 4:
    =e∑kλk=eTrA=e^{\sum_k\lambda_k}=e^{\mathrm{Tr}A}
    eaeb=ea+be^ae^b=e^{a+b} for scalars, and the trace is the sum of the eigenvalues (basis independence of the trace).
  5. Step 5:
    det⁡RP(θ)=det⁡e−iθP/2=e−iθ TrP/2=e0=1(P∈{X,Y,Z})\det R_P(\theta)=\det e^{-i\theta P/2}=e^{-i\theta\,\mathrm{Tr}P/2}=e^{0}=1\quad(P\in\{X,Y,Z\})
    Every Pauli is traceless, so the rotation gates are unitary with determinant one: RP(θ)∈SU(2)R_P(\theta)\in SU(2).

Rotation gates as exponentials#

The platform defines the rotation gates by RP(θ)=e−iθP/2R_P(\theta)=e^{-i\theta P/2} for P∈{X,Y,Z}P\in\{X,Y,Z\} (convention §1.1). Since each Pauli squares to the identity, the exponential series collapses into a cosine and a sine. We derive this twice: once from the power series and once from the spectral decomposition.

Derivation

Power-series derivation of e−iαP=cos⁡α I−isin⁡α Pe^{-i\alpha P}=\cos\alpha\,I-i\sin\alpha\,P when P2=IP^2=I

  1. Step 1:
    e−iαP=∑n=0∞(−iα)nn!Pne^{-i\alpha P}=\sum_{n=0}^{\infty}\frac{(-i\alpha)^n}{n!}P^n
    Definition of the matrix exponential; (−iαP)n=(−iα)nPn(-i\alpha P)^n=(-i\alpha)^nP^n because scalars commute with PP.
  2. Step 2:
    P2m=(P2)m=I,P2m+1=P2mP=PP^{2m}=(P^2)^m=I,\qquad P^{2m+1}=P^{2m}P=P
    Use P2=IP^2=I repeatedly.
  3. Step 3:
    =∑m=0∞(−iα)2m(2m)!I+∑m=0∞(−iα)2m+1(2m+1)!P=\sum_{m=0}^{\infty}\frac{(-i\alpha)^{2m}}{(2m)!}I+\sum_{m=0}^{\infty}\frac{(-i\alpha)^{2m+1}}{(2m+1)!}P
    Split the absolutely convergent series into even n=2mn=2m and odd n=2m+1n=2m+1 terms.
  4. Step 4:
    (−i)2m=((−i)2)m=(−1)m,(−i)2m+1=(−1)m(−i)(-i)^{2m}=\big((-i)^2\big)^m=(-1)^m,\qquad (-i)^{2m+1}=(-1)^m(-i)
    (−i)2=i2=−1(-i)^2=i^2=-1.
  5. Step 5:
    =(∑m=0∞(−1)mα2m(2m)!)I−i(∑m=0∞(−1)mα2m+1(2m+1)!)P=\Big(\sum_{m=0}^{\infty}\frac{(-1)^m\alpha^{2m}}{(2m)!}\Big)I-i\Big(\sum_{m=0}^{\infty}\frac{(-1)^m\alpha^{2m+1}}{(2m+1)!}\Big)P
    Substitute and pull out the common factor −i-i from the odd part.
  6. Step 6:
    =cos⁡α I−isin⁡α P=\cos\alpha\,I-i\sin\alpha\,P
    Recognise the Taylor series of cos⁡\cos and sin⁡\sin.

Result

RP(θ)=e−iθP/2=cos⁡θ2 I−isin⁡θ2 P(α=θ/2)\boxed{R_P(\theta)=e^{-i\theta P/2}=\cos\tfrac\theta2\,I-i\sin\tfrac\theta2\,P\qquad(\alpha=\theta/2)}
Derivation

The same result from the spectral decomposition

  1. Step 1:
    P2=I, P=P† ⇒ λ∈{+1,−1},P±=12(I±P)P^2=I,\ P=P^\dagger\ \Rightarrow\ \lambda\in\{+1,-1\},\qquad P_\pm=\tfrac12(I\pm P)
    Eigenvalues satisfy λ2=1\lambda^2=1; P±P_\pm are the eigenprojectors: PP±=12(P±I)=±P±PP_\pm=\tfrac12(P\pm I)=\pm P_\pm and P++P−=IP_++P_-=I.
  2. Step 2:
    e−iαP=e−iαP++eiαP−e^{-i\alpha P}=e^{-i\alpha}P_++e^{i\alpha}P_-
    Functional calculus with f(λ)=e−iαλf(\lambda)=e^{-i\alpha\lambda}.
  3. Step 3:
    =12(e−iα+eiα)I+12(e−iα−eiα)P=\tfrac12(e^{-i\alpha}+e^{i\alpha})I+\tfrac12(e^{-i\alpha}-e^{i\alpha})P
    Substitute P±P_\pm and collect the coefficients of II and PP.
  4. Step 4:
    =cos⁡α I−isin⁡α P=\cos\alpha\,I-i\sin\alpha\,P
    Euler: e±iα=cos⁡α±isin⁡αe^{\pm i\alpha}=\cos\alpha\pm i\sin\alpha.
Derivation

Explicit rotation matrices

  1. Step 1:
    RX(θ)=cos⁡θ2(1001)−isin⁡θ2(0110)=(cos⁡θ2−isin⁡θ2−isin⁡θ2cos⁡θ2)R_X(\theta)=\cos\tfrac\theta2\begin{pmatrix}1&0\\0&1\end{pmatrix}-i\sin\tfrac\theta2\begin{pmatrix}0&1\\1&0\end{pmatrix}=\begin{pmatrix}\cos\frac\theta2&-i\sin\frac\theta2\\-i\sin\frac\theta2&\cos\frac\theta2\end{pmatrix}
    Substitute P=XP=X.
  2. Step 2:
    RY(θ)=cos⁡θ2 I−isin⁡θ2(0−ii0)=(cos⁡θ2−sin⁡θ2sin⁡θ2cos⁡θ2)R_Y(\theta)=\cos\tfrac\theta2\,I-i\sin\tfrac\theta2\begin{pmatrix}0&-i\\i&0\end{pmatrix}=\begin{pmatrix}\cos\frac\theta2&-\sin\frac\theta2\\\sin\frac\theta2&\cos\frac\theta2\end{pmatrix}
    −i⋅(−i)=−1-i\cdot(-i)=-1 and −i⋅i=1-i\cdot i=1: RYR_Y is a real rotation matrix.
  3. Step 3:
    RZ(θ)=(cos⁡θ2−isin⁡θ200cos⁡θ2+isin⁡θ2)=(e−iθ/200eiθ/2)R_Z(\theta)=\begin{pmatrix}\cos\frac\theta2-i\sin\frac\theta2&0\\0&\cos\frac\theta2+i\sin\frac\theta2\end{pmatrix}=\begin{pmatrix}e^{-i\theta/2}&0\\0&e^{i\theta/2}\end{pmatrix}
    Substitute P=ZP=Z and use Euler's formula.
  4. Step 4:
    RX(π/3)=(32−i2−i232)R_X(\pi/3)=\begin{pmatrix}\frac{\sqrt3}{2}&-\frac{i}{2}\\-\frac{i}{2}&\frac{\sqrt3}{2}\end{pmatrix}
    Worked value: α=θ/2=π/6\alpha=\theta/2=\pi/6, cos⁡π6=32\cos\frac\pi6=\frac{\sqrt3}2, sin⁡π6=12\sin\frac\pi6=\frac12.
RX(π/3)=(32−i2−i232)R_X(\pi/3)=\begin{pmatrix}\frac{\sqrt3}{2}&-\frac{i}{2}\\-\frac{i}{2}&\frac{\sqrt3}{2}\end{pmatrix}
R_X(π/3) = exp(-i(π/3)X/2)2×2

Unitary verified: U†U=IU^\dagger U = I (max deviation 1.1e-16)

RY(π/2)=12(1−111)R_Y(\pi/2)=\frac1{\sqrt2}\begin{pmatrix}1&-1\\1&1\end{pmatrix}
R_Y(π/2)2×2

Unitary verified: U†U=IU^\dagger U = I (max deviation 2.2e-16)

Derivation

eA+B≠eAeBe^{A+B}\ne e^Ae^B for non-commuting A=iπ2XA=\tfrac{i\pi}{2}X, B=iπ2ZB=\tfrac{i\pi}{2}Z

  1. Step 1:
    eA=eiπ2X=cos⁡π2 I+isin⁡π2 X=iX,eB=iZe^{A}=e^{i\frac\pi2X}=\cos\tfrac\pi2\,I+i\sin\tfrac\pi2\,X=iX,\qquad e^{B}=iZ
    Involutory formula with α=−π/2\alpha=-\pi/2: cos⁡(−α)=cos⁡α\cos(-\alpha)=\cos\alpha, −isin⁡(−π/2)=i-i\sin(-\pi/2)=i.
  2. Step 2:
    eAeB=(iX)(iZ)=−XZ=−(−iY)=iY=(01−10)e^Ae^B=(iX)(iZ)=-XZ=-(-iY)=iY=\begin{pmatrix}0&1\\-1&0\end{pmatrix}
    XZ=−iYXZ=-iY from the Pauli algebra.
  3. Step 3:
    A+B=iπ2(X+Z)=iπ2 H^,H^=X+Z2=H, H2=IA+B=\tfrac{i\pi}{2}(X+Z)=\tfrac{i\pi}{\sqrt2}\,\hat H,\qquad \hat H=\tfrac{X+Z}{\sqrt2}=H,\ H^2=I
    X+Z=(111−1)=2HX+Z=\begin{pmatrix}1&1\\1&-1\end{pmatrix}=\sqrt2H and the Hadamard is involutory.
  4. Step 4:
    eA+B=cos⁡π2 I+isin⁡π2 H≈(−0.6057+0.5626i0.5626i0.5626i−0.6057−0.5626i)e^{A+B}=\cos\tfrac{\pi}{\sqrt2}\,I+i\sin\tfrac{\pi}{\sqrt2}\,H\approx\begin{pmatrix}-0.6057+0.5626i&0.5626i\\0.5626i&-0.6057-0.5626i\end{pmatrix}
    Involutory formula with α=−π/2\alpha=-\pi/\sqrt2; cos⁡(π/2)≈−0.6057\cos(\pi/\sqrt2)\approx-0.6057 and sin⁡(π/2)/2≈0.5626\sin(\pi/\sqrt2)/\sqrt2\approx0.5626.
  5. Step 5:
    eA+B≠iY=eAeBe^{A+B}\ne iY=e^Ae^B
    The diagonal entries differ (−0.6057±0.5626i-0.6057\pm0.5626i versus 00).
  6. Step 6:
    [A,B]=(iπ2)2[X,Z]=−π24(−2iY)=iπ22Y≠0[A,B]=\big(\tfrac{i\pi}{2}\big)^2[X,Z]=-\tfrac{\pi^2}{4}(-2iY)=\tfrac{i\pi^2}{2}Y\ne0
    The failure is caused by non-commutation; if [A,B]=0[A,B]=0 the binomial theorem gives eA+B=eAeBe^{A+B}=e^Ae^B. Trotterisation (Stage 3) approximates eA+Be^{A+B} by (eA/neB/n)n(e^{A/n}e^{B/n})^n.
eiπ2(X+Z)=cos⁡π2 I+isin⁡π2 He^{i\frac\pi2(X+Z)}=\cos\tfrac{\pi}{\sqrt2}\,I+i\sin\tfrac{\pi}{\sqrt2}\,H
exp(iπ(X+Z)/2), a unitary that differs from exp(iπX/2)exp(iπZ/2)2×2

Unitary verified: U†U=IU^\dagger U = I (max deviation 0.0e+0)

Quick check

What is the real part of the top-left entry of e−i(π/3)X/2e^{-i(\pi/3)X/2}?

tolerance ±0.001

Quick check

What is RZ(2π)R_Z(2\pi)?

Select one answer

Check it numerically. The cell below computes e−i(π/3)X/2e^{-i(\pi/3)X/2} through the spectral decomposition of XX, compares it with cos⁡θ2I−isin⁡θ2X\cos\tfrac\theta2 I-i\sin\tfrac\theta2X, prints its real and imaginary parts and checks det⁡RX=1\det R_X=1.

Pythonrunnable
import numpy as np

X = np.array([[0, 1], [1, 0]], dtype=complex)
theta = np.pi / 3
evals, V = np.linalg.eigh(X)
expX = V @ np.diag(np.exp(-1j * theta / 2 * evals)) @ V.conj().T
formula = np.cos(theta / 2) * np.eye(2) - 1j * np.sin(theta / 2) * X
print(np.allclose(expX, formula))
print(np.round(formula.real, 4))
print(np.round(formula.imag, 4))
print(np.isclose(np.linalg.det(formula), 1))

Expected output

True
[[0.866 0.   ]
 [0.    0.866]]
[[ 0.  -0.5]
 [-0.5  0. ]]
True

References

  1. M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th anniversary ed., Cambridge University Press (2010), §2.1.6 (spectral decomposition, Theorem 2.1), §2.1.8 (operator functions) and §4.2 (rotation operators).
  2. S. Axler, Linear Algebra Done Right, 4th ed., Springer (2024), §7B (the complex spectral theorem).linear.axler.net
  3. R. A. Horn and C. R. Johnson, Matrix Analysis, 2nd ed., Cambridge University Press (2013), §2.5 (normal matrices and the spectral theorem); and R. A. Horn and C. R. Johnson, Topics in Matrix Analysis, Cambridge University Press (1991), Chapter 6 (matrices and functions).

Hands-on labs

  • Exponentiate a Pauli generator

    1 step · auto-graded

    Use X2=IX^2=I to sum the power series of e−iαXe^{-i\alpha X} in closed form and write the matrix of RX(π/3)=e−i(π/3)X/2R_X(\pi/3)=e^{-i(\pi/3)X/2}.

    Open lab