Ganja.js: Geometric Algebra Generator for JavaScript, C++, C#, Rust, Python
github.com
github.com
Edit: on second thought, good for you! Screw all the politically correctness BS that invades our software development stuff. There's no place for that in science.
Ganja is the second largest city in Azerbaijan, why is it such a political statement?
By yours, semen is perfectly legal in several countries (and a number of states in the US). That doesn't make it appropriate as a name in an educational setting.
Or, "Today we are going to be using Wine" doesn't need quite so much careful disambiguation.
Ah, yes, Illinois made semen illegal in 1923, as we all know. I now run around hiding from the cops.
Well, you'll have a really hard time convincing people that it's good. (Unless they already have a vested interest in rationalizing their decisions.)
Nobody ever got smarter from smoking too much weed.
Carl Sagan: Cannabis enables nonmusicians to know a little about what it is like to be a musician, and nonartists to grasp the joys of art. But I am neither an artist nor a musician. What about my own scientific work? ... I have made a conscious effort to think of a few particularly difficult current problems in my field when high. It works, at least to a degree. I find I can bring to bear, for example, a range of relevant experimental facts which appear to be mutually inconsistent.
What about having fun or relaxing? Most recreational substances or activities aren’t supposed to “make you smarter”.
Weed has already thoroughly permeated society, no use trying to turn back the clock there. We should just stop arresting people for it and stop making it so you have to take unnecessary risks to get it.
It does seem like the cannabis had a negative effect on my memory and emotional stability (I was high basically the entire day for several years while my brain was still developing). And many of my worst paranoid delusions ever have been on uncomfortably high doses of cannabis. But so have some of the most beautiful and dare I say spiritual experiences of my life, and I wouldn't take those back.
I do wish I'd waited until I was older though, and in a better place emotionally (I was using it as a painkiller, if you will.)
All things considered though, I'm a much bigger fan of psilocybin and LSD. Rather than worsening my addictions they made me quit a lot of unhealthy things I was doing. I also found microdosing to be very beneficial.
For comparison, you can conduct a business meeting on a small dose of LSD and find that it actually helps you pay attention and think clearly, while even small doses of cannabis will interfere with something as trivial as a trip to the corner store.
I had hoped there would be a more direct association between the Hindi name and the underlying mathematics given Indian mathematics emerged as early as 1200 BC. Would make for a perfect reverse-psychology alibi.
In high school, my school hosted some exchange students from "Ganja school #5". As we were standing at LAX airport waiting for the Azeri students to arrive, a couple of surfer dudes wearing board shorts and Hawaiian shirts walked by and stared at our sign:
"Ganja school .... duuuuuude .... I wanna go there!"
Ganja as hemp is mostly pronounced as Gaanjaa, but accepted spellings are Ganja.
Check out a demo https://observablehq.com/@enkimute/animated-orbits
Join the discord https://discord.gg/vGY6pPk.
Enki (the guy behind bivector) also gave a talk on GA at SIGGRAPH 2019 https://www.youtube.com/watch?v=tX4H_ctggYo
Why would there be a bivector community? Is it something relatively new, so there's a sense of "we're convinced, but other people aren't yet?"
WRT community, the https://bivector.net web site has a discussion forum for people interested in geometric algebra. I’m still a newbie so I don’t know the territory very well, but it is still fairly hard to get to grips with geometric algebra: there isn’t a lot of tutorial material and there’s still a lot of variation in details of notation and choice of basic operators, which is confusing for a beginner.
I have been collecting links recently: see https://dotat.at/:/?q=geometric+algebra
1. Yes, it seems Projective Geometric Algebra is new enough that the terminology and symbols are still being debated.
2. Yes, people who "get" it seem pretty convinced. I think the newish PGA is attractive for convincing real-time graphics software engineers and hardware engineers. For example, it has 16 floats in R(3,0,1) too.
3. The community is there to help spread the knowledge and to help as you start finding out about all the other Geometric Algebras. And overcoming the Euclidean mindset is tough.
This is the first bit of higher-than-Calc math I've worked at in a long while and it feels like it's bending my mind in a good way, like Lisp did.
I love geometric numbers. I wish they were introduced earlier in school, I would've actually enjoyed linear algebra class.
I see this topic show up often on HN, but no mathematicians I know in real life care about it, or even know about it. From googling geometric algebra and related terms, it just seems like more linear algebra to me - why the different name?
1 => https://blog.ycombinator.com/joan-lasenby-on-applications-of...
- You get one unified simple framework which replaces or incorporates vector, matrix, complex, quaternion, tensor and spin algebra (all of which would otherwise need their own incompatible notations). [1]
- Objects and transformations of objects can be expressed by the same multivectors. In the computer graphics of today you would have let's say: Vectors for points and translations, quaternions for interpolatable rotations, matrices for chaining up transformations and you would have separate objects for rays, planes, etc. But in geometric algebra all of that can be expressed by one class: The multivector. [2] [3]
- It generalizes the same way in all dimensions (which is not true for e.g. vector algebra and the cross product).
- One can easily derive geometric calculus from geometric algebra, thus have derivatives and integrals (which is a lot harder to do when you have 6 different frameworks and notation systems)
- Bonus: Because it is unified, it has less edge cases and you need less workarounds, possibly making it also more stable / robust.
It would be interesting if anyone could contribute if there are serious downsides except for not being widely used (mostly for historic reasons I guess).[1]: https://en.wikipedia.org/wiki/Geometric_calculus#/media/File... [2]: http://projectivegeometricalgebra.org/projgeomalg.pdf [3]: https://bivector.net/3DPGA.pdf
A more mathematically grounded example could be the complex plane compared to the real line: when encountered for the first time, it is not simple in any way, but it offers a clean solution to many (originally real valued) problems (perhaps by the fact that it is algebraically closed?).
NB: the author of this library also made a very interesting presentation of geometric algebra (using this library as vehicle) for SIGGRAPH 2019: https://www.youtube.com/watch?v=tX4H_ctggYo
It has been posted a few times on HN before.
Geometric algebra is not unique as a mechanism to grouping Maxwell's equations into a more coherent structure. This can also be done with both the tensor formalism and differential forms. Each of these can encode Maxwell's equations into a single equation for the electric sources, plus an additional equation for the (zero) magnetic sources. So the fact that we can write all of Maxwell's equations as a single equation, when compared to the tensor formalism or differential forms, is only an incremental improvement.
However, some interesting opportunities are made available by putting Maxwell's equations into this single equation form. In particular, the system of equations is put into a form that we can invert using a Green's function for the differential operator. This gives us a way to solve all of Maxwell's equations in one fell swoop. It's well known that this is possible for the statics equations of electromagnetism, but we can also do this for the time dependent case, and obtain Jefimenko's solution of Maxwell's equation ( https://en.wikipedia.org/wiki/Jefimenko's_equations ) directly. That solution can be obtained without first having to resort to solving the second order potential equation, and differentiating those fields to find the electric and magnetic fields.
The geometric algebra form of the Jefimenko's solution is much simpler than the conventional form, because it is expressed in terms of a single electromagnetic field variable (F = E + I B). There are many other such examples, where things become simpler to express when the fields are grouped logically into a single entity.
A great reference that explores electrodynamics and many other geometric algebra physics topics is Doran and Lasenby's "Geometric Algebra for Physicists" ( https://www.cambridge.org/core/books/geometric-algebra-for-p... ).
Be warned that the reference above is a tough read. I have a for dummies exploration of some of the electromagnetism applications of geometric algebra in my book (free pdf available here: http://peeterjoot.com/writing/geometric-algebra-for-electric... ). I don't use the explicitly relativistic invariant form of Maxwell's equations used in Doran and Lasenby -- it is beautiful, but makes things somewhat more inaccessible. My book is fairly small, and is grouped into three pieces (geometric algebra basics, integration theory, and finally applications to electromagnetism.) I don't touch the mixed signature (projective, conformal, and relativistic) geometric algebras that ganja supports, as I tried to keep things as simple as possible.
https://www.youtube.com/watch?v=UzEytSmwEpk&ab_channel=probi...
Mandelbar over the split-complex numbers: https://imgur.com/PkzY7B6 (admittedly, a bit underwhelming)
I'm starting to see a pattern in those names
[0] https://www.google.com/search?q=ganja+meaning&oq=ganja+meani...
[edit: It appears I'm right: https://en.wikipedia.org/wiki/Exterior_algebra]
> Ganja is a Hindi name for hemp, derived from the word ganjha, from the Sanskrit gañjā, referring to a "powerful preparation from cannabis sativa".
You're generating code that relates to a certain algebra, likely for providing API for doing calculations based on that algebra (so an algebra library). Why would you call that 'algebra generated by ganja.js'?
Generators [0], generating sets/functions [1][2], have precise definitions within mathematics, and they have zero relation to code generation. So they have zero relation to what ganja.js is doing (i.e., generating code). No offense, but you should know better.
[0] https://en.wikipedia.org/wiki/Generator_(category_theory)
The 'generated by' in that sentence is referring to the code generation - not the mathematical generators. I'll change 'algebra' to 'algebra implementation' to make that more clear. (I figured the very sentence 'an algebra generated by ganja.js' disambiguates the interpretation, but I'm happy to stand corrected.)
Ganja can create numerical implementations for a wide range of algebras (not just 'a certain algebra'), including any associative algebra (you can give it a Cayley table), although the focus is on Clifford Algebras, and providing the ability to stay close to the mathematical syntax. In order to do that it provides operator overloading, algebraic literals, etc .. (all features that do not natively exist in javascript). Because it is not 'a certain algebra', but a wide range, for which the code is only generated at runtime - it seemed a reasonable way of describing what is going on.
Thanks for letting me know it confused you - will fix it right away!