Tutorial: Project evaluation criteria

This week focus is the criteria which will be used to evaluate your project work.  Part of the evaluation will be based on the software project itself; the rest will be based on the presentation.  I’ll deal with each of these parts separately.  The assignment for next week is to write a preliminary version of the on-line documentation file for your project, as described in more detail below.  Check this into the SVN repository by Friday, Feb. 1.

Before I get to that, here are some organizational details:

  • at tomorrow’s meeting we’ll discuss the contents of this post, with reference to a couple of example applications which I will demo.  I hope to have the pleasure of seeing at least one member of each team tomorrow morning.
  • I will also pass around a sign-up sheet for another round of appointments on Monday and Tuesday of next week (January 28-29) to discuss the progress of your projects individually.
  • Finally, if you intend to present your work in February, please notify me in writing, so that we can get serious about setting up dates for these talks.

Criteria for the software.  Here there should be no big surprises, as the criteria used to evaluate the software have all been introduced during the assignments which you have turned in during the semester.  Here’s the key points.  Pay special attention to the last two, as they are perhaps a bit new, although hopefully not surprising.

  1. The project itself should be a subclass of util.Assignment.
  2. On-line documentation. The project should include a html file as in our assignments (via the method getDocumentationFile()) which includes these three sections, listed below.  Note the I expect you to check in to SVN a preliminary version of this documentation by Friday, Feb. 1!
    1. The mathematical content of your project.  This should first of all “zoom in” to the specific domain of mathematics you are handling. For example, don’t just begin by saying, “We provide an application to identify the symmetry group of a wallpaper pattern”; rather begin by briefly reviewing the theory of symmetry groups on in the euclidean plane, and discuss how the classification of wallpaper groups can be mathematically described.  You should conclude this section with a single sentence describing your application as clearly and precisely as you can.
    2. Following this mathematical introduction, your documentation should then turn to the software implementation. How did you map the mathematical content onto the software platform you used?  Briefly describe the “flow chart” of the application, describing how you have implemented the mathematical content described in the previous section.  Mention any Java classes you have written, and any external packages or classes which play important roles in your implementation.  Indicate areas where you are satisfied with the results you obtain, and also those where you would work further if you were to continue on this project.
    3. User interface.  A description of the user interface of the program, preferably with screen shots showing the GUI (graphical user interface).
  3. User interface. How easy is your application to use?  Have you designed the user interface so that the user can experience the mathematical content in as simple and direct a way as possible? Have you taken advantage of the packages we have used so far in the tutorial (jReality, discretegroup, etc.)?  For example, have you used the appearance capabilities in jReality to help communicate the content of your application (colors, rendering attributes, etc.)?  Are the GUI components clearly labeled and neatly laid out? Does the documentation match the reality?
  4. Saving/restoring state.  One aspect of a successful user experience is the abillity to continue working after restarting the application.  That means, critical parameters should be saved (restored) when the application ends (starts up).  Use the methods  storeStates(Controller c) and restoreStates(Controller c) for this purpose.  I have extended gunn.Assignment2 to use these methods to store/restore its state; consult it to see how to do this for your own application.  These properties are saved off into a special file called the properties file for the application.  To be safe, you should specify a unique properties file for your project.  To see how to do this, look into the display() method of Assignment2, specifically, the JRViewer method setPropertiesFile().  Note that you do not need to specify a path for the properties file  if it is located in the same folder as the Java class of your application.
  5. Commented code.  Your Java code will not be put under a microscope and evaluated. At this stage, it’s more important that it works than how it works.  On the other hand,  I expect a minimal level of documentation in the source files:  Each method in your Java code should have a comment preceding it which describes what it does.

Criteria for Presentation. The talks are limited to 30 minutes.    It should follow the structure described above for the on-line documentation file.  There will be 15 minutes for discussion and questions. The best preparation is to understand and be able to talk about the mathematical content, the programming decisions you made, and how you would proceed if you were to continue with the project further.

Tutorial: Writing jReality tools

