Hacker News new | ask | show | jobs
by jiggawatts 1 day ago
As someone who studies physics and then went into a long IT career (but kept reading papers casually), my view is that this whole GA saga is very reminiscent of how after decades of experience, I still can't convince juniors of the benefits of what I now consider obvious best practices. No amount of demonstrations of the blindingly obvious improvement of some better technique seems to work on someone who "finally got the thing to work".[1]

Certain kinds of perfect correctness are like pure and shining crystallised bits of refined knowledge created by the greatest wizards. "Parse, don't validate" or "Make invalid states unrepresentable." ought to be familiar to the better programmers here, the ones with decades of experience built on iterative, collaborative foundations with real consequences for error.

Theoretical physics doesn't have those same consequences, because there is no real punishment for their equivalent of "spaghetti code". Perversely, there's cachet to be gained for gaining understanding of its unnecessarily esoteric knowledge, much like how biologists and lawyers spend half a decade or more studying... Latin.[2]

Introducing Geometric Algebra to physics is like that wizard coder who sweeps away reams of spaghetti code and replaces it all with a call to a single standard library function. It's that "cheff's kiss" of cleanup. Meanwhile the juniors are screaming about how the senior "deleted all their hard work!"

Meanwhile, I never understood where Pauli and Dirac matrices came from! It's like they were pulled from fat air.

You've seen this in code, I bet. Some junior worked really hard on solving a problem and wrote a solid screen-filling wall of "a && b || c || !d && e && (f || g)..." continuing up to "ba, bc, bd", etc.. as they ran out single letters until they're well into the alphabet in double-character symbols.[3]

That's what those matrices are. Someone's hacky attempt at "making things work".

The problem is that we gave those people Nobel prizes and told everyone they're geniuses.

They are, but they were like that brilliant junior. Brilliant.. but junior.

Geometric Algebra sweeps all of that into one beautiful, consistent, crystal clear abstraction that is widely applicable. The magic matrix constants vanish. Bugs in 100-year-old textbook formulas suddenly come to light. Dozens of formulas, one set for each of the 1D, 2D, 3D, and 4D cases collapse into a single formula valid for any number of dimensions.

It's like watching someone struggle with "catching every possible instance of JavaScript injection".

No son, no. Just no. Stop enumerating badness. Stop. Just stop. Escape everything at the boundary instead, enforced by the type system. You'll thank me later.

I know it might be obvious to you, and you always use properly parameterised SQL queries or whatever. This is not the norm everywhere! I still get arguments, long drawn out arguments from people convinced that this is unnecessary and just one more search & replace is all they need to be safe from the bad hackers.

Physicists (and mathematicians) are still making that argument against GA.

"It's isomorphic!"

"That isn't the point!"

[1] You can't convince someone to climb Everest if they struggled to hike up to the top of one of its foothills.

[2] Let me be crystal clear: They're spending their precious time on this Earth learning a dead language instead of learning about the law or bugs. No amount of arguments will sway me. The bugs don't care what you call them. Criminals are guilty or innocent whether or not you speak funny in court. You've just made a simple thing harder for no good reason, that is all. Please stop.

[3] Yes, I've seen this. Twice, from two different people whom have never met. Aliens are amongst us.

5 comments

> biologists and lawyers spend half a decade or more studying... Latin.[2]

> [2] Let me be crystal clear: They're spending their precious time on this Earth learning a dead language instead of learning about the law or bugs. No amount of arguments will sway me. The bugs don't care what you call them. Criminals are guilty or innocent whether or not you speak funny in court. You've just made a simple thing harder for no good reason, that is all. Please stop.

The absurdity of this claim is enough to call into question everything else in your post.

Hyperbole as literary device, not sworn testimony. Argumentum ad literalismum: dismissed.
I'll just assume all the rest of your claims are hyperbole then.
I find it really fascinating that you use the metaphor to GA of a senior dev sweeping all the cruft away into a single clean abstraction, is that my read/smell of TFA (as a layperson for this depth of math) is that GA runs the exact same risk of leaky abstraction. It's really general and elegant and covers all these cases with a single abstraction, but in doing so it sometimes conflates very similar things (precisely because they are so similar) when they really ought to be separate things. Like a complex number and the rotation operator it performs. My seat-of-pants take is GA is just a bit too DRY.

My understanding is too shallow to get why we don't just go straight for EA/Clifford Algebra when the "lower" systems like cross product are insufficient.

I share the author's intuition that there ought to exist some mathematical object that begets Clifford Algebras and multivectors and GA and all the like that we have yet to discover.

> They're spending their precious time on this Earth learning a dead language instead of learning about the law or bugs

I know this is hyperbole, but it's my opinion Latin/Greek emerged so dominantly in law/bio/medical fields is that it allows at the same time semantic bleaching and composition. "Jargon is a DSL" if you will. Sure, you could say "heart muscle no worky cause insufficient oxygen" but "myocardial infarction" is a) more concise b) comprises reusable composable pieces of meaning (myo + card + -ial, in + farcire + -ion) c) most importantly, is extremely precise. It's like the trouble of using English + LLM to define a program, vs just writing damn code. Sure you can do the former, but it's lossy, and that lossiness causes issues.

We run into these kinds of issues quite often. I also majored in physics, but unlike you, I dropped out of my master's program (I just didn't have the talent. Given my generally limited intelligence, it was probably an inevitable outcome). From what I've read, the article seems to be arguing against the claim that because so many anomalies have accumulated in the field of GA, it's now ready to become a general purpose tool. Your argument appears to be that GA has been nicely organized as a standard library, essentially defining invalid states. So it's a high level abstraction perspective, but on the other hand, I think it could also be framed as a case against excessive abstraction. Interesting
(This is a nitpick and does not argue against your main claim that GA is a better abstraction to represent and solve physics problems with, that I have no way to evaluate because I don't speak GA, though now I'm curious and will maybe spend an afternoon trying to figure out)

