In 1853, the mathematician and physicist William Rowan Hamilton paid one last call on Catherine Barlow, whom he had once loved passionately and for whom he still had some affection. She had won his heart three decades earlier when he was a first-year student at Trinity College, Dublin and she was Miss Catherine Disney – before her parents had decided that Reverend William Barlow, a man of means fifteen years her senior, would be a good match for her. Events proved them wrong.^{1}

If, thirty years later, Reverend Barlow resented Hamilton’s presence in his home, he probably forgave the trespass, since his wife was dying and had asked for one last visit from Hamilton. Hamilton, a published poet as well as scientist, had written of her fondly in some of his early verse, but what he bestowed upon her now was not poetry but a mathematical treatise that he had written upon a topic of his own invention, quaternionic analysis, which had won so much acclaim that it was a mandatory examination topic in Dublin. Indeed, a year earlier Catherine’s son had needed some instruction in quaternions and Hamilton had tutored the young man, perhaps enjoying the opportunity to play a paternal role to the son of his old flame.

Catherine spoke of how her marriage to Barlow had been thrust upon her by her parents, and Hamilton was outraged on her behalf. She told him of her unfulfilling marriage, and of her unwavering love for Hamilton throughout the years, and he was devastated. And then, near the end of the interview, he tried what he should have tried thirty years earlier. “Rising, I received, or took, as my reward, all that she could lawfully give – a kiss, nay many kisses: – for the known and near approach of death made such communion holy. It could not be, indeed, without agitation on both sides, that for the first time in our lives, our lips then met. . . . Yet dare I to affirm that our affectionate transport, in those few permitted moments, was pure as that of those who in the resurrection neither marry nor are given in marriage, but are as the Angels of God in Heaven.”

Catherine lingered for two weeks after William’s visit before dying at age 53. Meanwhile, William had gone back to his home and his wife and to what he saw as his duty and his destiny: the task of explaining quaternions to the world. He knew he still hadn’t succeeded in making quaternions as understandable to others as they were to him. He would keep trying for the rest of his life.

**THE ENTHUSIAST**

Young William Rowan Hamilton had many interests and the knack of mastering whatever interested him. The boy learned Latin and Greek and Hebrew by age five. He showed no interest in numbers until he was eight, when he met the calculating prodigy Zerah Colburn on tour. William quickly taught himself the art of mental calculation and competed against the young American, and while he couldn’t best Colburn, by all accounts his performance did him credit.

Hamilton also loved classics, and won an *optime* (the highest possible distinction) during his first year at Trinity – a feat no other first-year had accomplished in decades. A few years later, he topped his earlier achievement by winning a double *optime* in classics and science, something no Trinity student had done before. At age 17 he found a mistake in Laplace’s celebrated *Mécanique céleste*. One of his teachers at Trinity College, John Brinkley, was moved to state “This young man, I do not say will be, but is, the first mathematician of his age.” When shortly thereafter Brinkley became a bishop and relinquished his professorship, Hamilton (still an undergraduate!) was chosen as Brinkley’s replacement. One of the perks that went with the position was the title of Royal Astronomer of Ireland and the benefit of living at Dunsink Observatory on the outskirts of Dublin. The appointment did not work out well for Ireland (the new Royal Astronomer had no special talent for astronomy) but worked out quite well for Hamilton, since through his tenancy at the Observatory he would eventually meet Helen Bayly who lived nearby and whom he would eventually marry.^{2}

Before commencing his astronomical duties, William toured the British Isles and met the poet William Wordworth; despite the thirty-year difference in their ages, the two quickly became friends. Hamilton’s biographer Robert Graves reported overhearing Wordsworth describing Hamilton and the poet Coleridge as “the two most wonderful men, taking all their endowments together, that he had ever met”.

The two Williams had more common ground than one might suppose. Wordworth, no friend of applied science (“Science applied only to material uses of life waged war with and wished to extinguish imagination”), nonetheless had an appreciation of the purer forms of science, including mathematics. In *The Prelude*, book VI, Wordworth wrote:

*Yet we may not entirely overlook The pleasure gathered from the rudiments Of geometric science …*

He went on to fondly describe his first exposure to Euclid’s geometry, concluding:

*Mighty is the charm Of those abstractions … … an independent world, Created out of pure intelligence.*

Hamilton in turn had a poetic sensitivity that Wordsworth recognized and praised.^{3}

Hamilton got into the habit of sending Wordworth his poems, seeking the latter’s candid appraisal. Wordsworth could tell that Hamilton was no dabbler but also no Wordsworth. He also knew, judging from the success of Hamilton’s academic career, that the younger man had unique insights into the mathematical realm. In 1831 Wordworth wrote to Hamilton, saying:

