Lecture 1 - Complex Algebra

Updated 27 Nov 2026

Table of Contents

  1. Complex Vector
  2. Complex Matrix
  3. Unitary Matrix
  4. Matrix Exponentials
  5. Measurement and Reflection
  6. Conclusion

1. Complex Vector

Instructor's annotation


i=−1i = \sqrt{-1}, i2=−1i^2 = -1 — attributed to Descartes (who coined the term "imaginary number").

Complex Number

  • A complex number extends the real numbers with an additional imaginary part (multiplied by the imaginary unit i=−1i = \sqrt{-1}).
  • A complex number a+iba+ib can represent an arbitrary wave:
    • amplitude: A=a2+b2A = \sqrt{a^2+b^2}
    • phase: θ=arctan⁡(ba)\theta = \arctan\left(\dfrac{b}{a}\right)

u(x,t)=Acos⁡(kx−ωt+θ)u(x,t) = A\cos(kx - \omega t + \theta)

u(x,t)=u0ei(ωt−kx),u0=Aeiθ (at t=0, k=0)\boxed{u(x,t) = u_0 e^{i(\omega t - kx)}}, \qquad u_0 = Ae^{i\theta} \ \text{(at } t=0,\ k=0\text{)}

Analogy


Think of a complex number as a snapshot of a wave frozen at one instant — the modulus tells you how tall the wave is (amplitude), and the argument tells you where in its cycle it currently sits (phase).

Instructor's annotation


Aeiθ=A(cos⁡θ+isin⁡θ)Ae^{i\theta} = A(\cos\theta + i\sin\theta) — this is the same wave-to-complex-number correspondence shown above, written out explicitly by the instructor.

แทนที่จะเขียน constant แยก AA กับ θ\theta (phase) มันเลยมัดรวมเป็นก้อนเดียวนั่นคือ eiθe^{i\theta}

Complex Number (Polar Form)

  • Rectangular form: z=a+ibz = a + ib, where i=−1i=\sqrt{-1}
  • Polar form:
    z=reiθ=r(cos⁡θ+isin⁡θ)=rcisθz = re^{i\theta} = r(\cos\theta + i\sin\theta) = r\text{cis}\theta
  • Modulus: ∣z∣=a2+b2\boxed{|z| = \sqrt{a^2+b^2}}
  • Argument: arg⁡z=arctan⁡(b/a)\boxed{\arg z = \arctan(b/a)}
  • Conjugate: zˉ=a−ib\boxed{\bar z = a - ib} (MOST IMPORTANT)
  • zzˉ=a2+b2\boxed{z\bar z = a^2+b^2}
  • z−1=zˉa2+b2\boxed{z^{-1} = \dfrac{\bar z}{a^2+b^2}}


 Figure 2: Complex number and polar form
 - อันนี้ก็แตกแรงทั่วไป จำได้มั้ย ๆ

Instructor's annotation


Conjugate: zˉ=a−ib\bar z = a - ib (mirror across the real axis). From the polar triangle: b=rsin⁡θb = r\sin\theta, a=rcos⁡θa = r\cos\theta.

Analogy


Taking a conjugate is like reflecting the wave's phase upside-down — same amplitude, phase flipped in sign.

Exercise 1.1: Complex Numbers

  1. Let z=a+ibz=a+ib. Show that zzˉ=∣z∣2z\bar z = |z|^2.
  2. Let z=a+ibz=a+ib. Show that z−1=zˉ/(a2+b2)z^{-1} = \bar z/(a^2+b^2).
  3. Let z1=a+ibz_1=a+ib and z2=c+idz_2=c+id. Compute z1z2z_1z_2 in terms of a,b,c,da,b,c,d.
  4. Let z1=r1,cis,θ1z_1=r_1,\text{cis},\theta_1 and z2=r2,cis,θ2z_2=r_2,\text{cis},\theta_2. Compute z1z2z_1z_2 and z2z1z_2z_1 in terms of r1,r2,θ1,θ2r_1,r_2,\theta_1,\theta_2. Does complex multiplication preserve the commutative property?
  5. Let z=r,cis,θz=r,\text{cis},\theta. Show that zn=rncisnθz^n = r^n\text{cis}n\theta. #MidtermExam
  6. Let z=r,cis,θz=r,\text{cis},\theta. Show that zˉ=r,cis(−θ)\bar z=r,\text{cis}(-\theta).
  7. Let z=r,cis,θz=r,\text{cis},\theta. Show that zzˉ=r2z\bar z=r^2.
  8. Show that (1) cis,0=1\text{cis},0=1, (2) cis,π=−1\text{cis},\pi=-1, (3) cis,π2=i\text{cis},\dfrac{\pi}{2}=i, and (4) ∣cis,θ∣=1|\text{cis},\theta|=1.
  9. Study the Taylor series of exe^x, sin⁡x\sin x, cos⁡x\cos x:

ex=∑n=0∞xnn!sin⁡x=∑n=0∞(−1)n(2n+1)!x2n+1cos⁡x=∑n=0∞(−1)n(2n)!x2ne^x=\sum_{n=0}^{\infty}\frac{x^n}{n!}\qquad \sin x=\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)!}x^{2n+1}\qquad \cos x=\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}x^{2n}

Show that eiθ=cos⁡θ+isin⁡θe^{i\theta}=\cos\theta+i\sin\theta.

Instructor's annotation


worked example for Q1 Let z=1+2iz = 1+2i, so zˉ=1−2i\bar z = 1-2i. zzˉ=(1+2i)(1−2i)=1−4i2=1+4=5=∣z∣2z\bar z = (1+2i)(1-2i) = 1 - 4i^2 = 1+4 = 5 = |z|^2 (since ∣z∣2=12+22=5|z|^2 = 1^2+2^2=5). Also written as z=rcisθz=r\text{cis}\theta, zˉ=rcis(−θ)\bar z = r\text{cis}(-\theta).

Instructor's annotation


