Infrared
Geometric Algebra Generator written in Mojo.
https://cdn.discordapp.com/attachments/1271685407486119956/1281056256257167412/image.png?ex=66dafcdc&is=66d9ab5c&hm=ed3efd0de8ea60f0be6a11712891783b357bb735524f65dd5f496be1138681d1&
https://github.com/helehex/infrared
GitHub
GitHub - helehex/infrared: Geometric Algebra
Geometric Algebra. Contribute to helehex/infrared development by creating an account on GitHub.
26 Replies
I made a lot of progress the last couple days, but i still need to push the changes. The plan is to get that done tomorrow, so I'll give a better overview when that happens.
(It's essentially a subset of linear algebra with a very nice geometric interpretation)
I have the multiplication table actually implemented in my
Multivector
struct now
Theres a few wierd things i've had todo, but hopefully they get worked out with time.
I'd also like to improve the initialization of multivectors still
I also already added the various conjugates one might find usefulHeres a picture of
Cl(6, 0, 1)
,
The first number (6) represents the number of basis vectors that square to 1
, the second number (0) represents the number of basis vectors that square to -1
, and the last number (1) represents the number of basis vectors that square to 0
.The gaps are where any two basis elements of the algebra, which were both constructed from a
0
basis vector, are being multiplied together. those operations can be masked away to avoid any overhead.
I put the zero basis vectors before the others in this example, but they are very easy to switch around if desired.
By selecting different parts of the algebra, you can represent geometric objects like points, lines, planes, circles, etc.., which can be multiplied together under various products, while respecting algebraic properties like associativity.
If you've ever wanted to multiply two circles together, this is a nice way todo so :]
I hear that it's useful for things like spacetime algebras as well.
Ok, I just pushed the latest changes.looks like a carpet !! :mojo:
It does
nice!
I made table generation 2x faster by squashing in one basis vector at a time, instead of appending the whole thing, then sorting and squashing.
i'll push it sometime today
I could probably get like 100x speedup by switching everything to binary ops, but one step at a time :]
Also, i'll probably cache some of the common tables in a file anyways, but it's still nice to have a faster generator
256 dimensional algebra
nova
package a dependency of infrared
. (nova is my testing grounds for collection types)Table
for the geometric product table, which is faster, but also fixes an issue i found with aliased List[List]
...Multivector
now uses ThickVector
for it's underlying data storage.
Theres a problem with multiplying multivectors when they get past ~16 total unmasked dims:
I thought it was because of the @parameter for's
exploding the generated code, but i tried removing all the places that would explode, and it still gets killed.
On top of that, I also tried using a heap allocation instead of pop.array
for ThickVector
, in case that was exploding, but it still gets killed.I also made the formatting of mult table a little nicer today, here's cl(4,4):
found the culprit, passing
sig
to mul_mask
as an argument instead of a parameter fixes ityou ever use Blender?
the free 3d modeling software?
yep
yeah i use it whenever i want to make a 3d model for something
unless for 3d printing
then i use freecad
There's a whole geometry node section where you can pass all sorts of things in and out comes all sorts of cool things. It's quite complex and given a couple of sliders, the options are mind-boggling. Thhis has some vibes of that.
interesting
Oh, of course since it's blender, there's animations. They (blender foundation) were working to replace all functional nodes with geometry nodes and had made a lot of progress last time I checked so there's options for materials, lighting, and pretty much everything depending on inputs.
i wonder if i can trick this post to using a different thumbnail image
WAIT A SECOND, each one of those cells is a table and each of those cells..... IS THAT ANOTHER TABLE?!
tables in tables in tables in tabl...
turtles all the way down, way cool, very nice
it's actually a multiplication table for
cl(4,4)
though
the background color of each cell represents different grades
the color of text (black or white) represents the sign
you cant really see the text though
cause it's so small
also, sign of 0
just prints empty space, but cl(4,4)
has no null basis elements
cool, i changed the thumbnail of this postdoesn't refresh for me 😦
dang, maybe i broke it
oh well😮💨