#4762: Odd error message for congruence subgroups
---------------------------+------------------------------------------------
 Reporter:  ljpk           |       Owner:  craigcitro
     Type:  defect         |      Status:  new       
 Priority:  minor          |   Milestone:  sage-3.2.2
Component:  modular forms  |    Keywords:            
---------------------------+------------------------------------------------
 I was looking at generators of various different congruence subgroups, and
 got the following error:

 {{{
 sage: Gamma0(5).generators()[0]

 [1 1]
 [0 1]

 sage: Gamma0(5).generators()[0] in Gamma0(7)
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)

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

 /home/was/s/local/lib/python2.5/site-packages/sage/groups/group.so in
 sage.groups.group.Group.__contains__ (sage/groups/group.c:1034)()

 /home/was/s/local/lib/python2.5/site-packages/sage/modular/congroup.pyc in
 __call__(self, x, check)
    1654         if isinstance(x, CongruenceSubgroupElement) and x.parent()
 == self:
    1655             return x
 -> 1656         x = CongruenceSubgroupElement(self, x, check=check)
    1657         if not check:
    1658             return x

 /home/was/s/local/lib/python2.5/site-
 packages/sage/modular/congroup_element.pyc in __init__(self, parent, x,
 check)
      46             if not congroup.is_CongruenceSubgroup(parent):
      47                 raise TypeError, "parent (= %s) must be a
 congruence subgroup"%parent
 ---> 48             x = M2Z(x)
      49             if x.determinant() != 1:
      50                 raise ValueError, "matrix must have determinant 1"

 /home/was/s/local/lib/python2.5/site-packages/sage/matrix/matrix_space.pyc
 in __call__(self, entries, coerce, copy, rows)
     306             entries = 0
     307
 --> 308         if entries == 0 and hasattr(self, '__zero_matrix'):
     309             return self.zero_matrix()
     310

 /home/was/s/local/lib/python2.5/site-packages/sage/structure/element.so in
 sage.structure.element.Element.__richcmp__
 (sage/structure/element.c:5247)()

 /home/was/s/local/lib/python2.5/site-packages/sage/structure/element.so in
 sage.structure.element.Element._richcmp (sage/structure/element.c:4954)()

 /home/was/s/local/lib/python2.5/site-packages/sage/modular/congroup.pyc in
 __call__(self, x, check)
    1654         if isinstance(x, CongruenceSubgroupElement) and x.parent()
 == self:
    1655             return x
 -> 1656         x = CongruenceSubgroupElement(self, x, check=check)
    1657         if not check:
    1658             return x

 /home/was/s/local/lib/python2.5/site-
 packages/sage/modular/congroup_element.pyc in __init__(self, parent, x,
 check)
      48             x = M2Z(x)
      49             if x.determinant() != 1:
 ---> 50                 raise ValueError, "matrix must have determinant 1"
      51             x.set_immutable()
      52

 ValueError: matrix must have determinant 1
 }}}

 It might be correct not to allow coercions from one congruence subgroup to
 another, but the matrix *does* have determinant 1, so the error message
 should be changed to one that is more suitable.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4762>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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