*You send me showers of verses, which I receive with much pleasure, as do we all; yet have we fear that this employment may seduce you from the path of Science which you seem destined to tread with so much honour to yourself and profit to others. Again and again I must repeat, that the composition of verse is infinitely more of an art than men are prepared to believe, and absolute success in it depends upon innumerable minutiae which it grieves me you should stoop to acquire a knowledge of.*^{4}

**“VIEWS BEFORE ATTAINED BECOME MORE CLEAR”**

If you studied Cartesian coordinates, you probably remember that they were named after their originator René Descartes, and that they feature two lines, the *x* and *y* axes, meeting at a point called the origin. The origin is represented by the pair (0, 0), and you might have guessed that this notation goes back to Descartes, but that isn’t true. The mathematician who taught us to represent a point in the plane by two numbers separated by a comma inside parentheses was not Descartes but Hamilton.

What led Hamilton to this innovation was a desire to demystify complex numbers. Hamilton wrote: “No candid and intelligent person can doubt the truth of the chief properties of Parallel Lines, as set forth by Euclid in his Elements, two thousand years ago . . . But it requires no peculiar scepticism to doubt, or even to disbelieve, the doctrine of Negatives and Imaginaries . . . ” I won’t discuss here Hamilton’s approach to making sense of negative numbers, but he found a compelling way to ground complex numbers in something more solid, namely pairs of real numbers, or as he called them, couples.^{5}

Hamilton’s rule for adding couples was simple: the sum of the couple (*a*, *b*) and the couple (*c*, *d*) is the couple (*a*+*c*, *b*+*d*). The rule for multiplying couples was more complicated: the product of the couple (*a*, *b*) and the couple (*c*, *d*) is the couple (*ac* − *bd*, *ad* + *bc*). One might object that the second rule seemed strange, but no one could object that either rule offended reason. In particular, the assertion that (0,1) times (0,1) is (−1,0) is nothing but a straightforward application of the rule for multiplying couples.^{6}

The reason this gambit works so well is that if you look at just the couples of the form (*r*, 0) – couples in which the first coupled number is whatever you like and the second coupled number is 0 – you find that the rules for combining couples shadow the ordinary rules for combining numbers. Specifically, (*r*, 0) plus (*s*, 0) equals (*r*+*s*, 0), while (*r*, 0) times (*s*, 0) equals (*rs*, 0). So such couples, when combined using Hamilton’s rules for adding and multiplying couples, behave in the same way that “singles” (ordinary real numbers) behave when combined using the ordinary rules for adding and multiplying singles. Couples whose second number is zero, taken in aggregate, walk like ducks, swim like ducks, and quack like ducks, if by “duck” we mean “real number”. But once you admit that the couple (−1, 0) quacks like the number −1, it’s hard to avoid the further assertion that (0, 1) quacks like a square root of −1, even if you insist that, in the realm of numbers, no such square root exists.

It’s here that 19th century philosophy and 19th century mathematics part ways. For the philosopher, it would be a grave mistake, indeed a category error (one of the most embarrassing mistakes a philosopher can make), to conflate a couple like (−1, 0) with a number like −1. But modern mathematics requires something very much like this conflation, though to avoid logical pitfalls one must be careful merely to associate the two rather than to actually equate them. A whole branch of modern mathematics called category theory enables us to get away with this – to apply the “duck test” not just to complex numbers but to almost everything else we study.^{7}

Hamilton’s symbolic way of demystifying complex numbers supplemented the already widespread geometrical approach, which associated sqrt(−1) with the point in the Cartesian plane located on the *y* axis, one unit above the origin. If one combines the two forms of demystification – “complex numbers are just points in a plane” and “complex numbers are just couples of real numbers” – one arrives at “points in the plane are just couples of real numbers”. This opens the door to a demystification of four-dimensional space, for what could be more prosaic than four numbers separated by commas inside parentheses? It may have been Hilbert who, a few generations later, took the final step of arithmetizing Euclidean space (going beyond Euclid to describe *n*-dimensional Euclidean space for all positive integers *n*, not just 1, 2, and 3), but Hamilton had opened the door that Hilbert would walk through.

**THE PROBLEM**

Having devised an arithmetic of couples, Hamilton naturally wondered if there was a way to extend to triples (or, as he sometimes called them, triplets). As he would later write in the Preface of his Lectures on Quaternions (1853): “There was, however, a motive which induced me then to attach a special importance to the consideration of triplets . . . This was the desire to connect, in some new and useful (or at least interesting) way, calculation with geometry, through some undiscovered extension, to space of three dimensions.”

So, Hamilton considered triplets of the form (*a*, *b*, *c*), each to be conceived as representing a “hypercomplex” number *a* + *bi* + *cj*, where *i* is the ordinary square root of −1 and *j* is another square root of −1, different from both *i* and −*i*. It was clear to Hamilton how to define addition of triplets: just as *a*+*bi *plus *a*′+*b*′*i* equals (*a*+*a*′)+(*b*+*b*′)*i*, Hamilton saw that *a*+*bi*+*cj* plus *a*′+*b*′*i*+*c*′*j *should equal (*a*+*a*′)+(*b*+*b*′)*i*+(*c*+*c*′)*j*.

