id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
5241 [with patch, positive review] Matrix Group sometimes assumes base ring is a field kcrisman joyner "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.
" defect closed major sage-4.0.1 group theory fixed joyner 4.0.1.alpha0 David Joyner Alex Ghitza