sympy icon indicating copy to clipboard operation
sympy copied to clipboard

FpGroup.make_confluent produces buggy rewrites

Open boothby opened this issue 3 years ago • 2 comments

In sympy version 1.11.1:

from sympy.combinatorics.free_groups import free_group
from sympy.combinatorics.fp_groups import FpGroup

G0, x = free_group('x')
G = FpGroup(G0, [x**4])
assert G.equals(x**4, G.identity) #True
G.make_confluent()
assert G.equals(x**4, G.identity) #False?!

Digging a little: before make_confluent is called, we have G.reduce(x**4) = <identity>. Afterwards, we have G.reduce(x**4) = x**-4.

boothby avatar Sep 05 '22 20:09 boothby

I don't know much about this topic or this part of the codebase but does the comment or code here shed any light: https://github.com/sympy/sympy/blob/f3805d0e5bd2d718f1b6b6f680cb5065586c083f/sympy/combinatorics/fp_groups.py#L101-L114

oscarbenjamin avatar Sep 05 '22 21:09 oscarbenjamin

It does. It says that misleading output may occur before make_confluent is called but not after. What I'm observing is the opposite.

boothby avatar Sep 06 '22 17:09 boothby

Is the output of self.reduce(word1*word2**-1) correct (before or after)?

oscarbenjamin avatar Sep 22 '22 11:09 oscarbenjamin