# Production notes for the video.

Here are some sketchy production notes for the Hopf fibration video, having to do with how or why I did particular things.

## Parametrization of fibers

To actually draw Hopf fibers, we have to have a specific formula for the Hopf fibration. Following unpublished notes of Ken Shoemake, I decided to use the function \[ \eta(q) = q \cdot \mathbb{k} \cdot q^{-1} \] where \(q \in S^3\) is a unit quaternion and we use quaternion arithmetic for the multiplication. In coordinates with \[ q = (w,x,y,z) = w + x \mathbb{i} + y \mathbb{j} + z \mathbb{k} \] we have \[ \eta(q) = (0, 2wy + 2xz, 2yz - 2wx, w^2 + z^2 - x^2 - y^2). \] This confirms that the image of \(\eta\) lies in the three dimensions spanned by \(\mathbb{i}, \mathbb{j}\) and \(\mathbb{k}\). It is also easy to see that \(|\eta(q)| = 1\), and hence \(\eta(q) \in S^2\).

To parametrize the fiber over a point \((a,b,c) \in S^2\), suppose \[ \eta(q) = (0, 2wy + 2xz, 2yz - 2wx, w^2 + z^2 - x^2 - y^2) = (0,a,b,c). \] Then suppose \[ w^2 + z^2 = \frac{1+c}{2} \] and \[ x^2 + y^2 = \frac{1-c}{2}. \] Let \(\alpha = \sqrt{\frac{1+c}{2}}\) and \(\beta = \sqrt{\frac{1-c}{2}}\) and let \[ q = (w,x,y,z) = (\alpha \cos \theta, -\beta \cos \phi, -\beta \sin \phi, \alpha \sin \theta). \] Then the angle-sum formulas yield \[ a = -2 \alpha \beta \sin (\theta + \phi) \] \[ b = 2 \alpha \beta \cos (\theta + \phi). \] Thus \(\frac{-a}{\phantom{-}b} = \tan (\theta + \phi)\), and we have \[ \theta = \arctan \left(\frac{-a}{b}\right) - \phi. \] For a modified stereographic projection to the unit ball in \(\mathbb{R}^3\), let \(r = \frac{\arccos(w)}{\pi}\). Then the fiber over \((a,b,c)\) is parametrized by \[ f(\phi) = \frac{r}{\sqrt{1-w^2}} \cdot (x,y,z), \qquad \phi \in [0,2\pi]. \] This map is the inverse to the exponential map from the closed unit ball to \(S^3\).

*Update 2021-08-12:* An earlier version of this page had
permuted the formulas for \(x\), \(y\), and \(z\). They're fixed
now, thanks to some questions from Annie Heartway by email! You can also
compare with the
fiber parametrization function in the source
code.

### Coloring:

The colors for fibers and the points they project to are chosen by using the \(a\), \(b\), and \(c\) coordinates on \(S^2\) for the red, green, and blue values, respectively. They're scaled slightly, to avoid having too many light colors.

## Paths on the two-sphere

To see various features of the fibration, we used different paths on \(S^2\). In order for dots to move with uniform speed, the paths need to be parametrized by arc length. It's generally impossible to give an elementary expression for this parametrization, but it is possible to compute it numerically: The length of a parametric curve \(r(t)\) with \(t \in [0,1]\) is given by: \[ L = \int_0^1 |r'(t)| \, dt \] To generate a partition \(\{t_0, t_1, \ldots, t_n\}\) with the arc length between each \(r(t_{i})\) and \(r(t_{i+1})\) being \(L/n\), we used Sage's numerical integration to repeatedly solve the equation \[ L/n = \int_{t_i}^{t_{i+1}} |r'(t)| \, dt \] for \(t_{i+1}\), given \(t_i\).

## Music

The accompanying music comes from Mandelbrot Set by Jonathan Coulton. I like the lyrics, but they don't really fit the Hopf theme, so I took the karaoke version and filtered out the remaining vocals with Audacity. I also abridged the song, since it seemed a little too long without the vocals. I chose this particular peice of music because:

- I like Jonathan Coulton's music, and I like the attitude he has about producing music. In particular, he uses a license which grants others permission to use his music for their own projects.
- I wanted an upbeat song that wasn't too long.
- The Mandelbrot
Set is one of the earliest and most popular mathematical images.
It's an archetype for computer-generated visualization of mathematical
structure, and hence
*somewhat*related to the purpose of the Hopf fibration video.

## Source code

Want to make your own images, or an even better animation? Go ahead! Load it into your Sage session and enjoy!

Fork hopf_fibration on GitHub

The code is licensed under the GNU General Public License (version 2 or later). I'd love to see what you do with it!

tags: info