pygae / galgebra

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

CI fails due to worse simplification on sympy master #441

Closed eric-wieser closed 4 years ago

eric-wieser commented 4 years ago

No idea what the cause is, but this results in our CI failing. This code:

from sympy import *
from galgebra.ga import Ga

alpha = symbols('alpha')
x, t = symbols("x t")

m2d, g_t, g_x = Ga.build('g*t|x', g=[1, -1])

R = cosh(alpha/2) + sinh(alpha/2)*(g_t^g_x)
X = t*g_t + x*g_x
RX = (R*X)
Y = RX*R.rev()

agrees exactly on the value of RX, but gives Y the value:

# Sympy 1.6.1
(t*cosh(alpha) - x*sinh(alpha))*g_t + (-t*sinh(alpha) + x*cosh(alpha))*g_x

vs

# Sympy 1.7.dev
(2*t*sinh(alpha/2)**2 + t - x*sinh(alpha))*g_t + (-t*sinh(alpha) + 2*x*sinh(alpha/2)**2 + x)*g_x

These are equal, but the second is much less simple.

It would be good to produce a minimal repro that does not involve galgebra, so we can file this against sympy.

eric-wieser commented 4 years ago

Root cause is https://github.com/sympy/sympy/issues/19917