# Revision history [back]

Hello,

There is actually the membership and word problem implemented for subgroups of SL(2,Z). Though I just discovered that there is a bug in it (see #20347). The code can be used (in principle) as follows

sage: H = ArithmeticSubgroup_Permutation(S2="(1,2)(3,4)",S3="(1,2,3)")
sage: S = H.farey_symbol()
sage: g1, g2 = S.generators()
sage: g = g1^3 * g2
sage: g
[-1  3]
[-4 11]
sage: S.word_problem(g)
(1, 1, 1, 2)


The problem is that the group is not constructed from generators but from the action of the standard generators of SL2Z on cosets. So you have to do that part by yourself. If you indeed write such code, it would be very interesting to have your contribution in Sage source code!

Vincent

PS: the theoretical material can be found in the article of Kulkarni "An arithmetic-geometric method in the study of the subgroups of the modular group" (1991).