Please note the following points from the Tutorial meeting yesterday (Jan. 10):

  • Your project software should be based on a Java class which is a sub-class of util.Assignment.  Please name this class Project{TeamIdentifier}.java.  For example, if I were a singleton team, I’d name my project ProjectGunn.java.  This is a change from the convention we adopted for assignments; I’ve decided it’s worth having unique names when I’m busy testing out the results and don’t want to get confused by a run history featuring 10 applications all named Project.
  • There are at least two teams which prefer to present their results at the end of the semester (meaning either the last week of classes or the week after the last week of classes). If you would like to also present your project in February please contact me to let me know.  All the other teams are then expected to be ready to present their projects during the first week of the summer semester (the week beginning April 8).  This is a hard deadline. Please plan accordingly.
  • A sign-up sheet for appointments for team meetings next Monday and Tuesday was passed around.  If your team wasn’t represented on Thursday at the tutorial, please contact me to arrange a meeting.
  • The rest of the period I discussed the jReality tool system.  Although I promised that there will be no more assignments (your project is THE assignment), I’ve gone ahead and written gunn.Assignment7 for your edification.  It is not an assignment in the traditional sense, since you are not expected to write your own version.  However, I expect you to study it and become familiar with how the tool contained in it works, since most projects involve an interactive aspect which will require that you write your own tools.  The rest of this post describes this application and the jReality tool system.

The problem statement

Up til now, we have concentrated on creating scenes for jReality, learning in the process how to use the class SceneGraphComponent to build a scene graph, Appearance to control how it is rendered, a variety of geometry factories for generating content, and a variety of utility classes for performing common tasks.  We’ve also practiced using some external packages relevant to our mathematical theme:  the discretegroup package for working with symmetry groups, and an animation package for designing and saving animated sequences.

One major area which we haven’t worked with in detail is the jReality tool system.  This s a sub-system which allows the user to interact with the running application using input devices.  This is not the place for an exhaustive treatment. Read this Wiki entry for an introduction to the tool system.

Very short description of the tool system: In order to provide a layer of abstraction between the actual hardware input devices and the tool system (in order to allow the same application to run in different environments such as a desktop and the PORTAL), the tool system is based on the notion of an input slot, which represents some kind of input device.  Slots generate input events; tools inserted into the scene graph are notified of these events depending on the positions of a) the tool in the scene graph and b) the source of the event (also typically in the scene graph).

The basic interactive tool will have some activation slots which cause the methods activate() and deactivate() to be called; while it is active, events arising from its current slots will cause its perform() method to be called.  The tool is provided with an instance of ToolContext, which contains information describing exactly where the scene graph has been picked by the user.  The most important part of the ToolContext are methods which provide the current pick results (getCurrentPick() and getCurrentPicks()), along with methods providing SceneGraphPath’s specifying where the active tool is located, and where the picked geometry is located (getRootToTool() and getRootToLocal()).

Assignment7 embodies a simple curve editor.  The user interacts with the curve via a single tool inserted into the same scene graph component containing the curve.  This virtually guarantees that it will only receive tool events involving this curve, but not for example the square background geometry). There is a single InputSlot, the left button input slot.  When the user presses the left button, the tool is activated, and when he releases it, the tool is deactivated.  If the cursor is over the curve, the activate() method does the following:

  1. If an edge has been picked, (this can be found out by the method PickResult.getPickType()) then the tool inserts a new vertex into the curve at the picked point of the edge, and turns off picking of edges for this geometry.
  2. If a vertex has been picked, the perform() method is called.

