Your win: translate instantly between a 2D vector \((x,y)\) and the complex number \(x+iy\).
10 minutesNeeds: coordinatesOutcome: pair ↔ complex number
Mission link: the RoFormer paper first derives RoPE in 2D using complex multiplication. The notation is compact, but the geometry is the same plane from Lesson 1.
Give the vertical axis a name
The imaginary unit \(i\) is defined by \(i^2=-1\). A complex number has the form:
\[z=x+iy\]
Plot \(x\) on the horizontal real axis and \(y\) on the vertical imaginary axis. The number \(3+2i\) and the vector \((3,2)\) identify the same point.
Coordinates
\((3,2)\)
Right 3, up 2.
Column vector
\(\begin{bmatrix}3\\2\end{bmatrix}\)
Two ordered components.
Complex number
\(3+2i\)
Real 3, imaginary 2.
Magnitude does not change its meaning
\[|z|=\sqrt{x^2+y^2}=\lVert\mathbf v\rVert\]
The vertical bar around a complex number and the double bars around a vector both mean distance from the origin here.
Conjugation reflects
The complex conjugate changes the sign of the imaginary part:
\[z=x+iy\quad\longrightarrow\quad z^*=x-iy\]
Geometrically, this reflects the point across the horizontal axis. Soon, that reflection will help us understand why a transpose reverses a rotation.
Worked translation
For the RoPE pair \((q_4,q_5)=(-2,3)\):
Complex form: \(z_2=-2+3i\).
Magnitude: \(|z_2|=\sqrt{4+9}=\sqrt{13}\).
Conjugate: \(z_2^*=-2-3i\).
Retrieval check
Which vector is the complex number \(4-3i\)?
Practice before moving on
Convert \((-3,5)\) to complex form.
Convert \(7-2i\) to a column vector.
Calculate \(|3+4i|\).
Find the conjugate of \(-2+6i\), and describe its geometric effect.
For the RoPE pair \((q_6,q_7)=(1,-4)\), write the complex number, conjugate, and magnitude.
Check solutions
\(-3+5i\).
\(\begin{bmatrix}7\\-2\end{bmatrix}\).
\(\sqrt{3^2+4^2}=5\).
\(-2-6i\); reflection across the real axis.
\(1-4i\), \(1+4i\), and \(\sqrt{17}\).
Do not mystify \(i\): in this course, complex notation is a convenient package for two real coordinates plus special multiplication rules.