But how should multiplication be defined? This problem vexed Hamilton for years, and he didn’t hide his vexation from his family. As he later recounted in a letter to his son Archibald:

*Every morning in the early part of October 1843, on my coming down to breakfast, your brother William Edwin and yourself used to ask me: “Well, Papa, can you multiply triples?” Whereto I was always obliged to reply, with a sad shake of the head, “No, I can only add and subtract them.”*

Of course, Hamilton could have defined multiplication of triples in countless ways, for instance via the formula *a* + *bi* + *cj* times *a*′ + *b*′*i* + *c*′*j* equals (*aa*′) + (*bb*′)*i* + (*cc*′)*j*, just as he could have defined multiplication of couples via the formula *a* + *bi* times *a*′ + *b*′*i* equals (*aa*′) + (*bb*′)*i*. But the latter definition wouldn’t have given anything very interesting (in particular, it wouldn’t have given a way of thinking about complex numbers), so the former definition wasn’t the sort of thing he wanted. But how could he say what he wanted to discover when he hadn’t discovered it yet?

Well, he knew that he wanted something *like* the multiplication rule for complex numbers. So what sorts of properties did his couples-multiplication rule have that he might wish a triples-multiplication rule to satisfy as well?

He singled out two properties. The first property was the distributive law, which asserts that (*a* + *bi*) (*c* + *di*) can be expanded out as (*a*)(*c*) + (*a*)(*di*) + (*bi*)(*c*) + (*bi*)(*di*), or as *ac* + *adi* + *bci* + *bdii* (yes, *ii* = −1, but that’s not part of the distributive law). The second property was the law of moduli, which asserts that, if we write (*a* + *bi*) (*c* + *di*) as *x* + *yi*, the modulus of *x* + *yi* (that is, the length of the segment joining (*x*, *y*) to (0, 0)) should be the product of the modulus of *a* + *bi* and the modulus of *c* + *di*. (This is the “magnitudes multiply” rule that I wrote about in Twisty Numbers for a Screwy Universe.) In other words, sqrt(*x*^{2} + *y*^{2}) should equal sqrt(*a*^{2} + *b*^{2}) times sqrt(*c*^{2} + *d*^{2}), or (getting rid of those pesky square roots) *x*^{2} + *y*^{2} should equal (*a*^{2} + *b*^{2})(*c*^{2} + *d*^{2}).

So, holding tight to the reins of analogy, Hamilton sought a way to write the product (*a*+*bi*+*cj*) (*d*+*ei*+*fj*) as (…) + (…)*i* + (…)*j* (let’s call those unknown parenthesized expressions *x*, *y*, and *z*) in such a way that *x* + *yi* + *zj* would equal the expanded sum *ad* + *aei* + *afj* + *bdi* + *beii* + *bfij* + *cdj* + *ceji *+ *cfjj *(a new distributive law) and at the same time the sum *x*^{2} + *y*^{2} + *z*^{2} would factor as (*a*^{2} + *b*^{2} +* c*^{2}) times (*d*^{2} + *e*^{2} + *f*^{2}) (a new law of moduli).^{8}

Given the assumed truth of the new distributive property, “all” Hamilton needed to do was figure out what *ii*, *jj*, *ij*, and *ji* were (or rather should be) and he would be able to multiply any triple by any other triple, though if he made bad choices, the resulting operation on triples wouldn’t satisfy his desired law of moduli. He already knew he wanted *ii* and *jj* to equal −1, so it was just a matter of figuring out what to do with *ij* and *ji*. Originally he set both equal to 0, but that led to problems. Indeed, the equation *ij* = 0 contradicts the law of moduli, since *i* and *j* each have modulus 1 while 0 has modulus 0.

Hamilton decided to relax the assumption that *ij* = *ji* = 0, but to retain the assumption that *ij* and *ji* were negatives of each other. That is, he assumed that for some intelligent choice of *p*, *q*, and *r* he’d have *ij* = *p*+*qi*+*rj* while *ji* = −*p*−*qi*−*rj*. He gave the name *k* to the unknown product of *i *and *j*, and found that using *ij* = *k* and *ji* = −*k* gave rise to some promising-looking cancellations in the modulus of the product of two general triples. Indeed, he found that these two formulas led to four other formulas of a similar kind: *jk* = *i*, *kj* = −*i*, *ki* = *j*, and *ik* = −*j*. But he couldn’t find numbers *p*, *q*, and *r* that would make the whole setup work.

**THE SOLUTION**