I mean, come on, lawyers and biologists don't really spend half a decade studying Latin. You can tell because smart people that spend a year or two studying Latin are conversationally fluent in it, and lawyers aren't.

They spend a month or two memorizing some latin words that could have been in English, and then (for biologists, lawyers just stop there) years memorizing lots of names of things that they'd have to memorize no matter what language they were in, and it's not really any slower in Latin than it would be in English once you spent that O(1) effort to get used to it.

Like us (systems) programmers don't spend decades studying the C language, we spend a year or two getting comfortable in C and then the rest of our careers learning all sorts of interesting ideas like generational GC that come phrased in pseudo-C but might as well have been phrased in English pseudocode with a similar cognitive load to grokking them.

That wonderful popcnt() algorithm that uses 0x33333333 and 0x55555555 constants would be just as hard to decipher if it was written in plain English.

To be honest I was struggling to phrase my argument in a cohesive narrative without it turning into a ten page blog post.

The point I’m trying to make is that there are necessarily complexities inherent in all areas of study, and there are incidental complexities because of historical reasons, “culture” within certain fields, or juniors putting out their fields’ equivalent of spaghetti code.

Geometric Algebra sweeps away a lot of the rather messy parts of now century-old physics, but the work of doing that substitution is decidedly non-trivial and thankless, so other than Hestenes, nobody seems to be pushing for it.

It’s like the 2pi versus tau fad on the internet.

Mathematicians argue that they’re “the same”, so it doesn’t matter, and ramble on about their equivalent of “learn the Latin to be smart like me”.

No. It’s stupid. It was an error. Tau is the correct circle constant and eliminates magic constants that don’t belong from literally hundreds of famous formulas!

I and many others simply failed to understand radians until I learnt to treat 2pi as a single ligature instead of “two of something”.

I tried to make it clear that I wasn't arguing against your main point, that was made very clearly, just against a comparison you used that I think was a bit slanderous (tongue in cheek). Yes, obviously Tau is correct, and that's a better comparison to use.

Having dived deeper into the essay, author claims that some of the new notation is obviously better (clifford algebras) and the rest is overzealous unification that obscures rather than clarifies because it mixes types in a weird way (geometric product).

I've never heard of any of this before, but author's second point looks rather convincing. Can you give counterexamples, ideas that are much clearer to think about once represented using GP? I'd love to dive a bit deeper.

I'm a bit pressed for time, but one annoyance I've had with the classic "greek" physics notation is that they represent things from "both ends" of a graded vector space. So for example, they start with a scalar, then a vector, then ... pseudoscalar-1, and finally the pseudoscalar.

It's a shortcut useful only if you need to scribble on paper and your wrists hurt from writing too much, but it obscures the underlying physics.

The programming equivalent is putting abbreviations in identifiers where, sure, it's fewer characters, but then the reader needs to a track a mental lookup table to translate back to the intended meaning.

Pushing things like this too far results in meaningful aspects of the equations getting squeezed out entirely. For example, the generality of GA means that you have to (correctly) track negative signs and multiplications by pseudoscalars such that your formulas work in all dimensions. In traditional vector algebra it's all too tempting to eliminate certain products because in "your chosen dimension" they multiply to 1 or -1 or whatever and just... disappear due to traditional algebraic simplification conventions. But then if you need to work in 4D SR or curved spaces, you can't, because you threw away something essential while "optimising for characters on a page".

You have then "start over", typically reaching for a partial and incomplete subset of GA, reinventing that wheel over and over.

Hence the push for unification onto GA, to break this cycle.

As a programmer I’m wondering how you get a decent graphics library out of it. If it’s conceptually better, shouldn’t it make writing code to do calculations easier?
It can write some fascinating stuff, but you have to learn to think in it:

https://enkimute.github.io/ganja.js/examples/coffeeshop.html

A major problem is that its a very general theory. Most calculations turn into very large but very sparse matrix multiplications. To make them work fast requires code generation and an optimization pass.

These types of optimization problems show up all over graphics programming though:

* Representing rotations with matrices takes more space than quaternions.

* Sacrificing a dimension to projective geometry actually makes representing things like projections (duh) but also translations more efficient.

> shouldn’t it make writing code to do calculations easier?

You need an optimizing compiler that would take the high level description (in GA) and compile it to add subtract multiply divide of reals (the assembly language). I don't think we have that yet.

Till we have such a compiler it will be tempting to drop down to assembly. Assembly being a metaphor.

I gave this a go a couple of years ago. GA multivectors are a direct substitute for both vectors and matrix transformations. The challenge is efficiency: a unified type is too expensive for real time games. The typical approach is to create efficient subsets symbolically and bake those into the code so that the compiler has something it can work with. This works, but the "strong typing" of the mathematics and typical programming languages doesn't exactly mesh, so a clean typesystem/interface design is annoyingly difficult.

The main advantage is the elimination of gimbal lock which allows smooth interpolations of arbitrary rotations and translations. This dramatically simplifies certain codes relating to animation and robotics. In mathematics, it simplifies differentiation and integration over curved surfaces in 3D and higher dimensions.

Most developers working in those fields already use one of the many creatively named “impostors” of GA subsets in isolation, such as the quarternions.