Implementation GSoC Group Theory (gxyd, jksuom, asmeurer) - gxyd/sympy GitHub Wiki
Implementation Details
Free Group:
Though mathematically Free Groups
is just a type of Finitely Presented Groups i.e Free Group is a Finitely Presented Group with no relators, i.e R = ∅
.
But from implementation point of view Finitely Presnted Groups
API will look like g = FpGroup( f, r )
here f
denotes a FreeGroup
like f = FreeGroup( 4 )
and r
being a set of relators used for making the Finitely Presnted Group g
.
>>> f = FreeGroup(2)
>>> g = f / set([f[0]**2, f[1]**3, (f[0]*f[1])**2)
>>> g
<fp Group on generators >
>>> f.is_fpGroup # even the FreeGroup is a Finitely Presnted Group
True
The Group Class: This will be a central class for all groups from which all the objects like mathematical groups, cosets will be derived from.
>>> f = FreeGroup( 2 )
>>> f.is_Group
True
>>> h = LeftCoset(Permutation(1,2), PermutationGroup((1,3,2),(1,4))
>>> h.is_group
False
Equality checking of any elements of FpGroup? How to do this?
Normal form ??
Algorithms that are used in this regard include: If the FpGroup is known to be of finite order then use the faithful permutation representation by a bounded Todd-Coxeter. If this fails, a Knuth-Bendix[3] is attempted and the words are compared via their normal form. <------ what is normal form here?
Notation used for checking the equality
It can be sort of a debate if we want to use ==
for checking structural equality
or mathematical equality
my opinion: We should go with ==
refering to mathematical equality
since checking the structural equality if not much of a use
in the case of Groups
. Since defining mathematical equality
is to be done anyway since that is a fundamental operation in Group Theory
Now if we don not define the mathematical equality
using ==
then other methods like .equals
will have to be used that don not seem
to be good from the user point of view.
Consider this:
>>> f = FreeGroup( 2 )
>>> g = FpGroup( f, [ f.1**2, f.2**4, (f.1*f.2)**6] )
>>> g.1**2*g.2**4 == g.1**0 ---- 1
True
>>> (g.1**2*g.2**4).equals(g.1**0) ---- 2
True
API 1 seems way more intuitive that API 2
Now for equality of FpGroup
s since the Groups
are abstract objects even if they are constructed from same FreeGroup
and relators
they should be different the same is true for FreeGroup
Example
>>> f:=FreeGroup(2);
>>> g1:=f/[f[0]**2, f[1]**3, (f[0]*f[1])**5];
>>> g2:=f/[f[0]**2, f[1]**3, (f[0]*f[1])**5];
>>> g1 == g2;
False
Here though g1
and g2
have the same FreeGroup
and relators
from which they are constructed the groups g1
and g2
are different.
References
http://www.math.colostate.edu/~hulpke/talks/tala.pdf
https://en.wikipedia.org/wiki/Presentation_of_a_group
... [3] http://homepage.cs.uiowa.edu/~astump/papers/thesis-wehrman.pdf (Knuth Bendix ALgorithm)