The conceptual impasse was resolved on October 16th, 1843 as Hamilton and his wife were walking along the towpath of the Royal Canal. It suddenly occurred to him that his *k* was not an unknown to be solved for; it was an independent imaginary unit, an equal partner with *i* and *j*. That is, he had been wrong all along to seek to multiply triples; he should instead have thought about multiplying quadruples of the form *a* + *bi* + *cj* + *dk*. The rules *ii* = −1, *ij* = *k*, *ik* = −*j*, *ji* = −*k*, *jj* = −1, *jk* = *i*, *ki* = *j*, *kj* = −*i*, and* kk* = −1 (in combination with the distributive law) gave a procedure for calculating the product of any two quadruples, and, as he intuited along the canal and verified later, this definition of quadruplet-multiplication satisfied the law of moduli. In his excitement, Hamilton memorialized the breakthrough by carving the core of his discovery into a stone bridge along the canal:

Hamilton’s carving on the Broome Bridge has long been erased, but the story stands as a monument to the sometimes comical enthusiasm of mathematicians. Perhaps it should also stand as a monument to the patience of mathematicians’ spouses; I imagine Lady Hamilton thinking “Why can’t he just write these things on napkins like everyone else?” but keeping the thought to herself.

The day after his discovery, Hamilton wrote to his college friend and fellow mathematician John Graves, who like his brothers Robert Graves (Hamilton’s eventual biographer) and Charles Graves were fascinated by notions of spatial algebra, and whose work had in some respects inspired Hamilton’s own. Hamilton wrote: “… And here there dawned on me the notion that we must admit, in some sense, a *fourth dimension* of space for the purpose of calculating with triples. …We must admit a *third* imaginary symbol *k*, not to be confused with either *i* or* j*, but equal to the product of the first as multiplier, the second as multiplicand; and therefore I was led to introduce quaternions^{9} such as *a*+*bi*+*cj*+*dk*, or (*a*,*b*,*c*,*d*).” Hamilton was the first, but far from the last, mathematician to run across the fascinating phenomenon of “special dimensions” in which certain coincidences make peculiar things happen.^{10}

Graves was quick to see the importance of what Hamilton had done, and quicker than Hamilton in seeing how it might lead to even higher dimensions. In his response, Graves wrote “If with your alchemy you can make three pounds of gold, why should you stop there?” (where the “three” were presumably Hamilton’s *i*, *j*, and *k*). Two months later, Graves wrote to Hamilton presenting a number system of his own which he called “octaves”, encompassing Hamilton’s but with four new imaginary units *l*, *m*, *n*, and *o* thrown in. Octaves were discovered independently by mathematician Arthur Cayley (some people call them Cayley numbers) and are usually called octonions nowadays. It’s also worth mentioning that octonion multiplication fails to satisfy the associative property: that is, if *o*, *p*, and *q* are octonions, then the product (*op*)*q* and the product *o*(*pq*) are usually not equal. In this we see an example of what I call the trade-off principle: an increase in scope of a mathematical system usually entails sacrificing something on the altar of generality.

We’ve seen the trade-off principle before. Consider: When we moved from the real numbers to the complex numbers, we lost the law of trichotomy (given two real numbers *r* and *s*, exactly one of the relations *r* < *s*, *r* = *s*, *r* > *s* holds) and indeed it’s unclear what it should mean to say that one complex number is less or greater than another. The complex numbers satisfy the commutative law (given two complex numbers *α* and *β*, *αβ* = *βα*), but when we move from the complex numbers to the quaternions, we lose the commutative property. It therefore shouldn’t surprise us that we lose the associative property when we move from the quaternions to the octonions. As we progress to more encompassing number systems, there is enlargement but there is also dilution. (There are systems beyond the octonions, notably the sedenions, that sacrifice even more properties such as the law of moduli, but I have nothing to say about them.) So, my answer to Graves’ rhetorical question “Why stop there?” is the fact of life that greedy people in fairy tales learn the hard way: wishes come true but they don’t come free.

In 1844, Hamilton followed through on his hope of using to quaternions to connect calculation with geometry and physics. He viewed the quaternion* a*+*bi*+*cj*+*dk* as the sum of two parts: the *scalar* part *a* and the *vector* part *bi*+*cj*+*dk*, which could be written as the triple (*b*, *c*, *d*). He pointed out that his vectors provided a natural language for Newton’s ideas about addition of velocities and forces. More significantly, Hamilton showed that if one wrote each quaternion as the sum of a scalar and a vector (*a*+*v*, say, where *v* = *bi*+*cj* +*dk*), then the product of the two quaternions *a*+*v* and *a*′ +*v*′ could be expanded as a sum of various expressions of independent interest: the scalar *aa*′; the scalar − *bb*′ − *cc*′ − *dd*′; the vectors *ab*′*i* + *ac*′*j* + *ad*′*k* and *a*′*bi* + *a*′*cj* + *a*′*dk*; and the vector (*cd*′ − *c*′*d*)*i* + (*b*′*d* − *bd*′)*j* + (*bc*′ − *b*′*c*)*k*. So in fact he ended up finding three important new ways to multiply triples (the expressions *ab*′*i* + *ac*′*j* + *ad*′*k* and *a*′*bi* + *a*′*cj* + *a*′*dk* are formed in similar ways so they count as a single method of multiplying). The first multiplies a vector times a vector to yield a scalar; the second multiplies a scalar times a vector to yield a vector; and the third multiplies a vector times a vector to yield a vector. The third of these was in some ways close to what Hamilton had originally sought, “a new and useful (or at least interesting) way” to multiply triples, and it satisfied the distributive law, but it did not satisfy the law of moduli so he hadn’t considered it until it arose as a byproduct of quaternionic multiplication. (It’s also not associative.)^{11}