Q9 (Euler's formula) worked derivation Starting from the definition eiθ=∑n≥0(iθ)nn!e^{i\theta}=\sum_{n\ge0}\dfrac{(i\theta)^n}{n!}, expand term by term: eiθ=1+iθ1!+i2θ22!+i3θ33!+i4θ44!+…e^{i\theta}=1+\frac{i\theta}{1!}+\frac{i^2\theta^2}{2!}+\frac{i^3\theta^3}{3!}+\frac{i^4\theta^4}{4!}+\dots Substitute i2=−1, i3=−i, i4=1,…i^2=-1,\ i^3=-i,\ i^4=1,\dots: =1+iθ1!+(−1)θ22!+−iθ33!+(+1)θ44!+…=1+\frac{i\theta}{1!}+\frac{(-1)\theta^2}{2!}+\frac{-i\theta^3}{3!}+\frac{(+1)\theta^4}{4!}+\dots Separate into even terms (real, no ii) and odd terms (imaginary, carry one factor of ii): =[1+(−1)θ22!+(+1)θ44!+… ]⏟even terms+[iθ1!+(−1)iθ33!+(+1)iθ55!+… ]⏟odd terms=\underbrace{\left[1+\frac{(-1)\theta^2}{2!}+\frac{(+1)\theta^4}{4!}+\dots\right]}_{\text{even terms}} + \underbrace{\left[\frac{i\theta}{1!}+\frac{(-1)i\theta^3}{3!}+\frac{(+1)i\theta^5}{5!}+\dots\right]}_{\text{odd terms}} Factor ii out of the odd terms: =[1−θ22!+θ44!−… ]+i[θ1!−θ33!+θ55!−… ]=\left[1-\frac{\theta^2}{2!}+\frac{\theta^4}{4!}-\dots\right] + i\left[\frac{\theta}{1!}-\frac{\theta^3}{3!}+\frac{\theta^5}{5!}-\dots\right] =cos⁡θ+isin⁡θ\boxed{=\cos\theta + i\sin\theta}

บอกว่า too easy - ไม่ออก #MidtermExam หรอก 5555

Trigonometric Values and Identities

image-4 Unit-circle diagram marking 0°, 30°, 45°, 60°, 90°

θ\thetasin⁡θ\sin\thetacos⁡θ\cos\thetatan⁡θ\tan\theta
00001100
π/12\pi/126−24\frac{\sqrt6-\sqrt2}{4}6+24\frac{\sqrt6+\sqrt2}{4}2−32-\sqrt3
π/6\pi/61/21/23/2\sqrt3/21/31/\sqrt3
π/4\pi/41/21/\sqrt21/21/\sqrt211
π/3\pi/33/2\sqrt3/21/21/23\sqrt3
5π/125\pi/126+24\frac{\sqrt6+\sqrt2}{4}6−24\frac{\sqrt6-\sqrt2}{4}2+32+\sqrt3
π/2\pi/21100undefined

Identities:

  • sin⁡(π/2−θ)=cos⁡θcos⁡(π/2−θ)=sin⁡θ\sin(\pi/2-\theta)=\cos\theta \qquad \cos(\pi/2-\theta)=\sin\theta
  • sin⁡(θ+π/2)=−cos⁡θcos⁡(θ+π/2)=sin⁡θ\sin(\theta+\pi/2)=-\cos\theta \qquad \cos(\theta+\pi/2)=\sin\theta
  • sin⁡(θ+nπ)=(−1)nsin⁡θcos⁡(θ+nπ)=(−1)ncos⁡θ\sin(\theta+n\pi)=(-1)^n\sin\theta \qquad \cos(\theta+n\pi)=(-1)^n\cos\theta
  • sin⁡(−θ)=−sin⁡θcos⁡(−θ)=cos⁡θ\sin(-\theta)=-\sin\theta \qquad \cos(-\theta)=\cos\theta
  • sin⁡2θ+cos⁡2θ=1\sin^2\theta+\cos^2\theta=1
  • sin⁡(α+β)=sin⁡αcos⁡β+cos⁡αsin⁡β\sin(\alpha+\beta)=\sin\alpha\cos\beta+\cos\alpha\sin\beta
  • cos⁡(α+β)=cos⁡αcos⁡β−sin⁡αsin⁡β\cos(\alpha+\beta)=\cos\alpha\cos\beta-\sin\alpha\sin\beta
  • sin⁡(α−β)=sin⁡αcos⁡β−cos⁡αsin⁡β\sin(\alpha-\beta)=\sin\alpha\cos\beta-\cos\alpha\sin\beta
  • cos⁡(α−β)=cos⁡αcos⁡β+sin⁡αsin⁡β\cos(\alpha-\beta)=\cos\alpha\cos\beta+\sin\alpha\sin\beta

Exercise 1.2: cis and arg

Compute the following quantities:

  1. cis(0)\text{cis}(0)
  2. cis(π/6)\text{cis}(\pi/6)
  3. cis(π/4)\text{cis}(\pi/4)
  4. cis(π/3)\text{cis}(\pi/3)
  5. cis(π/2)\text{cis}(\pi/2)
  6. cis(2π/3)\text{cis}(2\pi/3)
  7. cis(3π/4)\text{cis}(3\pi/4)
  8. cis(5π/6)\text{cis}(5\pi/6)
  9. cis(4π/3)\text{cis}(4\pi/3)
  10. cis(π)\text{cis}(\pi)
  11. arg⁡(0)\arg(0)
  12. arg⁡(1)\arg(1)
  13. arg⁡(−1)\arg(-1)
  14. arg⁡(i)\arg(i)
  15. arg⁡(−i)\arg(-i)
  16. arg⁡(i+1)\arg(i+1)
  17. arg⁡(i−1)\arg(i-1)
  18. arg⁡(−i−1)\arg(-i-1)
  19. arg⁡(3i+3)\arg(\sqrt3 i +3)
  20. arg⁡(i+2)\arg(i+2)

Instructor's annotation


worked examples

  • cis(0)=cos⁡0+isin⁡0=1+0i\text{cis}(0)=\cos0+i\sin0=1+0i
  • cis(π/6)=cos⁡30°+isin⁡30°=32+12i\text{cis}(\pi/6)=\cos30°+i\sin30°=\dfrac{\sqrt3}{2}+\dfrac{1}{2}i
  • cis(π/4)=cos⁡45°+isin⁡45°=22+22i\text{cis}(\pi/4)=\cos45°+i\sin45°=\dfrac{\sqrt2}{2}+\dfrac{\sqrt2}{2}i

Complex Vector

  • A complex vector is a multiplex of NN waves, with amplitudes rir_i and phases ωi\omega_i:
    u=[r1,cis,ω1…rN,cis,ωN]⊤\mathbf u = \begin{bmatrix} r_1,\text{cis},\omega_1 & \dots & r_N,\text{cis},\omega_N \end{bmatrix}^\top

 Figure 3: Complex vector as a wave multiplex

Instructor's annotation


Two ways of writing a vector: u‾\underline{u} vs. u⃗\vec{u} — corresponds to Cambridge vs. Oxford notation conventions. A complex vector consists of multiple component waves.

Synchronicity and Inner Product

คงจะจำ Dot product 3 - Norms กันได้ but it only applies on real vector, but in complex vector, we need another operator: INNER PRODUCT (complex version of dot operator)

  • Inner product of two wave multiplexes u=[r1,cis,ω1 … rN,cis,ωN]⊤\mathbf u = [r_1,\text{cis},\omega_1\ \dots\ r_N,\text{cis},\omega_N]^\top and v=[s1,cis,φ1 … sN,cis,φN]⊤\mathbf v = [s_1,\text{cis},\varphi_1\ \dots\ s_N,\text{cis},\varphi_N]^\top:

u∨v=u⋅v‾=u⊤v‾=∑k=1Nrkskcis(θk−ϕk)\boxed{\mathbf u \vee \mathbf v = \mathbf u \cdot \overline{\mathbf{v}} = \mathbf u^\top \overline{\mathbf v} = \sum_{k=1}^N r_k s_k\text{cis}(\theta_k-\phi_k)}

  • Phase synchronicity u∨v\mathbf u \vee \mathbf v: the state of fluctuating in similar phases.
    • Similar phases → zero phase difference → real amplitude.
    • Dissimilar phases → non-zero phase difference → complex amplitude.
  • Norm: ∣u∣=u∨u\boxed{|\mathbf u| = \sqrt{\mathbf u \vee \mathbf u}}
    • Its own inner product
    • ∣u12∣+⋯+∣uN2∣\sqrt{|u_1^2|+\dots+|u_N^2|}


Figure 4: Phase synchronicity of two waves ("in sync" vs. "out of sync")

Instructor's annotation


u⋅v=r1s1cis(ω1+φ1)+⋯+rNsNcis(ωN+φN)\mathbf u\cdot\mathbf v = r_1s_1\text{cis}(\omega_1+\varphi_1)+\dots+r_Ns_N\text{cis}(\omega_N+\varphi_N)
— ถ้าแค่ dot กันธรรมดา phase จะต้องเอามาบวกกัน

Instructor's annotation


u∨v=r1s1cis(ω1−φ1)+⋯+rNsNcis(ωN−φN)\mathbf u\vee\mathbf v = r_1s_1\text{cis}(\omega_1-\varphi_1)+\dots+r_Ns_N\text{cis}(\omega_N-\varphi_N)
— the "dot" operator here is a dot product with a conjugate baked in (phase difference, not phase sum). The result u∨v\mathbf u \vee \mathbf v is a single complex number.

Analogy


Inner product is like checking how "in step" two dancers' rhythms are — if their phases line up, the result feels purely "real" (in sync); if they're off-beat, you get a leftover imaginary part.

Exercise 1.3: Complex Vectors and Phase Synchronicity

  1. Let u=[r1 … rN]⊤\mathbf u=[r_1\ \dots\ r_N]^\top. Show that u∨u=∑i=1N∣ri∣2\mathbf u\vee\mathbf u=\sum_{i=1}^N|r_i|^2.
  2. Let u=[r1,cis,ω1 … rN,cis,ωN]⊤\mathbf u=[r_1,\text{cis},\omega_1\ \dots\ r_N,\text{cis},\omega_N]^\top. Show that uˉ=[r1,cis(−ω1) … rN,cis(−ωN)]⊤\bar{\mathbf u}=[r_1,\text{cis}(-\omega_1)\ \dots\ r_N,\text{cis}(-\omega_N)]^\top.
  3. Let u=[r1,cis,ω1 … rN,cis,ωN]⊤\mathbf u=[r_1,\text{cis},\omega_1\ \dots\ r_N,\text{cis},\omega_N]^\top. Show that ∣u∣=∑i=1Nri2|\mathbf u|=\sqrt{\sum_{i=1}^N r_i^2}. #Important
  4. Let u,v\mathbf u,\mathbf v be two complex vectors of the same size NN. Show that u∨v=v∨u‾\mathbf u\vee\mathbf v = \overline{\mathbf v\vee\mathbf u}. Does the inner product preserve the commutative property? #Important
  5. Let u=[r1,cis,ω1 … rN,cis,ωN]⊤\mathbf u=[r_1,\text{cis},\omega_1\ \dots\ r_N,\text{cis},\omega_N]^\top. Show that u,(cis,ϕ)=[r1,cis(ω1+ϕ) … rN,cis(ωN+ϕ)]⊤\mathbf u,(\text{cis},\phi) = [r_1,\text{cis}(\omega_1+\phi)\ \dots\ r_N,\text{cis}(\omega_N+\phi)]^\top.
  6. Let u=[r1,cis,ω1 … rN,cis,ωN]⊤\mathbf u=[r_1,\text{cis},\omega_1\ \dots\ r_N,\text{cis},\omega_N]^\top. Compute ∣u∣|\mathbf u|.
  7. Normalize a complex vector into a unit vector: unit(u)=u/∣u∣\text{unit}(\mathbf u)=\mathbf u/|\mathbf u|. Show that unit(u)∨unit(u)=1\text{unit}(\mathbf u)\vee\text{unit}(\mathbf u)=1. #Important

Instructor's annotation


u∨v‾=vˉ⊤u=v∨u\overline{\mathbf u\vee\mathbf v} = \bar{\mathbf v}^\top\mathbf u = \mathbf v\vee\mathbf u (i.e., u∨v\mathbf u\vee\mathbf v is not literally commutative — swapping conjugates the result). cis(−θ)=cos⁡θ−isin⁡θ\text{cis}(-\theta)=\cos\theta - i\sin\theta, confirming cis(−θ)=cis(θ)‾\text{cis}(-\theta)=\overline{\text{cis}(\theta)}.


2. Complex Matrix

Complex Matrix

  • A complex matrix is a sequence of MM wave multiplexes:

A=[a(1)…a(M)]=[a1(1)…a1(M)⋮⋱⋮aN(1)…aN(M)]N×MA = \begin{bmatrix} \mathbf{a}^{(1)} & \dots & \mathbf{a}^{(M)} \end{bmatrix} = \begin{bmatrix} a^{(1)}_1 & \dots & a^{(M)}_1 \\ \vdots & \ddots & \vdots \\ a^{(1)}_N & \dots & a^{(M)}_N \end{bmatrix}_{N \times M}

 Figure 5: Complex matrix as a sequence of wave multiplexes (a dataset of M points in N dimensions)

Hermitian Matrix

  • Adjoint (conjugate transpose): A∗=Aˉ⊤\boxed{A^* = \bar A^\top}
  • Square matrix AA is Hermitian (diagonally symmetric) if A∗=AA^*=A.
  • AvA\mathbf v yields a sequence of projections of input v\mathbf v onto each basis a(j)\mathbf a^{(j)}:
Av=(v∗A∗)∗=(v∗A)∗=[v‾∨a(1)…v‾∨a(M)]∗=[v∨a(1)‾…v∨a(M)‾]⊤=[v⊤a(1)⋮v⊤a(M)]=[v‾⋅a‾(1)⋮v‾⋅a‾(M)]\begin{align*} A\mathbf{v} &= (\mathbf{v}^* A^*)^* = (\mathbf{v}^* A)^* \\ &= \begin{bmatrix} \overline{\mathbf{v}} \vee \mathbf{a}^{(1)} & \dots & \overline{\mathbf{v}} \vee \mathbf{a}^{(M)} \end{bmatrix}^* \\ &= \begin{bmatrix} \mathbf{v} \vee \overline{\mathbf{a}^{(1)}} & \dots & \mathbf{v} \vee \overline{\mathbf{a}^{(M)}} \end{bmatrix}^\top \\ &= \begin{bmatrix} \mathbf{v}^\top \mathbf{a}^{(1)} \\ \vdots \\ \mathbf{v}^\top \mathbf{a}^{(M)} \end{bmatrix} = \begin{bmatrix} \underline{\mathbf{v}} \cdot \underline{\mathbf{a}}^{(1)} \\ \vdots \\ \underline{\mathbf{v}} \cdot \underline{\mathbf{a}}^{(M)} \end{bmatrix} \end{align*}
  • Each element of AvA\mathbf v is equivalent to stretching and rotating v\mathbf v by each a(j)\mathbf a^{(j)} in a linear transformation.

Instructor's annotation


The adjoint A†A^\dagger (or A∗A^*) is defined for any matrix, but AA is only called Hermitian when A∗=AA^* = A. It is named after mathematician Charles Hermite.

Trick for checking Hermitian Matrix

Affine Transformation via Hermitian Matrix

  • ABAB transforms each data point b(j)\mathbf b^{(j)} onto an affine space whose bases are the column vectors of Hermitian matrix AA:

AB=[Ab(1)…Ab(M)]AB = \begin{bmatrix} A\mathbf b^{(1)} & \dots & A\mathbf b^{(M)} \end{bmatrix}

  • Differs from a plain linear transformation: each basis of the affine space is a wave superposition, performing stretching and rotation simultaneously.

 Figure 6: Affine transformation

Instructor's annotation


Distinguishes an affine-space transformation (via a Hermitian matrix, stretch + rotate together) from an ordinary linear transformation.

Analogy


A linear transformation just points you in a new direction; an affine (Hermitian-based) transformation is like doing that and zooming the camera in or out at the same time.

Exercise 1.4: Complex Matrix

Check if the following matrices are Hermitian:

  1. [0101]\begin{bmatrix}0&1\\0&1\end{bmatrix}
  2. [01i1]\begin{bmatrix}0&1\\i&1\end{bmatrix} (compare against [i1−i1]\begin{bmatrix}i&1\\-i&1\end{bmatrix} variant shown in source)
  3. [2i1−i]\begin{bmatrix}2&i\\1&-i\end{bmatrix}
  4. [35cisπ35cisπ35]\begin{bmatrix}3 & 5\text{cis}\frac{\pi}{3}\\ 5\text{cis}\frac{\pi}{3} & 5\end{bmatrix}
  5. [5cisπ33cisπ43cis(−π4)−5cisπ3]\begin{bmatrix}5\text{cis}\frac{\pi}{3} & 3\text{cis}\frac{\pi}{4}\\ 3\text{cis}(-\frac{\pi}{4}) & -5\text{cis}\frac{\pi}{3}\end{bmatrix}

Compute the following matrix multiplications (make sure the left operands are Hermitian):

  1. [i1−i1]×[1−1]\begin{bmatrix}i&1\\-i&1\end{bmatrix}\times\begin{bmatrix}1\\-1\end{bmatrix}
  2. [i1−i1]×[−3+4i5+6i]\begin{bmatrix}i&1\\-i&1\end{bmatrix}\times\begin{bmatrix}-3+4i\\5+6i\end{bmatrix}
  3. [5cisπ33cisπ43,cis(−π4)−5,cisπ3]×[4,cisπ43,cis2π3]\begin{bmatrix}5\text{cis}\frac{\pi}{3} & 3\text{cis}\frac{\pi}{4}\\ 3,\text{cis}(-\frac{\pi}{4}) & -5,\text{cis}\frac{\pi}{3}\end{bmatrix}\times\begin{bmatrix}4,\text{cis}\frac{\pi}{4}\\3,\text{cis}\frac{2\pi}{3}\end{bmatrix} (SKIP ซ้ายไม่เป็น Hermitian)
  4. [5,cisπ33,cisπ43,cis(−π4)−5,cisπ3]×[cisπ2textcisπ3]\begin{bmatrix}5,\text{cis}\frac{\pi}{3} & 3,\text{cis}\frac{\pi}{4}\\ 3,\text{cis}(-\frac{\pi}{4}) & -5,\text{cis}\frac{\pi}{3}\end{bmatrix}\times\begin{bmatrix}\text{cis}\frac{\pi}{2}\\text{cis}\frac{\pi}{3}\end{bmatrix} (SKIP ซ้ายไม่เป็น Hermitian)
  5. [cisπ3cis(−π4)cisπ4cis3π4]×[cisπ2textcisπ3]\begin{bmatrix}\text{cis}\frac{\pi}{3} & \text{cis}(-\frac{\pi}{4})\\ \text{cis}\frac{\pi}{4} & \text{cis}\frac{3\pi}{4}\end{bmatrix}\times\begin{bmatrix}\text{cis}\frac{\pi}{2}\\text{cis}\frac{\pi}{3}\end{bmatrix} (SKIP ซ้ายไม่เป็น Hermitian)
  6. [i1−i1]×[1−3+4i3−2i−15+6i1+i]\begin{bmatrix}i&1\\-i&1\end{bmatrix}\times\begin{bmatrix}1 & -3+4i & 3-2i\\-1 & 5+6i & 1+i\end{bmatrix}
  7. [cisπ3cis(−π4)cisπ4cis3π4]×[cisπ2cisπ2textcisπ3cisπ3]\begin{bmatrix}\text{cis}\frac{\pi}{3} & \text{cis}(-\frac{\pi}{4})\\ \text{cis}\frac{\pi}{4} & \text{cis}\frac{3\pi}{4}\end{bmatrix}\times\begin{bmatrix}\text{cis}\frac{\pi}{2} & \text{cis}\frac{\pi}{2}\\text{cis}\frac{\pi}{3} & \text{cis}\frac{\pi}{3}\end{bmatrix} (SKIP ซ้ายไม่เป็น Hermitian)

Answer the following:

  1. Explain why AA has to be Hermitian so that we can compute AvA\mathbf v, where v\mathbf v is a complex vector. (Important)
  2. Check if each matrix AA in exercises 1–5 satisfies: for all pairs of column vectors a(i),a(j)\mathbf a^{(i)},\mathbf a^{(j)}, i≠ji\ne j, in AA: a(i)∨a(j)=0\mathbf a^{(i)}\vee\mathbf a^{(j)}=0.
  3. Let A=[a(1)∣…∣a(M)]A=[\mathbf a^{(1)}|\dots|\mathbf a^{(M)}] be Hermitian, where each kk-th element of a(j)\mathbf a^{(j)} is ak(j)=rk(j),cis,ωk(j)a^{(j)}_k = r^{(j)}_k,\text{cis},\omega^{(j)}_k. Let v=[s1 … sN]⊤\mathbf v=[s_1\ \dots\ s_N]^\top, where each kk-th element is sk=rk,cis,θks_k=r_k,\text{cis},\theta_k. Show that each jj-th element of AvA\mathbf v can be seen as stretching and rotation of v\mathbf v by each a(j)\mathbf a^{(j)}.
  4. Explain why ABAB can be seen as manipulating each data point b(j)\mathbf b^{(j)} in BB by stretching and rotation. #Important #MidtermExam

Instructor's annotation


A few checkmarks/short notes appear beside items 4–5 and the multiplication problems — mostly confirming A∗=AA^*=A before proceeding, not legible enough to transcribe word-for-word.

Determinant

  • Determinant is the volume scaling factor (streching and scaling) of a square matrix AA of N×NN\times N dimensions:
det⁡(A)={a1,1,if M=1∑k=1M(−1)j+kaj,kdet⁡(A¬j,¬k),for any row j\det(\mathbf{A}) = \begin{cases} a_{1,1} &, \text{if } M = 1 \\[6pt] \sum_{k=1}^M (-1)^{j+k} a_{j,k} \det(\mathbf{A}_{\neg j, \neg k}) &, \text{for any row } j \end{cases}

where the minor A¬i,¬jA_{\lnot i,\lnot j} is computed by removing row ii and column jj.

Example 1: det⁡[1234]=1×4−2×3=−2\det\begin{bmatrix}1&2\\3&4\end{bmatrix} = 1\times4 - 2\times3 = -2
Example 2: det⁡[i2−i1]=i×1−(−i)×2=3i\det\begin{bmatrix}i&2\\-i&1\end{bmatrix} = i\times1 - (-i)\times2 = 3i
3i3i can also be written in polar form as 3∠90°=3cis(π2)3\angle90° = 3\text{cis}\left(\dfrac{\pi}{2}\right), tying the determinant result back to the polar-form notation from earlier.

Example 3: det⁡[123456789]=+1det⁡[5689]−2det⁡[4679]+3det⁡[4578]\det\begin{bmatrix}1&2&3\\4&5&6\\7&8&9\end{bmatrix} = +1\det\begin{bmatrix}5&6\\8&9\end{bmatrix} - 2\det\begin{bmatrix}4&6\\7&9\end{bmatrix} + 3\det\begin{bmatrix}4&5\\7&8\end{bmatrix}03 Determinants

Instructor's annotation


Calls the general determinant formula "daunting" — reassurance that in practice you mostly use the 2×22\times2/3×33\times3 shortcuts below.

Special Properties of Determinant

  • For any 2×22\times2 matrix: det⁡[abcd]=ad−bc\boxed{\det\begin{bmatrix}a&b\\c&d\end{bmatrix} = ad-bc}
  • For any 3×33\times3 matrix: det⁡[abcdefghi]=aei+bfg+cdh−ceg−hfa−bdi\boxed{\det\begin{bmatrix}a&b&c\\d&e&f\\g&h&i\end{bmatrix} = aei+bfg+cdh-ceg-hfa-bdi}
  • For any triangular or diagonal matrix: det⁡[a1…∗⋱⋮0aN]=⋯=∏i=1Nai\det \begin{bmatrix} a_1 & \dots & * \\ & \ddots & \vdots \\ 0 & & a_N \end{bmatrix} = \dots = \boxed{\prod_{i=1}^N a_i}
  • For any square matrix: det⁡(A⊤)=det⁡(A)\boxed{\det(A^\top) = \det(A)}
  • For any block-diagonal matrix, with sub-matrices AiA_i: det⁡[A10⋱0AM]=∏i=1Mdet⁡(Ai)\boxed{ \det \begin{bmatrix} \mathbf{A}_1 & & \mathbf{0} \\ & \ddots & \\ \mathbf{0} & & \mathbf{A}_M \end{bmatrix} = \prod_{i=1}^M \det(\mathbf{A}_i) }

Exercise 1.5: Determinant

Find the determinants of these matrices:

  1. [010−1]\begin{bmatrix}0&1\\0&-1\end{bmatrix}
  2. [i−10i0]\begin{bmatrix}i-1 & 0\\i & 0\end{bmatrix} (exact entries slightly unclear in scan)
  3. [3+i002+4i3−i06+3i1+i2]\begin{bmatrix}3+i & 0 & 0\\2+4i & 3-i & 0\\6+3i & 1+i & 2\end{bmatrix}
  4. [1200034000005000006700089]\begin{bmatrix}1&2&0&0&0\\3&4&0&0&0\\0&0&5&0&0\\0&0&0&6&7\\0&0&0&8&9\end{bmatrix}
det⁡[1200034000005000006700089]=det⁡[1234]⋅det⁡[5]⋅det⁡[6789]\det \begin{bmatrix} 1 & 2 & 0 & 0 & 0 \\ 3 & 4 & 0 & 0 & 0 \\ 0 & 0 & 5 & 0 & 0 \\ 0 & 0 & 0 & 6 & 7 \\ 0 & 0 & 0 & 8 & 9 \end{bmatrix} = \det \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \cdot \det \begin{bmatrix} 5 \end{bmatrix} \cdot \det \begin{bmatrix} 6 & 7 \\ 8 & 9 \end{bmatrix}

Answer:

  1. Because for any square matrix AA, det⁡(A⊤)=det⁡(A)\det(A^\top)=\det(A), show that det⁡(A∗)=det⁡(A)‾\det(A^*)=\overline{\det(A)}.
  2. Show that for any diagonal matrix, det⁡[a10⋱0aN]=∏i=1Nai\det\begin{bmatrix}a_1 & 0\\ & \ddots \\ 0 & a_N\end{bmatrix} = \prod_{i=1}^N a_i.

Instructor's annotation


A few working checkmarks beside items 3–4 confirming block/triangular structure lets you skip most of the cofactor expansion — not fully legible beyond that.

Outer Product and Wave Interaction

  • Outer product of u=[r1,cis,ω1 … rN,cis,ωN]⊤\mathbf u=[r_1,\text{cis},\omega_1\ \dots\ r_N,\text{cis},\omega_N]^\top and v=[s1,cis,φ1 … sN,cis,φN]⊤\mathbf v=[s_1,\text{cis},\varphi_1\ \dots\ s_N,\text{cis},\varphi_N]^\top is the phase synchronicity between every pair (i,j)(i,j):
u∧v=uv∗=[r1s1cis⁡(θ1−ϕ1)…r1sNcis⁡(θ1−ϕN)⋮⋱⋮rNs1cis⁡(θN−ϕ1)…rNsNcis⁡(θN−ϕN)]\begin{align*} \mathbf{u} \wedge \mathbf{v} &= \mathbf{u}\mathbf{v}^* \\ &= \begin{bmatrix} r_1 s_1 \operatorname{cis}(\theta_1 - \phi_1) & \dots & r_1 s_N \operatorname{cis}(\theta_1 - \phi_N) \\ \vdots & \ddots & \vdots \\ r_N s_1 \operatorname{cis}(\theta_N - \phi_1) & \dots & r_N s_N \operatorname{cis}(\theta_N - \phi_N) \end{bmatrix} \end{align*}
  • Inner product u∨v\mathbf u\vee\mathbf v reflects synchronicity of the two multiplexes combined into one number: u∨v=u⊤v=∑i=1Nrisi\mathbf u\vee\mathbf v=\mathbf u^\top\mathbf v=\sum_{i=1}^N r_is_i
  • Outer product u∧v\mathbf u\wedge\mathbf v reflects the synchronicity of each component pair separately — like a heatmap.

Instructor's annotation


Key distinction: u∨v\mathbf u\vee\mathbf v is a number (inner product); u∧v\mathbf u\wedge\mathbf v is a matrix (outer product).

Analogy


If inner product is "how in-sync are these two dancers overall," outer product is the full grid of "how in-sync is dancer ii's move with dancer jj's move" for every pair — the whole heatmap instead of one summary number.

Orthogonal Projector

  • An orthogonal projector is a matrix AA satisfying:
    • Idempotency: A2=AA^2=A
    • Self-adjunction: A∗=AA^*=A
  • For any unit vector u\mathbf u, its self-outer product PuP_{\mathbf u} is an orthogonal projector:

Pu=u∧u=uu∗=uu⊤\boxed{P_{\mathbf u} = \mathbf u\wedge\mathbf u = \mathbf u\mathbf u^* = \mathbf u\mathbf u^\top}

(Note u∗u=1\mathbf u^*\mathbf u=1 since ∣u∣=1|\mathbf u|=1.)


Figure 7: Orthogonal projector u∧u\mathbf u\wedge\mathbf u projecting vector v\mathbf v onto u\mathbf u

Pu‾v‾=(u‾∧u‾)⋅v‾=(u‾u‾∗)⋅v‾=u‾(u‾∗v‾)=u‾(u‾‾⋅v‾)=u‾(v‾∨u‾)\begin{aligned} P_{\underline{u}} \underline{v} &= (\underline{u} \wedge \underline{u}) \cdot \underline{v} \\ &= (\underline{u} \underline{u}^*) \cdot \underline{v} \\ &= \underline{u} (\underline{u}^* \underline{v}) = \underline{u} (\overline{\underline{u}} \cdot \underline{v}) \\ &= \underline{u} (\underline{v} \vee \underline{u}) \end{aligned}

WEEK 4\text{WEEK 4}


Instructor's annotation — derivation

Puv=(u∧u)v=(uu∗)v=u(u∗v)=u(u∨v)P_{\mathbf u}\mathbf v = (\mathbf u\wedge\mathbf u)\mathbf v = (\mathbf u\mathbf u^*)\mathbf v = \mathbf u(\mathbf u^*\mathbf v) = \mathbf u(\mathbf u\vee\mathbf v)

Exercise 1.6: Outer Product and Wave Interaction

Compute the following outer products:

  1. [1−i]∧[1−1]\begin{bmatrix}1\\-i\end{bmatrix}\wedge\begin{bmatrix}1\\-1\end{bmatrix}
  2. [1−i]∧[−3+4i5+6i]\begin{bmatrix}1\\-i\end{bmatrix}\wedge\begin{bmatrix}-3+4i\\5+6i\end{bmatrix}
  3. [5,cisπ33,cis(−π4)]∧[4,cisπ43,cis2π3]\begin{bmatrix}5,\text{cis}\frac{\pi}{3}\\3,\text{cis}(-\frac{\pi}{4})\end{bmatrix}\wedge\begin{bmatrix}4,\text{cis}\frac{\pi}{4}\\3,\text{cis}\frac{2\pi}{3}\end{bmatrix}
  4. [5,cisπ33,cis(−π4)]∧[cisπ2textcisπ3]\begin{bmatrix}5,\text{cis}\frac{\pi}{3}\\3,\text{cis}(-\frac{\pi}{4})\end{bmatrix}\wedge\begin{bmatrix}\text{cis}\frac{\pi}{2}\\text{cis}\frac{\pi}{3}\end{bmatrix}
  5. [cisπ3textcisπ4]∧[cisπ2textcisπ3]\begin{bmatrix}\text{cis}\frac{\pi}{3}\\text{cis}\frac{\pi}{4}\end{bmatrix}\wedge\begin{bmatrix}\text{cis}\frac{\pi}{2}\\text{cis}\frac{\pi}{3}\end{bmatrix}

Answer:

  1. Let u=[r1,cis,ω1 … rN,cis,ωN]⊤\mathbf u=[r_1,\text{cis},\omega_1\ \dots\ r_N,\text{cis},\omega_N]^\top. Compute u∧u\mathbf u\wedge\mathbf u.
  2. Show that (u∧v)∗=v∧u(\mathbf u\wedge\mathbf v)^* = \mathbf v\wedge\mathbf u.
  3. Show that Puv=u(v∨u)P_{\mathbf u}\mathbf v = \mathbf u(\mathbf v\vee\mathbf u).
  4. Show that for any unit vector u\mathbf u, its self-outer product u∧u\mathbf u\wedge\mathbf u complies with the idempotent and self-adjoint properties.
  5. Show that if w=αu+βv\mathbf w=\alpha\mathbf u+\beta\mathbf v, then w∧w=∣α∣2(u∧u)+∣β∣2(v∧v)+αβˉ(u∧v)+αˉβ(v∧u)\mathbf w\wedge\mathbf w = |\alpha|^2(\mathbf u\wedge\mathbf u)+|\beta|^2(\mathbf v\wedge\mathbf v)+\alpha\bar\beta(\mathbf u\wedge\mathbf v)+\bar\alpha\beta(\mathbf v\wedge\mathbf u)

3. Unitary Matrix

Foundation of quantum computing
Recall: Hermitian Matrix (A=A∗A=A^*)

Instructor's annotation


Unitary ~ "perpendicular" — a quick mnemonic tying unitary matrices back to orthonormal (mutually perpendicular unit) basis vectors.

Unitary Matrix

  • Two vectors u,v\mathbf u,\mathbf v are orthonormal if they are unit vectors, orthogonal to each other: u∨v=0\mathbf u\vee\mathbf v=0
  • Matrix AA is orthonormal if all pairs a(i),a(j)\mathbf a^{(i)},\mathbf a^{(j)} in AA are orthonormal.
  • If AA is orthonormal, its inverse is easy to find (no Gaussian elimination needed on [A∣I][A|I]):

A−1=A∗=A‾⊤A^{-1} = A^* = \overline{A}^\top

  • AA is a unitary matrix if it is both Hermitian (A∗=AA^*=A) and orthonormal (A−1=A∗A^{-1}=A^*):

A∗A=AA∗ =AA=I\boxed{A^* A = AA^* = AA = I}

  • A unitary matrix can be used as a non-stretching rotary operator for complex vectors.


Figure 8: Non-unitary vs. unitary matrices

  • Non-unitary = rotation + stretching
  • Unitary = limited to rotation only!!
    • All quantum gates are rotation

Unitary Matrix (1 หน่วย) = if HERMITIAN and ORTHONORMAL


ถ้าเป็น 3D (มีลูกศร 3 เส้น) แล้วมันเป็น Unitary Matrix ก็จะได้เป็น cube 1 หน่วย

ทำไมต้องมีสิ่งนี้ → มันคือ Quantum gate (just like logic gate)
We assume all quantum gate to be unitary matrix!!

Exercise 1.7: Unitary Matrix

Check if these matrices are unitary (Hermitian and orthonormal):

  1. [0101]\begin{bmatrix}0&1\\0&1\end{bmatrix}
  2. 12[1−ii1]\dfrac{1}{\sqrt2}\begin{bmatrix}1&-i\\i&1\end{bmatrix}
  3. [2i1−i]\begin{bmatrix}2&i\\1&-i\end{bmatrix}
  4. [cisπ6cisπ4textcis(−π4)cis(−π3)]\begin{bmatrix}\text{cis}\frac{\pi}{6} & \text{cis}\frac{\pi}{4}\\text{cis}(-\frac{\pi}{4}) & \text{cis}(-\frac{\pi}{3})\end{bmatrix}
  5. [100001010]\begin{bmatrix}1&0&0\\0&0&1\\0&1&0\end{bmatrix}

Answer:

  1. Show that any unitary matrix of N×NN\times N dimensions can be written as A=[cis,θ1,1…⋮⋱…cis,θN,N]A=\begin{bmatrix}\text{cis},\theta_{1,1} & \dots \\ \vdots & \ddots \\ \dots & \text{cis},\theta_{N,N}\end{bmatrix}.
  2. Show that the inverse of AA in Ex. 6 is A−1A^{-1} with each entry conjugated (phase-negated): cis(−θj,i)\text{cis}(-\theta_{j,i}) in transposed position.
  3. From Ex. 6, show that any unitary matrix can be seen as a non-stretching rotary operator.

Eigen-Decomposition

  • A square matrix AA can be factorized into an eigenvector v\mathbf v and its eigenvalue λ\lambda:

Av=λv\boxed{A\mathbf v = \lambda\mathbf v}

  • Eigenvector: the projectory direction in which the affine space becomes unitary.
  • Eigenvalue: its distortion rate.
  • Matrix AA of N×NN\times N dimensions has at most NN eigen-pairs (λi,vi)i=1N=eigen(A)(\lambda_i,\mathbf v_i)_{i=1}^N = \text{eigen}(A), where λ1>λ2>⋯>λN\lambda_1>\lambda_2>\dots>\lambda_N.
  • v1\mathbf v_1 is the dominant eigenvector.
  • If the eigenvalue of AA is zero: no stretching, no rotation — every transform by AA merges to the zero vector, and the original data can no longer be recovered (information is lost).


Figure 9: Eigen-decomposition projection onto a unitary eigenspace

Instructor's annotation


Eigenvector described as the direction you get by rotating its normal vector— i.e. the axis the transformation effectively rotates around.

Worked Example: Eigen-decompose [0−ii0]\begin{bmatrix}0&-i\\i&0\end{bmatrix} #NotOnTheExam

Step 1 — solve det⁡(A−λI)=0\det(A-\lambda I)=0:
det⁡[−λ−ii−λ]=(−λ)(−λ)−i(−i)=λ2−1=0\det\begin{bmatrix}-\lambda & -i\\ i & -\lambda\end{bmatrix} = (-\lambda)(-\lambda) - i(-i) = \lambda^2 - 1 = 0

Using the quadratic formula λ=−b±b2−4ac2a\lambda = \dfrac{-b\pm\sqrt{b^2-4ac}}{2a}, the eigenvalues are λ1=+1, λ2=−1\boxed{\lambda_1=+1,\ \lambda_2=-1}

Step 2a — substitute λ1=+1\lambda_1=+1, solve (A−λ1I)v=0(A-\lambda_1 I)\mathbf v=0:
[−1−i∣0i−1∣0]→r2:=ir1+r2[−1−i∣000∣0]\begin{bmatrix}-1&-i&|&0\\i&-1&|&0\end{bmatrix} \xrightarrow{r_2:=ir_1+r_2} \begin{bmatrix}-1&-i&|&0\\0&0&|&0\end{bmatrix}
Gives v1+iv2=0⇒v2=−iv1v_1+iv_2=0 \Rightarrow v_2=-iv_1, so v=[1 −i]⊤c1\mathbf v=[1\ -i]^\top c_1. Normalizing with c1=1/2c_1=1/\sqrt2:
v1=12[1−i]\mathbf v_1 = \frac{1}{\sqrt2}\begin{bmatrix}1\\-i\end{bmatrix}
Step 2b — substitute λ2=−1\lambda_2=-1, solve (A−λ2I)v=0(A-\lambda_2 I)\mathbf v=0:
[1−i∣0i1∣0]→r2:=r2−ir1[1−i∣000∣0]\begin{bmatrix}1&-i&|&0\\i&1&|&0\end{bmatrix} \xrightarrow{r_2:=r_2-ir_1} \begin{bmatrix}1&-i&|&0\\0&0&|&0\end{bmatrix}
Gives v1−iv2=0⇒v2=iv1v_1-iv_2=0 \Rightarrow v_2=iv_1, so v=[1 i]⊤c1\mathbf v=[1\ i]^\top c_1. Normalizing:
v2=12[1i]\mathbf v_2 = \frac{1}{\sqrt2}\begin{bmatrix}1\\i\end{bmatrix}

Exam questions will not be about matrix computation at all!

Analogy


Eigenvectors are the "grain of the wood" for a transformation — directions along which the matrix only stretches/rotates the vector rather than distorting it into a totally different shape.

Factorization of Unitary Matrix

  • A unitary matrix AA of N×NN\times N dimensions can be eigen-decomposed into at most NN eigen-pairs (λi,vi)i=1N=eigen(A)(\lambda_i,\mathbf v_i)_{i=1}^N = \text{eigen}(A).
  • Define the change-of-basis matrix (unitary): PA=[v1⋯vM]P_{\mathbf{A}} = \begin{bmatrix} \mathbf{v}_1 & \cdots & \mathbf{v}_M \end{bmatrix}
    • ทุก vector vv ข้างในเป็น perpendicular ต่อกันหมด
  • Define the diagonal eigenvalue matrix: ΛA=[λ10⋱0λM]\Lambda_{\mathbf{A}} = \begin{bmatrix} \lambda_1 & & 0 \\ & \ddots & \\ 0 & & \lambda_M \end{bmatrix}
  • Factorization:
\mathbf{A} &= P_{\mathbf{A}} \times \Lambda_{\mathbf{A}} \times (P_{\mathbf{A}})^{-1} \\ &= P_{\mathbf{A}} \times \Lambda_{\mathbf{A}} \times (P_{\mathbf{A}})^* \end{aligned}$$ - **Advantage:** any operation on $A$ distributes to each diagonal element of $\Lambda_A$ instead:

\begin{aligned}
\mathbf{A}^n &= P_{\mathbf{A}} \times \Lambda_{\mathbf{A}}^n \times (P_{\mathbf{A}})^* \
\mathbf{A}^{-1} &= (P_{\mathbf{A}})^* \times \Lambda_{\mathbf{A}}^{-1} \times P_{\mathbf{A}} \
\exp(\mathbf{A}) &= P_{\mathbf{A}} \times \exp(\Lambda_{\mathbf{A}}) \times (P_{\mathbf{A}})^* \
\operatorname{cis}(\theta \mathbf{A}) &= P_{\mathbf{A}} \times \operatorname{cis}(\theta \Lambda_{\mathbf{A}}) \times (P_{\mathbf{A}})^*
\end{aligned}

> [!note] Instructor's annotation > Etymology note: **"basis"** comes from the Latin for "base" or "axis." #### Exercise 1.8: Matrix Factorization Factorize the following matrices. (If an eigenvalue is zero, you don't need its eigenvector.) 1. $\begin{bmatrix}0&1\\1&0\end{bmatrix}$ 2. $\begin{bmatrix}0&-i\\i&0\end{bmatrix}$ 3. $\dfrac{1}{\sqrt2}\begin{bmatrix}1&1\\1&-1\end{bmatrix}$ 4. $\begin{bmatrix}1&0\\0&-1\end{bmatrix}$ 5. $\begin{bmatrix}1&0\\0&\text{cis}\frac{\pi}{4}\end{bmatrix}$ 6. $\begin{bmatrix}1&0\\0&\text{cis},\theta\end{bmatrix}$ for any $\theta$ 7. $\begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&1&0\end{bmatrix}$ 8. $\begin{bmatrix}1&0&0&0\\0&0&1&0\\0&1&0&0\\0&0&0&1\end{bmatrix}$ --- ## 4. Matrix Exponentials > [!info] Related > - [[Lecture 2 - Quantum Logic Gates#3. Universal Rotation|3. Universal Rotation — CSS482 L2]] ### Matrix Exponentials >สามารถหา cis ของ Matrix ได้ด้วยเหมือนกัน??? ข้างล่างเป็น proof - For a phase $\theta$ and **unitary** matrix $A$: $$\boxed{\text{cis}(\theta A) = I\cos\theta + iA\sin\theta}$$ **Proof:** 1. Start from the definition: $\text{cis}(\theta A) = \exp(i\theta A)$ 2. Expand via Taylor series of the exponential: $$\exp(i\theta A) = \sum_{n=0}^\infty \frac{(i\theta A)^n}{n!} = \sum_{n=0}^\infty \frac{(i\theta A)^{2n}}{(2n)!} + \sum_{n=0}^\infty \frac{(i\theta A)^{2n+1}}{(2n+1)!}$$ $$= \sum_{n=0}^\infty \frac{(-1)^n(\theta A)^{2n}}{(2n)!} + i\sum_{n=0}^\infty \frac{(-1)^n(\theta A)^{2n+1}}{(2n+1)!}$$ 3. Because $A$ is unitary, $A^{2n}=I$: $$\exp(i\theta A) = I\sum_{n=0}^\infty \frac{(-1)^n\theta^{2n}}{(2n)!} + iA\sum_{n=0}^\infty \frac{(-1)^n\theta^{2n+1}}{(2n+1)!}$$ 4. By the Taylor series of cosine and sine: $$\boxed{\text{cis}(\theta A) = I\cos\theta + iA\sin\theta}$$ > [!example] Analogy > This is Euler's formula, upgraded from a single number's phase to a whole matrix's "phase" — instead of rotating one point on the complex plane, you're rotating an entire basis at once. ### Matrix Exponentials as Basis Rotation - For phase $\theta$ and unitary $A$ of $M\times M$ dimensions, combining the previous result with the factorization $\mathbf{A} = P_{\mathbf{A}} \times \Lambda_{\mathbf{A}} \times (P_{\mathbf{A}})^*$: $$\begin{aligned} \operatorname{cis}(\theta \mathbf{A}) &= P_{\mathbf{A}} \times \operatorname{cis}(\theta \Lambda_{\mathbf{A}}) \times (P_{\mathbf{A}})^* \\ &= P_{\mathbf{A}} \times \begin{bmatrix} \operatorname{cis}(\lambda_1 \theta) & & 0 \\ & \ddots & \\ 0 & & \operatorname{cis}(\lambda_M \theta) \end{bmatrix} \times (P_{\mathbf{A}})^* \end{aligned}$$ - **Interpretation:** $\text{cis}(\theta A)$ rotates each basis of the eigenspace $P_{\mathbf{A}}$ by phase $\theta$. #### Exercise 1.9: Matrix Exponentials Compute $\text{cis}\left(\frac{\pi}{4}A\right)$ for the following matrices via $\text{cis}(\theta A)=I\cos\theta+iA\sin\theta$: 1. $\begin{bmatrix}1&0\\1&0\end{bmatrix}$ _(check against source — may be $\begin{bmatrix}0&1\\1&0\end{bmatrix}$)_ 2. $\begin{bmatrix}i-1&0\\i&0\end{bmatrix}$ _(entries unclear in scan)_ 3. $\dfrac{1}{\sqrt2}\begin{bmatrix}1&1\\1&-1\end{bmatrix}$ 4. $\begin{bmatrix}0&1\\0&-1\end{bmatrix}$ 5. $\begin{bmatrix}0&1\\0&\text{cis}\frac{\pi}{4}\end{bmatrix}$ Answer: 6. Show that $A^{2n}=I$ for any unitary matrix $A$ and any positive integer $n>0$. _(Hint: $A$ is Hermitian and orthonormal.)_ 7. Show that $\text{cis}(-\theta A) = I\cos\theta - iA\sin\theta$ for any unitary matrix $A$. --- ## 5. Measurement and Reflection > [!info] Related > - [[Lecture 4 - Computation, Measurement, and Dynamic Circuits#3. Measurement|3. Measurement — CSS482 L4]] >Physics part บ้าง >Why we have to talk about measurement? - in quantum computer we store information in terms of particle spinning >ถ้าอยากอ่าน spinning of particle ล่ะ ทำไงวะ? You shine a laser beam onto that particle → particle start to radiate, it maybe blue or red.. blah blah >The reading of radiation is called **Projection!** ### Measurement - **Projection**: the shadow of a vector $\mathbf v$ on a non-zero basis vector $\mathbf u$: $$\boxed{\text{proj}_{\mathbf u}(\mathbf v) = \frac{\mathbf v\vee\mathbf u}{\mathbf u\vee\mathbf u}\mathbf u}$$ — physically, measuring the amplitude of a wave multiplex onto the basis. - **Rejection**: the part of $\mathbf v$ orthogonal to $\mathbf u$: >The remading axis from projection is called Rejection! >Rejection means the part orthogonal to the shadow $$\boxed{\text{rej}_{\mathbf u}(\mathbf v) = \mathbf v - \text{proj}_{\mathbf u}(\mathbf v)}$$ — physically, decomposing a wave multiplex away from the basis. ![[Screenshot 2026-09-17 at 4.18.30 PM.png|center|400]] _Figure 10: Beam splitting of a wave multiplex (projection onto multiple detectors, rejection from each)_ ![[Screenshot 2026-09-17 at 4.20.45 PM.png|center|200]] > [!note] Instructor's annotation > Projection is like **"casting a shadow"** onto the basis vector. Note it needs to be an **orthonormal projector with normalization** — i.e., you divide by $\mathbf u\vee\mathbf u$ so it still works even if $\mathbf u$ isn't already a unit vector. > [!example] Analogy > Projection is shining a flashlight straight down onto a wall and measuring the shadow's length along one direction; rejection is whatever's left over — the part of the object the shadow didn't capture. #### Exercise 10.1: Measurement Compute the projections $\text{proj}_{\mathbf u}(\mathbf v)$ and rejections $\text{rej}_{\mathbf u}(\mathbf v)$ of the following $(\mathbf u,\mathbf v)$: 1. $\mathbf u=\begin{bmatrix}1\\0\end{bmatrix}$, $\mathbf v=\begin{bmatrix}1\\1\end{bmatrix}$ 2. $\mathbf u=\begin{bmatrix}1\\1\end{bmatrix}$, $\mathbf v=\begin{bmatrix}1\\0\end{bmatrix}$ 3. $\mathbf u=\begin{bmatrix}i\\-i\end{bmatrix}$, $\mathbf v=\begin{bmatrix}1+i\\2+3i\end{bmatrix}$ 4. $\mathbf u=\begin{bmatrix}\text{cis}\frac{\pi}{3}\\text{cis}\frac{\pi}{4}\end{bmatrix}$, $\mathbf v=\begin{bmatrix}\text{cis}(-\frac{\pi}{3})\\text{cis}\frac{\pi}{4}\end{bmatrix}$ 5. $\mathbf u=\begin{bmatrix}i\\-i\end{bmatrix}$, $\mathbf v=\begin{bmatrix}\text{cis}\frac{\pi}{3}\\text{cis}\frac{\pi}{4}\end{bmatrix}$ Answer: 6. Show that if $\mathbf u,\mathbf v$ are non-zero vectors, then $\text{proj}_{\mathbf u}(\mathbf v)\ne\text{proj}_{\mathbf v}(\mathbf u)$ in general. 7. Let $U=[\mathbf u_1|\dots|\mathbf u_N]$ be a unitary matrix, and $\mathbf v$ a complex vector. Show that $\text{proj}_{\mathbf u_i}(\mathbf v)$ and $\text{proj}_{\mathbf u_j}(\mathbf v)$ are orthogonal to each other for all $i\ne j$. ### Reflection >Reflection is the key component for Grover’s Algorithm (Grover search, improve the speed information retrival) - **Reflection**: vector $\mathbf v$ is flipped across the basis vector $\mathbf u$: $$\boxed{\text{refl}_{\mathbf u}(\mathbf v) = 2\text{proj}_{\mathbf u}(\mathbf v) - \mathbf v}$$ — intuition: you rotate for _twice_ the angle to get across the basis vector. - **Householder reflection matrix**: a reflection operator for basis vector $\mathbf u$ (works for any $\mathbf u$, not just unit vectors): $$\begin{aligned} \operatorname{HR}(\mathbf{u}) &= \mathbf{I} - 2 \frac{\mathbf{u} \wedge \mathbf{u}}{\mathbf{u} \vee \mathbf{u}} \\ &= \mathbf{I} - \frac{2 \mathbf{u} \mathbf{u}^*}{\mathbf{u}^* \mathbf{u}} \end{aligned}$$ - **Advantages:** - Can be used for setting a boundary that a vector "bounces off." - Combined with direction flipping, can amplify desired features and reduce noise. ![[Screenshot 2026-09-17 at 4.24.48 PM.png|center|400]] _Figure 11: Reflection of $\mathbf v$ across basis vector $\mathbf u$_ > [!note] Instructor's annotation > $\text{refl}_{\mathbf u}(\mathbf v) = 2,\text{proj}_{\mathbf u}(\mathbf v) - \mathbf v$, and — because $HR(\mathbf u)$ only depends on the fixed basis $\mathbf u$ — **"we can prepare a mirror in advance"**: the Householder matrix can be precomputed once and reused for many different $\mathbf v$ > [!example] Analogy > Think of $HR(\mathbf u)$ as building the mirror itself ahead of time — once it's built, you can flip as many vectors ("light rays") off it as you like without re-deriving anything. #### Exercise 11.1: Reflection Compute the reflection of $\mathbf v$ on basis vector $\mathbf u$: 1. $\mathbf u=\begin{bmatrix}1\\0\end{bmatrix}$, $\mathbf v=\begin{bmatrix}1\\1\end{bmatrix}$ 2. $\mathbf u=\begin{bmatrix}1\\1\end{bmatrix}$, $\mathbf v=\begin{bmatrix}1\\0\end{bmatrix}$ 3. $\mathbf u=\begin{bmatrix}i\\-i\end{bmatrix}$, $\mathbf v=\begin{bmatrix}1+i\\2+3i\end{bmatrix}$ 4. $\mathbf u=\begin{bmatrix}\text{cis}\frac{\pi}{3}\\text{cis}\frac{\pi}{4}\end{bmatrix}$, $\mathbf v=\begin{bmatrix}\text{cis}(-\frac{\pi}{3})\\text{cis}\frac{\pi}{4}\end{bmatrix}$ 5. $\mathbf u=\begin{bmatrix}i\\-i\end{bmatrix}$, $\mathbf v=\begin{bmatrix}\text{cis}\frac{\pi}{3}\\text{cis}\frac{\pi}{4}\end{bmatrix}$ Answer: 6. Compute the Householder reflection matrix $H_R$ for each basis vector $\mathbf u$ in Ex. 1–5. Then compute $H_R(\mathbf u)\times\mathbf v$ and compare with $\text{refl}_{\mathbf u}(\mathbf v)$. 7. Show that for any complex vector $\mathbf u$: $H_R(\mathbf u)\times\mathbf u=-\mathbf u$. 8. Show that for all complex vectors $\mathbf u,\mathbf v$: $H_R(\mathbf u)\times\mathbf v = \mathbf v - 2,\text{proj}_{\mathbf u}(\mathbf v)$. _(Hint: $\mathbf u^*\mathbf v=(\mathbf v^\top\mathbf u^*)^\top$, and $(\mathbf u^*)^\top=\bar{\mathbf u}$.)* --- ## Conclusion - Complex number as a wave - Complex vector as a wave multiplex - Complex matrix as transformation via stretching and rotation - Inner product and outer product - Eigen-decomposition of a square matrix - Matrix exponentials as eigen-space rotation - Measurement and reflection