You will be able to
- Read real and imaginary parts as two coordinates.
- Explain multiplication by a unit complex number as rotation.
Two coordinates in one number
Write z=a+ib, where i²=−1. The real coordinate is a and the imaginary coordinate is b. Magnitude is √(a²+b²). Complex numbers are bookkeeping for two real coordinates, not fictitious measurements. Euler’s identity connects a unit complex number to an angle.
Rotation without stretching
Multiplying z by cos θ+i sin θ rotates its coordinates by θ without changing magnitude. This compact operation is why Fourier phases and rotary position embeddings are easy to describe with complex numbers. The vectors in the lab are real pairs; the same rotation matrix implements the complex multiplication.
Worked example
Multiplying 3+4i by i gives −4+3i: a 90° rotation. Both have magnitude 5. Four such multiplications return to the starting point.
A common trap
The imaginary part is not “error” or “noise”. It is a coordinate needed to represent phase.
Predict, then experiment
Should rotation change either vector’s norm? Should a shared rotation change their dot product? Before touching the controls, say or write your prediction.
Interactive experiment
Position as relative rotation
Does moving both positions by the same amount change the score?
Fixed content vectors q=[1,0.5], k=[0.4,1]. The plot shows their rotated coordinates on shared axes; the readout gives the dot product.
Your experiment
Set key offset to 0 and angular frequency to 0.5. Move query position through several integers. Observe both directions changing while the dot product remains fixed.
Change one parameter at a time. Compare what you observed with your prediction and record an explanation in your notes.
Check your understanding
Try from memory first. Hints and feedback are part of learning, not a penalty. These checks are for self-study, not a graded qualification.
Reference answers (after your attempt)
- angle but not magnitude — Correct: it is a pure rotation.
- 5 — √(3²+4²)=5.
Apply it: Work a rotation by hand
Use paper, your notes, or a local notebook/editor. Code examples are Python 3 starting points to run yourself; this page does not execute code or automatically assess the practical task.
- Rotate [2,1] by 90° counterclockwise.
- Calculate the squared norm before and after.
- Explain why the second coordinate is necessary.
Reference solution & review criteria
The result is [−1,2]. Squared norm is 5 in both cases. One scalar cannot generally encode both length and direction in a plane.
Your notebook
Notes and progress stay in this browser. They are not sent to the server; ordinary web-server request logs still operate. Export a backup from the course page.
Completion requires both correct checks and your practical-task acknowledgement.
Go deeper
Sources support further study; the worked examples and questions here are original. Browser experiments are small, disclosed models—not evidence of production-model quality or hardware performance.