Hamilton also figured out how to relate quaternions to rotations in three-dimensional space. This was a natural thing to try to figure out, since complex numbers are intimately related to rotations in two-dimensional space. The complex number *w* = cos *θ* + *i* sin *θ* has the property that when you multiply some other complex number *z* by *w*, you rotate *z* around the origin of the complex plane by an angle *θ*. Hamilton found an analogous story for quaternions, though in keeping with the noncommutative nature of quaternions, it’s a little trickier. To operate on the three-dimensional vector *v* using the rotation vector *w*, we form *wvw*′, where *w*′ is cos *θ* − *i* sin *θ* (the reciprocal of *w*). The vector *wvw*′ is the vector *v *rotated around the *i*-axis by an angle of 2*θ*.^{12} (That factor of 2 is important; it prefigures both the abandonment of quaternions at the start of the 20th century and their resurrection near the century’s end, as I will explain shortly.)

Hamilton’s willingness to jettison the commutative property in his definition of quaternions was certainly a bold and important step, but it didn’t come out of nowhere. Leonhard Euler had shown that when one follows one rotation of the sphere by a rotation around a second axis, the compound operation is again a rotation through some angle about a third axis, and he knew that the order in which one performs the two component rotations affects what compound operation one obtains. This is something you can easily verify for yourself with any roughly cubical object (a book will do). Place the book on the table in front of you, apply a 90-degree pitch followed by a 90-degree roll, and note the orientation of the book. Now repeat the experiment, this time performing the roll first; you’ll note that the final orientation of the book is not what it was for pitch-then-roll. The same holds if one applies pitch and yaw, or yaw and roll. Hamilton knew about Euler’s work, so he might have suspected that if his new numbers were to describe rotation in three dimensions, then the new numbers would have to partake of the noncommutativity that rotations were already known to possess.^{13}

There are fun puzzles based on the fact that rotations in three-dimensional space do not commute, and on the related fact that when you roll a cube on a table, it can come back to its original position in a different orientation than the one it began in. Robert Abbott pioneered what are called rolling cube mazes; one challenging example is https://logicmazes.com/rc/gms5.html. If you prefer rolling-object games with a video component, check out Block ’n’ Roll. Or if you want games that relate more directly to the quaternions, try the “Groupdoku” quaternion game or the Hamilternian card game.

**DEATH AND REBIRTH**

If quaternion theory had been a startup in the marketplace of ideas, its stock value would have peaked thirty years after Hamilton’s great discovery, when the physicist James Clerk Maxwell used quaternions to express his theory of electromagnetism.

Things went downhill from there. It didn’t help that Hamilton, despite (or perhaps because of) his poetic verve, wasn’t the clearest expositor of his theory; he tended to be wordy. And it certainly didn’t help that, in his final attempt to explain quaternions (completed by his son after William’s death), he adopted Euclid’s *Elements* as his model, and eschewed his early algebraic formulation of quaternions in favor of something more geometric. The blemish in his original “*i*, *j*, and *k*” approach, as Hamilton saw it, was that it required a particular choice of three perpendicular axes. Which three perpendicular axes you chose wouldn’t really matter in the end, but choose you must, or you couldn’t get the theory off the ground. Hamilton wrote circa 1848: “I regard it as an inelegance, or imperfection, in quaternions, or rather in the state to which it has been hitherto unfolded, whenever it becomes or seems to become necessary to have recourse to *x*, *y*, *z*, etc.” So he came up with a new approach, in which vectors lived in Euclid’s 3-space (with no preferred axes) and quaternions were defined as something like quotients of one vector divided by another. The approach was difficult to follow, and over time fewer and fewer people read Hamilton’s *Elements of Quaternions*. In the words of Cayley, quaternion algebra was like a pocket map “which contained everything but had to be unfolded into another form before it could be understood.”

The people who did the unfolding were the trio of Josiah Willard Gibbs, Oliver Heaviside, and Hermann von Helmholtz who tore quaternions asunder, separating their scalar and vector parts. In our tech startup analogy, you can view the three as corporate raiders. They saw that Hamilton had come up with some excellent products but he hadn’t branded them or created a good interface (that is, convenient symbolism). So, they defined the scalar product

