Closed bollu closed 2 years ago
Hi, I don't believe I follow this question -- perhaps another user of the library can help illuminate this for me? Versor implements the left inner product, is this not sufficient for your needs?
There are a bunch of different inner products:
Dot product
They are only the same for vectors.
Look here for more information.
In my implementation of geometric algebra I have an implementation for the geometric product, which optionally takes a compile time function to select, which of the blades will be included. This way I implement the outer product and a bunch of inner products.
Since you also represent the blades using integers as bitvectors, you can just test a ^ b == 0
. When this is true, the resulting blade (wich will always be a scalar value) will be used as the result.
I'm currently not sure if the left contraction will result in the same value for the scalar part, but the contraction will also calculate the non-scalar vector parts, which means unnecessary calculations.
@wolftype are you saying that I should express the scalar product in terms of the left inner product and grade projection? While I could, it is:
As a newbie to geometric algebra, I actually dropped the library when I saw it does not have scalar products. Only after reading a little more did I realise how simple it is to implement.
I see -- a very reasonable feature request. Thank you for taking the time to clarify -- it is straight forward to add this at the compiler level, so I will get to it!
I've pushed a change to devel which supports scalar_product
method on multivectors. I don't have a suitable operator overload for this yet. Please test it and let me know if it does the trick. I agree it will be much more efficient this way.
e.g:
Rotor a, b;
a.scalar_product(b);
Thanks, I'll give it a shot!
Is there a reason as to why the scalar product is not implemented? It's defined as:
See wikipedia