falesiani / torch_ga

Python package for Geometric / Clifford Algebra with Pytorch.
MIT License
9 stars 0 forks source link

Multiplication in any `CL(\mathbb{R}^d)_{p,q}` #1

Open Demirrr opened 12 months ago

Demirrr commented 12 months ago

Dear all,

First of all, thank you for this framework. I reckon this framework would be benefitial for many.

In our recently accepted work (Cliford Embeddings at ECML 23), we observed that learning embeddings based on CL_{p,q} gives a quite bit of flexibility. Yet, as the p and/or q grows, explicitly computing an element-wise multiplication becomes difficult to implement, since we have many valid of p and q.

So, my question would be

=> Let x and y denote two n by d dimensional pytorch.FloatTensor, respectivly. Can we perform the element-wise multiplication of x and y in any valid CL(\mathbb{R}^d)_{p,q}?

falesiani commented 12 months ago

Dear Demirrr,

Yes, the complexity increases explonential with the size of the GA dimension (2^d). Element wise multiplication of course can be implemented efficiently if we know the signature of the element. If the question is about to which GA operation is the element-wise product correspond, that I am not sure. I feel is not generaly well defined and need to be introduced separately. But I may not have understood the question.

Thank you! Have a nice day

Demirrr commented 12 months ago

Dear @falesiani,

Thank you for your comment. My appoligies for not being precise enough

Given that

  1. If p=q=0 and x,y \in CL_{p,q} (\mathbb{R}^d), then the multiplication of x and y corresponds/isomorphic to the element-wise multiplication in d-dimensional real numbers \mathbb{R}^d.
  2. If p=0 and q=1 and x,y \in CL_{p,q} (\mathbb{R}^d), then the multiplication of x and y corresponds to the element-wise multiplication in d/2-dimensional complex numbers \mathbb{C}^{d/2}
  3. If p=0 and q=2 and x,y \in CL_{p,q} (\mathbb{R}^d), then the multiplication of x and y corresponds to the element-wise multiplication in d/4-dimensional quaternions \mathbb{H}^{d/4}

Now, let's assume that p=4 and q=3, x,y \in CL_{p,q} (\mathbb{R}^d). Can I use torch_ga to multiply x and y ?

Thank you :)

falesiani commented 12 months ago

Dear @Demirrr,

The element-wise operation is present now, but if the elements doesn't have common blades it will return null vector. I am not event sure if should be a zero scalar.

Thanks

Demirrr commented 12 months ago

Thank you !