*a* (*b*, *c*, *d*) = (*ab*, *ac*, *ad*),

the dot product

(*b*, *c*, *d*) · (*b*′, *c*′, *d*′) = *bb*′ + *cc*′ + *dd*′,

and the cross product

(*b*, *c*, *d*) × (*b*′, *c*′, *d*′) = (*cd*′ − *c*′*d*)*i* + (*b*′*d* − *bd*′)*j* + (*bc*′ − *b*′*c*)*k*,

all of which Hamilton had discovered but not named. What about the full quaternion product? “Oh, that’s four-dimensional; hard to visualize; not a good product for us. How would we ever be able to sell that to first-year students?” The trio stole the words “scalar” and “vector” from the IP of Quaternions Inc. but threw out the unprofitable quaternion itself. Heaviside’s rewrote Maxwell’s formulas for electromagnetism using the three forms of vector multiplication Hamilton had invented (upgraded into the differential operators gradient, divergence, and curl), using Gibbs’ notation and with no mention of quaternions.

One mismatch between the math of Hamilton and the needs of late 19th century physics (such as Maxwell’s work on electromagnetism) can be seen in the angle-doubling phenomenon mentioned earlier. When you operate on a quaternion vector *v* by premultiplying it by the vector cos *θ* + *i* sin *θ* and postmultiplying it by cos *θ* − *i* sin *θ*, you effectively rotate *v* around the *i*-axis by the angle 2*θ* rather than *θ*. What if *θ* is 180 degrees? Then our rotation sends *v* to (−1)(*v*)(−1), which is just *v*. That might not seem bad, but consider that (+1)(*v*)(+1) is also *v*. So we have two different quaternions, +1 and −1, that both correspond to the do-nothing rotation about the *i* axis. This redundancy isn’t peculiar to the do-nothing rotation; for every rotation you can perform on three-dimensional space that leaves the origin fixed in place, there are two unit quaternions that do the job. (Contrast this with the complex numbers, where there is a one-to-one correspondence between unit complex numbers and rotations around 0.) Quaternions, in a certain sense, were twice as complicated as they needed to be for the sorts of applications Gibbs, Heaviside, and von Helmholtz had in mind.

As a crowning indignity, the prominent physicist William Thomson (aka Lord Kelvin) voiced strong preference for the non-quaternionic style of vectors: “Quaternions came from Hamilton after his really good work had been done, and though beautifully ingenious, have been an unmixed evil to those who have touched them in any way.” The Quaternion Society (formally the International Association for Promoting the Study of Quaternions and Allied Systems of Mathematics) disbanded in 1913. By the time I learned about vectors in linear algebra courses, adding a vector to a scalar was unheard of – the mathematical equivalent of adding apples and oranges. I suspect my teachers had no idea that the inventor of vectors emphatically believed that you not only *could*, but *should*, add scalars and vectors!

In a way, the trouble with quaternions was that they arrived ahead of schedule, before they were needed. Take the doubling phenomenon I just talked about. Why should there be exactly two ways of describing each rotation? One good answer is that in robotics, there are exactly two topologically distinct ways to effect any given rotation by means of rigid linkages! This is related to the fact (known as the Balinese plate trick) that if you hold a plate in your hand, then, without letting go of the plate or altering the way you’re holding it, but just by passing the plate first over your arm and then under it, you can rotate the plate by 720 degrees in such a way that your arm will be positioned exactly as it was before, even though the plate has made two full turns. By repeating the motion you can achieve rotation by any even number of full turns. However, there is no way to use your arm to rotate the plate by just one full turn, or by any odd number of full turns, in such a way that your arm will be positioned exactly as it was before. The quaternion +1 corresponds to a robotic mechanism that rotates the plate through an even number of turns, while the quaternion −1 corresponds to a robotic mechanism that rotates the plate through an odd number of turns. Mathematician Alexander Holroyd designed a linkage that achieves this effect and implemented it in the LEGO Technic construction set; see his video “Spinor Linkage” (below). If you’re inclined to build one on your own see his instructions or the accompanying article. See also the Wikipedia article Anti-twister mechanism for more on how to avoid putting twists in cables.

In addition to their uses in robotics, quaternions are used nowadays in gaming software. The 1996 release “Tomb Raider” may have been the first mass-market video game to achieve smooth three-dimensional rotation effects through the use of quaternions; see the Gameludere article Euler Angles, Hamilton’s Quaternions and video games for more information. Quaternions have also played a role in space travel beginning with the attitude control mechanisms of the Space Shuttle in 1986. Even if the young Royal Astronomer of Ireland made no contribution to 19th century astronomy, Hamilton had an impact on 20th century astronautics!

