#5241: Matrix Group sometimes assumes base ring is a field
--------------------------+-------------------------------------------------
Reporter: kcrisman | Owner: joyner
Type: defect | Status: new
Priority: major | Milestone: sage-3.4.1
Component: group_theory | Keywords:
--------------------------+-------------------------------------------------
From sage-support:
{{{
sage: M1 = matrix(ZZ,2,[[-1,0],[0,1]])
sage: M2 = matrix(ZZ,2,[[1,0],[0,-1]])
sage: M3 = matrix(ZZ,2,[[-1,0],[0,-1]])
sage: MG = MatrixGroup([M1, M2, M3])
sage: MG.order()
4
sage: MG.list()
Traceback (click to the left for traceback)
...
AttributeError: 'sage.rings.integer_ring.IntegerRing_class' object
has
no attribute 'prime_subfield'
}}}
The offending code is in groups/matrix_gps/matrix_group.py where the
problem is in the list method of MatrixGroup.
{{{
429 F = self.field_of_definition()
430 n = F.degree()
431 p = F.characteristic()
432 a = F.prime_subfield().multiplicative_generator()
433 b = F.multiplicative_generator()
}}}
In the class definition of MatrixGroup, any base ring is allowed. But at
least this particular method (others?) assume that the base ring is in
fact in a field.
Since a and b above are definitely used later in list(), as this all calls
GAP, someone with a good knowledge of GAP should address this - and look
for other places it's assumed that the base ring is a field and at least
catch that exception with a better error message.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5241>
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
-~----------~----~----~----~------~----~------~--~---