The perform() method only takes action when a vertex has been picked.  Since edge picking has been disabled, this should always be the case. It then edits the list of vertices of the curve to move the picked vertex to a new position given by the pick point (note that this is different from the coordinates of the picked vertex, since the coordinates of the pick point correspond to the point on the tiny sphere which is drawn to represent the underlying vertex.  If you want to access the actual coordinates of the picked vertex, you  can use the getIndex() method of the PickResult class to obtain the index in the vertex list of the IndexedLineSet to obtain this information.  The code contains numerous examples of how such methods can be used so I refrain from further “explaining”.

Don’t neglect to update jReality before testing out Assignment7: a small extension had to be made to the PickResult class in order to be able to locate exactly the picked segment along the curve (the method getSecondaryIndex()).

lecture notes: 11.12.12

Let $x,y,z\in\mathbb{R}$ vertices and the “wrap” $g\in\mathrm{G}$ an edge. Then wie have the vertices head and tail and the edges prev and next.
Bild01

component(e)
mark(e);
e' := e;
while(e'≠ e) do
e' := next(e');
if (e' == e) return true;
mark(e');
endwhile
e':=e;
while (e' ≠ NULL) do
e' := prev(e');
if(e'==e) return false;
mark(e');
endwhile

findcomponents()
num_circles :=0;
num_ints :=0;
unmark all edges;
for each edge e do
if (marked(e)) continue;
if (component(e))
then num_circles ++;
else num_ints++;
endif

Data Structure for surfaces

There are winged edges, half edges and quad edges. An oriented edge has the vertices head and tail and the faces left and right.
Bild02
head-next(e) = – r-next(e)
head-prev(e) = – l-next(e)
tail-next(e) = – l-prev(e)
tail-prev(e) = – r-prev(e)

There is a duality: vertex $\leftrightarrow$ face, edge $\leftrightarrow$ edge ($\bot$) and face $\leftrightarrow$ vertex.
Quad edge represents both together, vertex and face are the same data structure (e.g. coordinates of vertex area of dual face). A “quad edge<2 has pointers to four vertices/faces and pointers to four other quad edges.
Store quad edge once. A reference to a quad edge is a pointer to this data structure together with two bits $±e$, $±e^+$. We need enumerators for each edge, vertex and face. and some pointers back from a vertex/face to an incident edge.

mark all edges, faces, vertices
for each edge e do
if unmarked(e)
then find_component(left(e));
end for

find_component(f)
recursively mark all neighbors (breath-first or order-first, pruning when we see a marked face);
As we go, count faces, edges, vertices;

If we pass a marked face again with oposite direction, set a “nonorientability” flag.

Need to count components: $\chi = \mathrm{V}-\mathrm{E}+\mathrm{F}$.
With some modifications quad edges, etc. also work for multigraphs in a surface.

Similarly, for any 2-complex in $\mathbb{R}^3$ or for a 3-manifold given as a 3-complex we can use facet edge data structure.
A facet edge $f_e$ represents one edge of one face in the complex.

next_edge($f_e$), next_facet($f_e$), prev_edge($f_e$), prev_edge($f_e$)

The facet edge has four pointers to $f_e$’s, 2 pointer to vertices (head, tail) and 2 pointers to cells (above, below).
Especially when the complex forms a closed 3-manifold, we can implement duality as quad edge.

lecture notes: 10.12.12

Topic: polygons, polyhedra, cell complexes and data structure for these.

$n$-manifolds looks locally like $\mathbb{E}$. Further a $n$-manifold with boundary has points with neighboorhoods like a halfspace $\{x\in \mathbb{E}^n | x_n\geq 0\}$. Compact manifolds (with boundary) are the ones that can be represented in the computer, say by a finite triangulation.

Definition: A closed $n$-manifold is a compact manifold without boundary.

Each component of a $0$-manifold is a point. The manifold is compact iff it is finite. A connected $1$-manifold is $\bigcirc\cong\mathbb{S}^1, \:\mid\:\cong [0,1],\:\updownarrow \:\cong\mathbb{R}\cong(0,1)$ or $\uparrow \:\cong\mathbb{R}_{\geq 0} \cong [0,1)$. Thus, a compact $1$-manifold has finitely many components, each is $\mathbb{S}$ or $\mathrm{I}$.
Recall: each component of a compact $2$-manifold is $\sum_{g,k}$ if orientable or $\mathrm{N}_{h,k}$ if not.
Represent a compact $1$-manifold by gluing edges together: Start with n edges and some identifications of the end points (an equivalence relation on the set of $2n$ end points). In general this gluing gives a multigraph with $n$ edges and less than $2n$ vertices. The size of each equivalence class is the degree of the resulting vertex. A finite multigraph can be realized this way iff there is no vertex of degree $0$.

Lemma: A multigraph is a $1$-manifold iff every vertex has degree $1$ or $2$.

Definition: The body is exactly the set of all vertices of degree $1$.

For $2$-dimensional manifolds (and cell complexes) we start with a finite collections of polygons and a rule for gluing edges. Equivalently, we can require that all the polygons are triangles.

Definition: An oriented $n$-gon is topologically an oriented closed disk with n marked boundary-points $a_i$ in cyclic order.

The gluing rule is an equivalence relation on the set of all oriented edges with the porperty that $e\sim f \Leftrightarrow -e \sim -f$. The equivalence classes are the oriented edges of the resulting $2$-complex.
The degree or valence of the resulting edfe is the cardinality of the equivalence class. The resulting compact space is a $2$-manifold iff all edges has valence $1$ or $2$ and edges of valence $1$ form the boundary. We get a manifold if we start with pairing of the oriented edges. The manifold is closed (no boundary) if all edges get paired.

The $2$-complex we get is always purely $2$-dimensional (no edges of valence $0$, no isolated vertices). Not every purely $2$-dimensional complex can be obtained by our construction. We’ve given a “top-down” $\:$construction of complexes. Start with to-dimensional cells gluing their face.
The other construction of cell complexes is “bottom up”.$\:$Start with a finite set of vertices. Then sew in a finite collection of edges (to head and tail vertices). Finally sew in $n$-gons by attaching boundary to a cycle of $n$ oriented edges.
With this second construction edge valence is $0$ or $2$ is necessary but not sufficient to get a manifold with boundary. We need to test that the link of each vertex is connected. Assuming the valence conditions, the link of each vertex is a $1$-manifold – we just need to check if it is $\mathrm{I}$ or $\mathbb{S}^1$.
Usually we have geometric information about how a complex is sitting in some ambient space. E.g. each vertex has coordinates. Usually edges are straight lines in the ambient space.
We may need to mark edges to say which “way around”$\:$ in the ambient space they go. If the ambient space is $\mathbb{R}^3/\:\mathrm{G}$ for some crystallographic group $\mathrm{G}$, then we often represent vertices as points $v\in\mathbb{R}^3$. An edge from $v$ to $w$ is marked with $g\in\mathrm{G}$ to show that it is the straight line $v$, $g\cdot w$ is one of the preimages.
Sometimes multiple edges are usefull even if the start in the same position.

Tutorial: End of year remarks

Today’s tutorial meeting was the last of the year.  Befitting this memorable occasion, we celebrated with punch and cake after taking care of the business at hand:

Christmas decorations via the 3D printer.  This meeting had been advertised in advance as an opportunity to play around with making a 3D print.  Since Christmas is around the corner, and we have been studying point symmetry groups, I had suggested as theme making a decoration using the framework of Assignment 6.

In preparing for the tutorial I checked in a new class, util.ThickenSurfaceDemo.  This class takes a surface and thickens it and optionally perforates it (puts a hole in the middle of each thickened polygon).  In order to work with discrete groups, I had to also add a menu item to the jReality export menu, to output a single IndexedFaceSet representing the tessellated geometry.  I managed to to do this also, but the results were not satisfactory.  The thicken step uses the vertex normal direction to thicken the surface and something was wrong the in the geometry which was being written out.  I’ve now found and corrected that bug.  So, if you have created an interesting spherical tessellation which you’d like to print on the 3D printer, here’s what you need to do:

  1. In the program in which you generate the tessellation (for example, Assignment6) save the scene with the File->Export->OBJ menu option.
  2. Start up the program util.ThickenSurfaceDemoLoad the file you created in the previous step using the menu item File->Examples->Load…
  3. Play with the parameters provided until you are satisfied.  Then to save the result for printing in the 3D Lab, use the menu item File->Export->VRML.  In the dialog box, choose the vrml2 option, and uncheck on the other check boxes.  Also save a screen-shot of the result (File->Export->Screenshot) and send it to me as an e-mail.

Note: Due to network problems with my laptop, the changes I have made won’t be checked into the SVN for a few hours (It’s now Thursday 2 pm).

Project presentation planning.  We also discussed the scheduling for giving project presentations at the end of the semester.  Different possibilities were discussed: either directly after the end of the winter semester (in the last week of the semester or the week immediately following), or before the beginning of the spring semester.  This begins on April 7.  I will not be available before April 7.  So this would involve making presentations in the first week of summer semester.  Please consider which of these alternatives you prefer and be prepared to discuss them in our first meeting after we return from the Christmas holidays.

Tutorial: Choosing a project

Please remember that your team should submit a short description of your planned project to me via email by Tuesday 11.12.12. This description should clearly state not only the content of the project, but also what form the project will take.  It is expected that every team will produce either an interactive application or animations in digital format.  These products should include documentation for the intended user/audience. In no particular order, here are some ideas for semester projects.

  1. Dynamical systems on orbifolds.  This is a big field, with many possible specific projects. Idea is to take some dynamical system defined on $\mathbb{R}^2$ (or $\mathbb{R}^3$ or $\mathbf{S}^2$ or $\mathbf{H}^2$ or …) and figure out how to map it onto some or any orbifold that belongs to this covering space.  Example: vector fields , differential equations, difference equations, cellular automata (as in Assignment1).  (To see how to integrate ODE’s in Java, see the example util.ODEExample.)
  2. Complex functions.   There are doubly-periodic complex functions, aka elliptic functions.   These can be considered functions on the torus.  Interpret them for example as vector fields, calculate the integral curves.
  3. Geometry processing on orbifolds.  For example, develop software to work with triangulations of an orbifold.  How to insert new points, how to perform geometric processing on the resulting triangulations.  Calculate subdivision surfaces in 2D- and 3D-orbifolds.  Develop tools to study embeddings of graphs on tori and higher-genus surfaces.
  4. Software improvement. Improve or extend an existing application such as TriangleGroup, Wallpaper, Maniview.  For example:
    1. Provide a geometric representation for 3D isometries so that one can provide a picture of the generators of the discrete group. This has been begun in the euclidean case (in maniview) but not completed.
    2. Better painting tool. The painting tool in the wallpaper application could be better. It would be nice for example to fair the input path of the mouse — this means approximate the path with a Bezier curve, as the user draws.  This will provide a more uniform, smoother curve, which is also easier to store off and later edit.  (Of course the user can choose whether he wants to fair or not.)
  5. Software applications. Here are some ideas for self-contained applications.
    1. 3D Kaleidoscope. Implement a general 3D Kaleidoscope in the sides of an appropriate 3D tetrahedron (one with dihedral angles which are fractions of 2Pi).  Equip this kaleidoscope with a set of built-in “worlds”, each of which generates its own regular 3D tessellation.  For example, with the same *236 kaleidoscope it’s possible to generate tessellations consisting of regular hexagons, regular triangles, or a combination of both.  Figure out how to design these worlds so that you can see through them to perceive the complete tessellation. This idea is the analogy in 3D to the TriangleGroup webstart in 2D.
    2. Designing large public sculptures with spherical symmetry.  Here the model is George Hart’s construction projects based on a single tile, typically working with the symmetry group 235.  The project here would consist of an application to allow the user to design a single tile (piece of cardboard or plywood) which is so designed that it can be easily attached to other copies either via gluing tabs or thin slots.  Given a suggest shape, the application should allow the user to move, scale and rotate it into place; and additionally provide some support for editing it in a 2D editor and updating the complete 3D sculpture in a separate window.
    3. Brick patterns. Develop a module for the wallpaper application (above) devoted to symmetry patterns based on bricks (rectangles with 2:1 aspect ratio).  See the book by Peter Stephens, Regular Patterns, (in the math library “Semesterapparat”) for examples of such patterns.  This brings one to the topic of tilings, which we haven’t explicitly studied.  There may be several distinct tilings which all have the same symmetry group.  See the web page of Craig Kaplan for more on tilings.
    4. Color symmetry.  Using the book The Symmetry of Things (see below) as a guide, write an application to explore color symmetry in wallpaper groups.
  6. Implement some of the missing 3D Euclidean crystallographic groups, for example, debug the 35 irreducible ones, or begin to work on the fibered ones.  References here: original paper by Thurston, Conway, Huson, and Delgado and these slides from a talk by Huson.
  7. Content. It’s also conceivable to author content rather than software or mathematics.  That is, choose a theme and develop material to communicate this theme to others.  Here the focus is not on innovation in mathematics or software, but communication.  Think “movie” — without expecting the production of a finished movie (that’s too much work). Examples of possible themes:
    1. An interesting set of animated tessellations would fall into this category
    2.  a gallery of classical patterns from various cultures (see the book by Stephens references in 5)).
    3. The 59 stellations of the icosahedron.
    4. “The 120 Cell”
  8. For more ideas about symmetry-related project themes, see the following resources:
    1. Craig Kaplan’s web site
    2. George Hart’s web site.
    3. Vi Hart’s YouTube videos, for example this one.
    4. The book The Symmetry of Things by John Conway  (in Semesterapparat).
    5. The book Regular Patterns by Peter Stevens (in Semesterapparat).

New for 2013

  1. Tools for visualizing projective geometry.  There have been surprisingly few attempts to develop tools for visualizing projective geometry in dimensions 2 and 3.  The mathematical foundation is clear and rich, the jReality system provides excellent support for the homogeneous coordinates and projective transformations.  What remains to do is develop some ideas for how one can specify and render geometry and projectivities in a clear, intuitive fashion. For example, “the line segment AB” is not well-defined, one must distinguish somehow between the two possibilities.
    1. One simple test case for the 2D case is the “guided visualization” we have been practicing in class in which 4 triangular regions change their appearance as one of the intersections points passes through the ideal line.
    2. Another direction for work would  be to explore how far one can go in using projective transformations to represent deformations of euclidean objects — that is, take Assignment1 extra credit option and “run with it”.
    3. Another related application: one that allows the user to specify a 3D projective transformation by picking 5 points, and then applying it to a grid of cubes (or some other regular euclidean pattern) to obtain a linear deformation of this pattern.

Lecture notes: 03.12.12 Bezier curves

I introduced Bezier curves and surfaces yesterday with a quick and non-technical treatment focusing on the recursive definition of the Bezier curve of order $k$ as a weighted sum of two Bezier curves of order $k-1$; the recursion is rooted in the definition that order-1 Bezier curves are line segments linearly interpolated between a pair of control points:

\[ \beta(P_0, P_1; t) := (1-t)P_1 + tP_2 \]

The definition of order-2 (quadratic) Bezier curve is then

\[\beta(P_0, P_1, P_2; t) := (1-t)\beta(P_0,P_1,t) + t\beta(P_1, P_2, t) \]

In general, one arrives at a polynomial expression in terms of the control points $P_i$ which is given for the order-n case by:

\[ \sum_{k=0}^n B_k^n(t) P_k \]

where $B_k^n(t)$ is the Bernstein polynomial defined by $B_k^n(t) := \binom{n}{k}(1-t)^kt^{n-k}$. Using this form it is not difficult to prove many attractive properties of the Bezier curves, such as: the tangent direction at $P_0$ is in the direction of $P_1$, etc.

To help you visualize the recursive definition of Bezier curves, I’ve created a demo in the SVN repository for our class. Update and run the main() method in util.BezierDemo. You’ll need to invoke the animation panel and set two key frames (by clicking on Save then Insert buttons), then hit the play button.  You’ll probably want to adjust the playback speed also.  Here’s a movie showing the result:

Rational Bezier curves.  If one uses homogeneous coordinates for the points of space, then one can generate a wider variety of curves using the same algorithm.  Remember, the final step of drawing the curve is to dehomogenize, that is, divide by the homogeneous coordinate, which in our case is the $w$-coordinate. Such a curve is then a rational rather than a polynomial curve.

Representation of circles. In particular, it is possible to parametrize arcs of circles using rational Bezier curves of degree 2.  This takes advantage of the fact that the circle an be represented rationally as the homogeneous curve $(1-t^2, 2t,1+t^2)$.  For $t\in [0,1]$, this parametrizes the first quadrant of the unit circle.  It turns out that the Bezier curve with control points

\[ P0 := (1,0,1),~~~ P1 := \dfrac{\sqrt{2}}{2}(1,1,1), ~~~P2 := (0,1,1) \]

provides essentially the same parametrization of this circular arc.

Bezier surfaces.  There are two approaches to generalizing the above approach to generate surfaces.  In the first, one begins with a triangle instead of a line segment, and two parameters $u$ and $v$ instead of $t$.  Then the order-1 interpolation of the triangle is defined as

\[\beta(P_0,P_1,P_2; u,v) := (1-u-v)P_0+uP_1+vP_2\]

The other approach creates surfaces as the tensor product of two curves.  In this case, one requires for an order-n surface a total of $(n+1)^2$ control points.  One considers these points arranged in a square array.  Then to create the surface, consider each row of the array as the control points for an order-$n$ Bezier curve.  Use the $u$ parameter to obtain a point on each of these curves.  Then, consider these $n+1$ points as the control points of a Bezier curve, and apply the $v$ parameter to obtain a point on it.  This is the value of the surface at the parameter value $(u,v)$.  It’s not hard to show that one obtains the same result if one begins with the $v$ parameter and then applies the $u$.

Lecture notes 26.11.12

It is well known that $\mathbb{C} \cong \mathbb{R}^2$ with
\[
z = x + y i \leftrightarrow (x,y) \leftrightarrow \begin{pmatrix}
x & – y
\\
y & x
\end{pmatrix}
=
\begin{pmatrix}
x & – y
\\
\overline{y} & \overline{x}
\end{pmatrix}
\]
Note that the multiplication rule in $\mathbb{C}$ comes from the matrix multiplication in $\mathbb{R}^{2 \times 2}$ with
\[
(x + y i)(x’ + y’ i) = (xx’ – yy’) + (xy’ + yx’)i
\]
for some $x,y,x’,y’ \in \mathbb{R}$. Of course other known operations for $x,y \in \mathbb{R}, z := x + yi$ are:
\begin{gather*}
\overline{z} = \overline{x + yi} = x – yi
\\
|z|^2 = z \overline{z} = x^2 + y^2 \in \mathbb{R}^{\ge 0}
\\
z^{-1} = \frac{\overline{z}}{|z|^2}
\\
\overline{z} = z \Leftrightarrow |z| = 1 \Leftrightarrow z \in \mathbb{S} \Leftrightarrow \begin{pmatrix}
x & – y
\\
y & x
\end{pmatrix} \in \text{SO}_2 = \{\text{special orthogonal}\}
\end{gather*}
Now consider a pair of complex numbers which will be called quaternion. Denote $\mathbb{H}$ as the set of all quaternions (named after Hamilton). Then $\mathbb{H} \cong \mathbb{C}^2 \cong \mathbb{R}^4$ with
\[
q = z + w i \leftrightarrow (z,w) \leftrightarrow
\begin{pmatrix}
z & – w
\\
\overline{w} & \overline{z}
\end{pmatrix}
\]
Accordingly we get the following rules for $z,w, z’, w’ \in \mathbb{C}, q := z + wj$:
\begin{gather*}
(z + w j)(z’ + w’ j) = (zz’ – w \overline{w’}) + (zw’ + w \overline{z’})j
\\
\overline{q} = \overline{z + wj} = \overline{z} – wj
\\
|q|^2 = q \overline{q} = |z|^2 + |w|^2 \in \mathbb{R}^{\ge 0}
\\
q^{-1} = \frac{\overline{q}}{|q|^2}
\\
\overline{q} = q \Leftrightarrow |q| = 1 \Leftrightarrow q \in \mathbb{S} \Leftrightarrow \begin{pmatrix}
z & – w
\\
\overline{w} & \overline{z}
\end{pmatrix} \in \text{SU} \cong \text{SU}_2
\end{gather*}

May think of it in a constructive way:

  • Start with $\mathbb{R}$ (we have $(x \mapsto \overline{x}) = \text{id}$, $\cdot$ is commutative and associative)
  • Double to get $\mathbb{C}$ (we lose  $(x \mapsto \overline{x}) = \text{id}$)
  • Double to get $\mathbb{H}$ (we lose commutativity of multiplication)
  • Double to get the octonions $\mathbb{O}$ with $\mathbb{O} \cong \mathbb{H}^2$ (we lose the associativity, too)

As a basis for $\mathbb{H}$ over $\mathbb{R}$ we can choose $\{1 , i, j, k\}$ with $k := ij$. We get
\begin{gather*}
i^2 = j^2 = k^2 = ijk = -1
\\
ij = -ji = k
\\
jk = -kj = i
\\
ki = -ik = j
\end{gather*}
The set $\{ \pm 1, \pm i, \pm j, \pm k\}$ forms a group $Q_8$, called the quaternion group of order 8.
Then we can write $q \in \mathbb{H}$ as
\[
q = t + xi + yj + zk = t + p \text{ for some } t,x,y,z \in \mathbb{R}
\]
where $p = xi + yj + zk$ is a pure (imaginary) quaternion. We denote $\text{Im}(q) := p \in \mathbb{R}^3, \text{Re}(q) := t \in \mathbb{R}$.

Identify the pure quaternions $\text{Im} \mathbb{H} := \text{span}\{ i,j,k\}$ with $\mathbb{R}$ via
\[
q \longleftrightarrow
\begin{pmatrix}
t & x & y & z
\\
-x & t & -z & y
\\
-y  & z & t & -x
\\
-z & -y & x & t
\end{pmatrix}
\]
The following rules holds $t,x,y,z,t’ \in \mathbb{R},p,p’ \in \text{Im} \mathbb{H}$ with $p = xi + yj + zk$ and $q := t + p, q’ := t’ + p’$:
\begin{gather*}
\overline{q} = \overline{t + p} = t – p
\\
q \overline{q} = t^2 + x^2 + y^2 + z^2 = t^2 + |p|^2
\\
\overline{p} = -p
\\
( \overline{q} = q \Leftrightarrow t = 0 \Leftrightarrow q \in \text{Im} \mathbb{H} )
\\
q q’ = (t+p)(t’+p’) = (tt’ – p \cdot p’) + ( tp’ + t’p + p \times p’)
\end{gather*}
where $p \cdot p’$ is the common scalar product and $p \times p’$ the vector product on $\mathbb{R}^3$. In particular
\[
p p’ = – \underbrace{p \cdot p’}_{\in \mathbb{R}} + \underbrace{p \times p’}_{\in \mathbb{R}^3}, \quad – p \cdot p’ = \text{Re}(pp’), p \times p’ = \text{Im}(p p’)
\]
Any 2-dim subspace in $\mathbb{H}$ including 1 behaves like $\mathbb{C}$ (closed under the commutative multiplication). That is, given any unit pure quaternion $u \in \mathbb{S}^2 = \mathbb{R}^3 \cap \mathbb{S}^3$ the set $\{1,u\}$ spans such a 2-plane
\begin{gather*}
(x+ yu)(x’+y’u) = (xx’ – yy’) + (xy’ + yx’) u
\\
u^2 = -1
\end{gather*}
A non-real quaternion $q$ commutes only with elements of $\text{span}\{1,u\}$. $\mathbb{R} \subset \mathbb{H}$ is called the center of $\mathbb{H}$ (because the reals commute with everything). Analog to the complex setting we have $e^{\theta i} = \cos \theta + \sin \theta i$ and define
\[
e^{\theta u} := \cos \theta + \sin \theta u \quad \forall u \in \mathbb{S}^2, \theta \in \mathbb{R}
\]
For $q = t + p = t + \theta u$ we get
\[
e^q = e^t(e^{\theta u}) = e^t \cos \theta + (e^t \sin \theta)u
\]
and $e^{\theta u} \in \mathbb{S}^3$ (unit quaternions).

Claim: Any unit quaternion can be written as $e^{\theta u}$ for some $\theta \in [0, \pi], u \in \mathbb{S}^2$ (unit pure).

Indeed $\cos \theta = \text{Re}(q) \in [-1,1]$ determines $\theta \in [0,\pi]$ uniquely. Then $u = \frac{\text{Im}(q)}{|\text{Im}(q)|} = \frac{\text{Im}(q)}{\sin \theta}$ determines $u$. (Except for $\theta \in \{0,\pi\}$ since $1 = e^{0u}, -1 = e^{\pi u} \forall u \in \mathbb{S}^2$.)