ATell-SoundTheory / CliffordAlgebras.jl

A fast and lightweight Julia package for Clifford and geometric algebras.
https://atell-soundtheory.github.io/CliffordAlgebras.jl/
MIT License
36 stars 4 forks source link

Conformal model with n∞ and n0; and custom metrics #8

Open davibarreira opened 1 year ago

davibarreira commented 1 year ago

Hey, first of all, thanks a lot for this package! I'm trying to learn Geometric Algebra, and this has been helping a lot.

Now, perhaps I'm missing something, but from what I've read, the Conformal model uses as bases n∞ and n0, such that n∞ · n0 = -1. This is not what I get when using CliffordAlgebra(:Conformal2D). I get that the implementation of CliffordAlgebra(:Conformal2D) returns e+ and e-, which can be used to construct n∞ and n0. I was wondering if there is a way to change the basis vectors, to use this variation I'm talking about. Also, I was wondering if the package allows for the use of any custom metric Q.

chakravala commented 1 year ago

@davibarreira you could just use Grassmann.jl

julia> using Grassmann

julia> @basis S"∞∅++"
(⟨∞∅++⟩, v, v∞, v∅, v₁, v₂, v∞∅, v∞₁, v∞₂, v∅₁, v∅₂, v₁₂, v∞∅₁, v∞∅₂, v∞₁₂, v∅₁₂, v∞∅₁₂)

julia> v∞⋅v∅
-1v
ATell-SoundTheory commented 1 year ago

@davibarreira That would certainly be possible. The reason why there is currently no support for a non-diagonal metric is simply the compile-time optimization, which works best for a sparse metric. My approach to the general case would be to construct a new non-orthogonal basis from the basis given by the algebra constructor. That way I can work with the optimised basis in the background and still have my desired custom basis. That would also apply to the conformal algebra case.

If you can give me a reference to the specific realisation of the 2D CGA that you have in mind, I may be able find the time to add it. Generalising the metric support should also be fairly straight-forward.

davibarreira commented 1 year ago

So here is an image illustrating what I'm talking about. This is from "Geometric Algebra for Computer Science" by Leo Dorst. image

ATell-SoundTheory commented 1 year ago

Thanks. I'll try to allocate some time to add this in the near future!