Quaternions and spherical trigonometry
33 comments
·January 30, 2025alfiedotwtf
Hold up! Omg, can someone who’s done physics chime in please… whenever I’ve looked at GUT etc, I’ve always seen U(n), SU(n), but never knew what they were - are they what’s referred to in this article? Is that just the Unitary Group and Special Unitary Group??! All that time I thought it was all impenetrable but it’s just algebra?
Omg wow... the theoretical physics I’m talking about is just quaternions and Lie Algebra isn’t it? Oh… dont tell me Quantum Spin just called Spin because it’s a Spinor rather than something actually metaphorically spinning?!
Please chime in if you know what I’m talking about and can confirm this or shoot it down.
particleguy
Yes, Quantum Field Theory can be explained through Lie groups. SU(2) is isomorphic to the quaternions of norm 1, and SU(2) is important if you want to understand the Lorentz group and Poincare group, which represent the symmetries of spacetime and special relativity. Check out the text book Physics From Symmetry by Jakob Schwichtenberg if you would like an approach that derives modern physics primarily from algebra
alfiedotwtf
OMG thank you. Purchasing right now!
You DO NOT understand how happy I am right now. Truely!
I did general physics for a year at uni as part of my Computer Engineering course, then switching to Computer Science where I picked up a year of quantum mechanics. Since then whenever I lay in bed and thought about physics I would end up awake for hours. So damn interesting but the maths always held me back, so sadly gave up.
I don’t know what’s changed (maybe maturity or maybe Vyvanse lol) but I’m slowly putting the pieces together. It’s always been in my outer periphery but still out of reach. Your confirmation has and will change my life. Maybe not career wise or life altering seen from the outside, but hot damn you have at least cleared my constant nagging guilt for not perusing maths and physics because you’ve just made it slightly closer within reach. Can’t wait for the book to arrive. Thank you!!!
aap_
To understand spin it's good to consider a gyroscope. when it has a lot of angular momentum there are two stable states for it in a gravitational field: aligned or anti-aligned with gravitation, up or down. in all other cases the gyroscope precesses. a spinor doesn't spin quite like a gyroscope but it is spinning in a sense (after all spin is angular momentum). but just like the gyroscope, you can think of it as having two stable states: in alignment with a magnetic field, or in anti-alignment. and because the magnetic field is a measure of some kind of rotation it can add to or subtract from the angular momentum of a spinor. this difference is "felt" as a negative or positive potential difference. this you can think of as two opposite forces on the spinor that split it apart into up and down components. the interesting thing is that a spinor with an arbitrary axis can always be written as the sum/superposition of an up and down spinor for some chosen direction. turns out quaternions have precisely the properties that you need to model this. i hope this was intelligible, it's a bit hard to put the geometry into words.
alfiedotwtf
Woah. Ok, that model totally blew my mind. I never understood what angular momentum had anything to do with it, but the gyroscope analogy makes total sense. Thank you!
incognito124
Related:
jdranczewski
This was an invaluable resource 5 years ago when I was working on a summer research project making a ray tracing-based optical levitation simulator - initially it felt a bit insane to try to deeply understand this obscure bit of maths to implement rotations, but once it clicked it clicked. Quaternions ended up being a super neat formalism for writing and computing rotational equations of motion.
https://github.com/jdranczewski/optical-levitation-raytracin... for my repo, and https://onlinelibrary.wiley.com/doi/abs/10.1002/nme.5165 for the rotational dynamics with quaternions.
dang
Related:
Visualizing quaternions (2018) - https://news.ycombinator.com/item?id=38043644 - Oct 2023 (42 comments)
Visualizing quaternions: an explorable video series (2018) - https://news.ycombinator.com/item?id=31083042 - April 2022 (15 comments)
Visualizing quaternions: An explorable video series - https://news.ycombinator.com/item?id=18310788 - Oct 2018 (32 comments)
t55
wow love the fact that you can interact with the videos
incognito124
That's what's most valuable to me too. If I remember correctly, Ben Eater (8bit CPU from scratch guy) and Grant Sanderson (3b1b guy) tried to do a little experiment on education with this guided-yet-interactive learning material back in 2018 (!!). As someone working in EDU sector of tech, I'm constantly amazed by what people come up with in order to explain things to other people (or even themselves). Whatever the experiment was, I'd say it was a success, and I hope we get to see more such material on other topics in future.
ge96
I still gotta grasp this for IMUs
FpUser
What a beautiful and high quality presentations. All the praises to the author.
null
quantadev
Just a tiny rant: In my view complex numbers are really about the concept of "orthogonality". The complex 'dimension' is orthogonal to the 'real' dimension, but anything in reality that's a continuum of values can be seen as a dimension, and therefore each one must have an orthogonal. That is, whenever you have a direction in a higher dimensional space (regardless of dimensionality) any vector will have a normal direction (perpendicular direction).
What basic complex numbers represent is a way of doing rotations where something moves from one direction towards it's orthogonal. That's what Euler's Formula is about also, which shows the relationship of 'e' and 'i' in this of course.
Now what Quaternions represents is the realization that if complex numbers have two components (real, imaginary) then we can treat each of those as a base vector and find a sort of 'next level up' orthogonality to each one individually.
I'm not good enough at math/geometry to know if this kind of 'next level up' bifurcation of dimensionality extends up past Quaternions or not (like something called Octernions, 16ions, 32ions, 64ions, etc), but it seems like is would?
Sniffnoy
Octonions and so on up are indeed a thing, but I don't think they do what you want. Even aside from the fact that they're restricted to power-of-2 dimensions, their algebraic properties get worse as you iterate the Cayley-Dickson process. The octonions aren't even an associative algebra, although they do have some weaker associativity properties which I'll skip detailing here. The quaternions are as far as most mathematicians are willing to go -- non-commutativity is commonplace, but who wants to deal with non-associativity?
But while the octonions at least have some mathematical relevance (they're actually connected to various exceptional objects, such as the exception Lie group G_2!), the sedenions and beyond basically don't. They have a tiny bit of associativity but not enough that they connect to any things or that hardly anyone wants to study them -- and worse yet, there are zero divisors so cancellation (ab=ac => b=c for nonzero a) doesn't even hold. (Inverses exist, yes, but without associativity, inverses don't imply cancellation! And therefore aren't much use.)
As another commenter mentioned, what you might be looking for instead if it's orthogonality you're focused on is Clifford algebras (aka geometric algebra). However, if you want to get the complex numbers or quaternions out of it, you'd need to use a negative-definite quadratic form -- if you use a positive-definite one, you'd instead get the split-complex numbers, which are much less interesting (and you'd get something similar instead of the quaternions).
quantadev
From your post I can tell you're way better at math/geometry than me, but I understood 80% of that. :)
Cayley-Dickson is interesting especially for Physics of course, because it brings in the concept of 'variable dimensions'. I think the flattening of objects, and the stopping of clocks (in Relativity), due to Lorentz effects in Minkowski space both on Black Hole Event Horizons and for objects approaching light speed (anywhere Lorentz holds) is, at the limits, ultimately the loss of a dimension, which would be my overall interpretation of what Cayley-Dickson is about too, in very broad terms.
So if Minkowski space is 4 dimensional, there would be some geometry for a 5-Dim Minkowski and it would use Octonians maybe, and that would be the geometry of the universe our universe is "embedded in"...I mean assuming of course you believe our universe is a Black Hole and we are all on an Event Horizon embedded in a 5D universe. Ya know, as one does. lol.
nh23423fefe
I don't agree. Complex numbers are the algebraic closure of the reals. Or the quotient of the real polynomial ring by (x^2+1=0). Or whatever other construction. The multiplication rule is the essence of C.
Orthogonality is captured linear algebra over R^2, but R^2 isn't a field or an algebra.
markisus
I think there is still a geometric viewpoint you can bring to the multiplicative structure of C. For example there is the extremely natural homeomorphism between unit C and SO(2). And C minus origin to (R+, SO(2)). It’s completely intuitive for mathematicians to say that 1 and i are separated by 90 degrees.
quantadev
Sniffy nailed it (above) when he mentioned Cayley-Dickson. That's exactly what I was getting at, and had never researched.
wanderingmoose
I really like the welch labs series on imaginary numbers which covers the first part of what you talk about -- leveling up the notion of what a complex number is. Though his focus was more on solving simple equations with no real roots, but really detailing how/what is really going on.
It is a great precursor to then thinking about quaternions
https://www.youtube.com/watch?v=T647CGsuOVU&list=PLiaHhY2iBX...
quantadev
That exact video is the one that always comes to my mind when thinking of YT videos on this! I've seen it years ago. Definitely worth a watch for anyone who hasn't see it!
VyseofArcadia
> I'm not good enough at math/geometry to know if this kind of 'next level up' bifurcation of dimensionality extends up past Quaternions or not (like something called Octernions, 16ions, 32ions, 64ions, etc), but it seems like is would?
Octonions and up (more generally known as hypercomplex numbers) exist, but every time you pull the "double dimensions by adding more imaginary components" trick[0], you lose another useful property.
Real to complex loses total ordering. Complex to quaternion loses commutativity. Quaternion to octonion loses associativity (but they are at least alternative). The sedenions aren't even alternative, and they have zero divisors to boot.
You can also generalize hypercomplex numbers to the study of Clifford algebras.
[0] The Cayley-Dickson construction
hgomersall
Geometric algebra would be what you're looking for here. This is a great intro to the topic: https://geometry.mrao.cam.ac.uk/1993/01/imaginary-numbers-ar...
AnIrishDuck
Also the (provocatively titled) "Let's Remove Quaternions from every 3d Engine" [1]
Spoiler alert: rotors are mechanically identical to quaternions, while being easier to understand. If you understand rotors, you understand quaternions. You can fit the laws you need to understand rotors on a business card.
Plus, rotors abstract to higher and lower (well, there's only one plane and its two respective orientations in 2d, but still) dimensions.
Complex numbers as planes (bivectors in GA parlance) has been the most mind-opening mathematical concept I've been exposed to in the last decade. The associated geometric product has helped me better understand concepts (like "handedness") that troubled me during undergrad engineering.
quantadev
I had never even heard of rotors! Thanks for this. I watched that video. The video doesn't really explain how it extends to higher dimensions tho, that I could discern.
I wonder how/if any of this can be applied to LLMs 'Semantic Space'. As you might know, Vector Databases are used a lot (especially with RAG - Retrieval Augmented Generation) mainly for Cosine Similarity, but there is a 'directionality' in Semantic Space, and so in some sense we can treat this space as if it's real geometry. I know a TON of research is done in this space, especially around what they call 'Mechanistic Interpretability' of LLMs.
andrewfromx
like drawing triangles on a beach ball!
gamedever
[flagged]
seanhunter
Do you think Terence Tao doesn't understand Geometric Algebra? Just trying to understand where your hot take is coming from.
My working hypothesis is he has at least an understanding of most fields of advanced maths and if he's looking into something it's because he thinks something interesting is there. That carries a lot of weight.
Edit to add: he has done research into Quaternionic Hilbert spaces in the past https://pubs.aip.org/aip/jmp/article-abstract/37/11/5848/465...
Joel_Mckay
Quaternions have niche use-cases that greatly simplify some problems that otherwise create ambiguities using naive approaches.
Many first encountered them in sensor fusion for IMU sensors, or 3D graphics. =3
null
t55
lmao i guess i'll be the last one scribbling i, j, k in my stone tablet
null
Interestingly showing spherical trig identities was how Hamilton demonstrated his quaternions to the royal irish academy when he found them. See (D) through (K): https://www.maths.tcd.ie/pub/HistMath/People/Hamilton/Quater...
When i first read this i found it very hard to understand, because i was unfamiliar with spherical trigonometry, but there's quite some beauty to be found there.