pygae / galgebra

Symbolic Geometric Algebra/Calculus package for SymPy :crystal_ball:
https://galgebra.rtfd.io/
BSD 3-Clause "New" or "Revised" License
227 stars 62 forks source link

The wedge product operator ^ returns wrong result #515

Closed mammalwong closed 5 months ago

mammalwong commented 5 months ago

As title, to reproduce the bug, run the code below in jupyter or colab, this case - signature Cl(3,0,0) and wedge product between 2 2-blades return wrong result:

sig = (3,0,0)
ga = Ga('e',
  g=[1]*sig[0]+[-1]*sig[1]+[0]*sig[2],
  coords=S.symbols(f"0:{sum(sig)}", real=True),
  wedge=False)
a = ga.mv('A','grade',2)
b = ga.mv('B','grade',2)
(a^b), a*b-(a|b), (a*b-b*a)/2

The wedge product a^b returns 0 which is clearly incorrect, and the other two methods a*b-(a|b) and (a*b-b*a)/2 agree to the same nonzero result, notice that (a^b) is not equal to a*b-(a|b) in this case, and it is not hard to find other cases that having the same problem by altering the algebra signature and the grades of a and b.

mammalwong commented 5 months ago

I found I was wrong, the wedge product did return correct result in this case, and I am closing this false issue