#10452: Weird behaviour with cusps
-----------------------------+----------------------------------------------
   Reporter:  davidloeffler  |       Owner:  craigcitro
       Type:  defect         |      Status:  new       
   Priority:  major          |   Milestone:  sage-4.6.2
  Component:  modular forms  |    Keywords:  cusps     
     Author:                 |    Upstream:  N/A       
   Reviewer:                 |      Merged:            
Work_issues:                 |  
-----------------------------+----------------------------------------------
 The command "reduce_cusp" seems to be a bit flaky -- here are two
 perfectly standard inputs that cause it to fail in different ways:

 {{{
 sage: G = Gamma1(5); G
 Congruence Subgroup Gamma1(5)
 sage: G.reduce_cusp(1/2) # works
 1/2
 sage: G.reduce_cusp(3) # boom (1)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 /home/masiao/<ipython console> in <module>()

 /usr/local/sage/sage-4.6/local/lib/python2.6/site-
 packages/sage/modular/arithgroup/congroup_gammaH.pyc in reduce_cusp(self,
 c)
     658         """
     659
 --> 660         return self._reduce_cusp(c)[0]
     661
     662     def _reduce_cusp(self, c):

 /usr/local/sage/sage-4.6/local/lib/python2.6/site-
 packages/sage/modular/arithgroup/congroup_gammaH.pyc in _reduce_cusp(self,
 c)
     725         if d == 1:
     726             if v in H:
 --> 727                 return Cusps((0,1)), 1
     728             if (N-v) in H:
     729                 return Cusps((0,1)), -1

 /usr/local/sage/sage-4.6/local/lib/python2.6/site-
 packages/sage/structure/parent.so in sage.structure.parent.Parent.__call__
 (sage/structure/parent.c:6462)()

 /usr/local/sage/sage-4.6/local/lib/python2.6/site-
 packages/sage/structure/coerce_maps.so in
 sage.structure.coerce_maps.DefaultConvertMap_unique._call_
 (sage/structure/coerce_maps.c:3118)()

 /usr/local/sage/sage-4.6/local/lib/python2.6/site-
 packages/sage/structure/coerce_maps.so in
 sage.structure.coerce_maps.DefaultConvertMap_unique._call_
 (sage/structure/coerce_maps.c:3021)()

 /usr/local/sage/sage-4.6/local/lib/python2.6/site-
 packages/sage/rings/integer.so in sage.rings.integer.Integer.__init__
 (sage/rings/integer.c:7312)()

 TypeError: unable to coerce <type 'tuple'> to an integer
 sage: G.reduce_cusp(oo) # boom (2)
 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)

 /home/masiao/<ipython console> in <module>()

 /usr/local/sage/sage-4.6/local/lib/python2.6/site-
 packages/sage/modular/arithgroup/congroup_gammaH.pyc in reduce_cusp(self,
 c)
     658         """
     659
 --> 660         return self._reduce_cusp(c)[0]
     661
     662     def _reduce_cusp(self, c):

 /usr/local/sage/sage-4.6/local/lib/python2.6/site-
 packages/sage/modular/arithgroup/congroup_gammaH.pyc in _reduce_cusp(self,
 c)
     695         N = int(self.level())
     696         Cusps = c.parent()
 --> 697         v = int(c.denominator() % N)
     698         H = self._list_of_elements_in_H()
     699

 /usr/local/sage/sage-4.6/local/lib/python2.6/site-
 packages/sage/structure/element.so in
 sage.structure.element.Element.__getattr__
 (sage/structure/element.c:2666)()

 /usr/local/sage/sage-4.6/local/lib/python2.6/site-
 packages/sage/structure/parent.so in
 sage.structure.parent.getattr_from_other_class
 (sage/structure/parent.c:2840)()

 /usr/local/sage/sage-4.6/local/lib/python2.6/site-
 packages/sage/structure/parent.so in
 sage.structure.parent.raise_attribute_error
 (sage/structure/parent.c:2638)()

 AttributeError: 'PlusInfinity' object has no attribute 'denominator'
 }}}

 In each case {{{ G.reduce_cusp(Cusp(...)) }}} gives the right answer, so
 the problem is apparently that various code expects the input to be a Cusp
 object and raises problems when it isn't.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10452>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to