Even before robotics and computer games exitsed, there was quantum theory, and in particular there was the notion of fermions: particles whose quantum wave-function satisfies Fermi-Dirac statistics so that giving the particle a full turn corresponds to multiplying the wave-function by −1. (Never met a fermion? Yes you have, if you’ve touched a doorknob in winter and gotten a shock; electrons are fermions.) The mathematical description of fermions was expressed in terms of what are now called Pauli matrices, but quaternions would have done just as good a job. Considering that Hamilton once described his 1843 flash of insight as akin to an electrical spark, it’s fitting that quaternions can be used to formulate the quantum theory of the electron.

I’ll end with Hamilton’s own rendition of his great discovery in the form of a sonnet entitled Tetractys.^{14}

*Or high Mathésis, with its “charm severe Of line and number,” was our theme; and we Sought to behold its unborn progeny, And thrones reserved in Truth’s celestial sphere; While views before attained became more clear; And how the One of Time, the Space of Three, Might in the Chain of Symbol girdled be: And when my eager and reverted ear Caught some faint echoes of an ancient strain, Some shadowy outline of old thoughts sublime, Gently He smiled to mark revive again, In later age, and occidental clime, A dimly traced Pythagorean lore; A westward floating, mystic dream of FOUR.*

*Thanks to John Baez, Alexander Holroyd, and Anne van Weerden.*

**ENDNOTES**

#1. To be fair to Catherine’s parents, one should note that Hamilton had never told Catherine of the more-than-brotherly nature of his affection, let alone informed her parents of any sort of serious intention on his part.

#2. Although it’s tempting to cast William and Catherine as tragic figures of a doomed romance, and although Catherine’s story is undeniably tragic, William was able to move on in his life, and his marriage to Helen was a happy one.

#3. In 1832, delivering a lecture on astronomy, Hamilton would declare: “With all the real differences between Poetry and Science, there exists, notwithstanding, a strong resemblance between them; in the power which both possess to lift the mind above the dull stir of earth, and win it from low-thoughted care; in the enthusiasm which both can inspire, and the fond aspirations after fame which both have a tendency to enkindle; in the magic by which each can transport her votaries into a world of her own creating; and perhaps, in the consequent unfitness for the bustle and the turmoil of real life, which both have a disposition to engender.”

#4. After one detailed discussion of such minutiae, Wordsworth wrote “I can say, without scruple, that the verses are highly spirited, and interesting and poetical. The change of character they describe is an object of instructive contemplation, and the whole executed with feeling.” Still, the overall message was clear: You are a good poet but a world-class mathematician, so focus your energies on the latter!

#5. Today we call such couples ordered pairs, where the modifier “ordered” is included to emphasize that (2,3) and (3,2) are to be construed as different pairs. This proviso is necessary to ensure that 2 + 3*i* and 3 + 2*i* will be construed as different complex numbers.

#6. Recall that Hamilton’s first exposure to mathematics was through the art of mental calculation. I speculate that this particular kind of initiation – focussed on how one operates on numbers rather than on what numbers actually mean – predisposed him toward the operational approach to mathematical entities that was so crucial to his treatment of complex numbers as well as his later invention of quaternions.

#7. This is part of what Henri Poincaré meant when he wrote “Mathematics is the art of giving the same name to different things.” The ordered pair (−1, 0) (a resident of Hamilton’s contrived arithmetic of couples) and the number −1 (a resident of the real number system) are different entities, but they have identical properties in terms of how they interact with the other entities they reside with, so for some purposes we are entitled to treat them as the same.

#8. You might think that, since we’re in three dimensions now rather than two, those exponents should be 3’s, not 2’s. This is a common guess students make when learning how to extend the Pythagorean Theorem into three dimensions. But those 2’s really are correct; the distance from (*x*, *y*, *z*) to (0, 0, 0) is the square root of *x*^{2} + *y*^{2} + *z*^{2}, not the cube root of *x*^{3} + *y*^{3} + *z*^{3} . One way to see that the latter formula can’t be right is to consider the case when *z* = 0. If the cube-root-of-the-sum-of-cubes formula were correct, the distance between (*x*, *y*, 0) and (0, 0, 0) would have to be the cube root of *x*^{3} + *y*^{3}. But since (0,0,0) and (*x*,*y*,0) both lie in the *z* = 0 plane, we can apply the ordinary two-dimensional distance formula, deducing that the distance between (*x*,*y*,0) and (0,0,0) is the square root of *x*^{2} + *y*^{2}, not the cube root of *x*^{3} + *y*^{3}.

#9. Later on he would regret that he had not called them grammarithms, from the Greek roots *gram*– (line) and *arithm*– (number), so that what we call the scalar and vector parts of a quaternion would instead be called the arithmetic and grammic parts of a grammarithm, but by then it was too late to change the terminology.

