#17792: Word problem for FareySymbol
-------------------------------------+-------------------------------------
       Reporter:  mmasdeu            |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.7
      Component:  modular forms      |   Resolution:
       Keywords:  farey symbol,      |    Merged in:
  SL2Z, word problem                 |    Reviewers:
        Authors:  Marc Masdeu        |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  18e034409e8b62c81821e93132a11dd15d7fd432
  public/ticket/17792                |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Replying to [comment:7 mmasdeu]:
 > What you say makes a lot of sense, but the representation used here is
 quite standard in other implementations of finitely presented groups
 (AFAIK), and also in Sage. It's called Tietze representation, see
 
[http://www.sagemath.org/doc/reference/groups/sage/groups/finitely_presented.html].
 Since unfortunately -0 = 0, the 1-based approach is essential here no
 matter how much you like 0-based languages :-).

 Quoting Sage in order to prove that you are right is wrong ;-) This Tietze
 representation is AFAIK something internal to GAP system (which is
 1-based). IMHO The fact that we used it as a non hidden attribute in free
 group is wrong. I did not find any mathematical reference mentioning
 "Tietze representation".

 When somebody calls "word problem" he/she is even expecting a list of
 generators! Using the (possibly more compact) list of `(gen, power)` is
 fine. Replacing `gen` with its index is already a little bit of a hack.
 Replacing `gen` with its index plus one is too much for calling it
 `word_problem`. IMHO, the best would be a `Factorization` object
 {{{#!python
 sage: sage: F.<x,y> = FreeGroup()
 sage: f = Factorization([(x,2), (y,-3), (x,1), (y,1)], sort=False)
 sage: f
 x^2 * y^-3 * x * y
 sage: for i,j in f:
 ....:     print i,j
 x 2
 y -3
 x 1
 y 1
 }}}
 For matrices, the representation is ugly, but this can be easily fixed to
 be something like
 {{{#!python
 sage: m1 = SL2Z([1,1,0,1])
 sage: m2 = SL2Z([1,0,1,1])
 sage: f = Factorization([(m1,2),(m2,-3),(m1,2)], sort=False)
 sage: f        # this is currently ugly
 [1 1]^2  * [1 0]^-3 * [1 1]^2
 [0 1]      [1 1]      [0 1]
 sage: prod(f)  # this does work
 [-5 -8]
 [-3 -5]
 }}}
 I would be happy to fix the `Factorization._repr_` if you like this
 solution.

 > Also, you can always do something like:
 > {{{
 > sage: wd = F.word_problem(g)
 > sage: prod(F.gen(i-1) if i > 0 else F.gen(-i-1)**-1 for i in wd) == g
 > True
 > }}}

 Very elegant and very natural!

 Vincent

--
Ticket URL: <http://trac.sagemath.org/ticket/17792#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to