#10. In 1898, mathematician Adolph Hurwitz showed that Hamilton’s failure to figure out how to multiply triples wasn’t due to a lack of insight; the problem Hamilton had set for himself can only be solved in dimensions 1, 2, 4, and 8. A more recent manifestation of the phenomenon comes from the mathematics behind string theory, which only works for certain “magic” dimensions. Here’s John Baez’ homey analogy for Hurwitz’s theorem: “There are exactly four normed division algebras: the real numbers, complex numbers, quaternions, and octonions. The real numbers are the dependable breadwinner of the family, the complete ordered field we all rely on. The complex numbers are a slightly flashier but still respectable younger brother: not ordered, but algebraically complete. The quaternions, being noncommutative, are the eccentric cousin who is shunned at important family gatherings. But the octonions are the crazy old uncle nobody lets out of the attic: they are *nonassociative*.”

#11. Hamilton, influenced by Kant, originally tried to relate his mathematical ideas to a view of algebra as the science of pure time, which made him believe that algebra should be limited to the study of operations that satisfy the associative law. When he encountered non-associative operations like multiplication of octaves and his way of multiplying vectors by vectors, it made him reassess his earlier stance, and he came into greater sympathy with the views of Peacock and de Morgan who saw algebra as the free play of uninterpreted symbols.

#12. One illustrative example is *w* = *i*, *w*′ = −*i*. We compute

(*w*)(*i*)(*w*′) = −*iii* = *i*,

(*w*)(−*i*)(*w*‘) = +*iii* = −*i*,

(*w*)(*j*)(*w*′) = −*iji* = −*j*,

(*w*)(−*j*)(*w*′) = +*iji* = *j*,

(*w*)(*k*)(*w*′) = −*iki* = −*k*, and

(*w*)(−*k*)(*w*′) = +*iki* = *k*.

The vectors *i* and −*i* stay fixed in place while *j* and −*j *get swapped and *k* and −*k* get swapped, as we expect when we rotate by 180 degrees about the *i*-axis.

#13. Another path that might have led Hamilton to infer that he needed his multiplication to be non-commutative (though not the path he actually followed) was to consider the product (*i* − *j*)(*i* + *j*). Since it is a product of two nonzero quaternions, the law of moduli implies that it has to be nonzero. However, by the distributive law, it expands to *ii* + *ij* − *ji* − *jj*. Since *ii* = *jj* = −1, the first and fourth terms cancel, giving *ij* − *ji*. So the inequality (*i* − *j*)(*i* + *j*) ≠ 0 directly implies the inequality *ij* − *ji* ≠ 0, which is just another way of saying *ij* ≠ *ji*.

#14. In Pythagorean mysticism, the tetractys was a triangle made of ten dots, with four dots on each side, symbolizing the number four by way of the sum 1 + 2 + 3 + 4. Relating quaternions to this mystic emblem was a bit of a stretch. But speaking of the tetractys, here’s a little math-history conspiracy theory for you. Have you heard of one Hippasus who got murdered by the Pythagorean Brotherhood? The story went that they did it in retribution for Hippasus proving (or was it for publicizing?) the irrationality of the square root of 2. But that was just a cover story. His true crime, which the Brotherhood kept under wraps for two thousand years, was inventing the sacrilegious sport that today is known as bowling.

**REFERENCES**

Eleanor Fitzsimons, ‘A Rhymer and an Analyst’: The friendship of William Wordsworth and William Rowan Hamilton

William Rowan Hamilton, Lectures on Quaternions (Dublin, 1853)

William Rowan Hamilton, Elements of Quaternions (Dublin, 1866)

William Rowan Hamilton, The One of Time, of Space the Three: The Collected Poems of Sir William Rowan Hamilton

Kathy Jones, Quaternions are Amazing and so is William Rowan Hamilton!

Alexander Macfarlane, Sir William Rowan Hamilton, chapter 3 in Lectures on Ten British Mathematicians of the Nineteenth Century

MacTutor, William Rowan Hamilton

Colm Mulcahy, Anne van Weerden, and Michel Destrade, How a 19th century Irish mathematician helped NASA into space

Jose Pujol, Hamilton, Rodrigues, Gauss, Quaternions, and Rotations: A Historical Reassessment, Communications in Mathematical Analysis 13(2), January 2012

Jose Pujol, On Hamilton’s Nearly-Forgotten Early Work on the Relation between Rotations and Quaternions and on the Composition of Rotations, The American Mathematical Monthly 121(6), June 2014

Trinity College Dublin, Letters describing the Discovery of Quaternions

B. L. van der Waerden, Hamilton’s discovery of quaternions, Mathematics Magazine, Vol. 49, No. 5, November 1976

Anne van Weerden, Catherine Disney: a biographical sketch

Anne van Weerden, A Victorian Marriage: Sir William Rowan Hamilton

Wikipedia, The history of quaternions

Wikipedia, William Rowan Hamilton

Charlie Wood, The Strange Numbers That Birthed Modern Algebra, Quanta Magazine, September 6, 2018