# Ticket #5241: trac_5241-matrix-gp-list.patch

File trac_5241-matrix-gp-list.patch, 2.0 KB (added by wdj, 11 years ago)

to be applied to sage-3.3.alpha6

• ## sage/groups/matrix_gps/matrix_group.py

```# HG changeset patch
# User David Joyner <wdjoyner@gmail.com>
# Date 1234813348 18000
# Node ID 6fb95f94f6aaa075171586279ebb45956c9bc412
# Parent  e2138334f239b57533766f43fc9d06b49485f8aa
D
D
D
D
D
D
D
fixed the bug reported in trac # 5241. - wdj

diff -r e2138334f239 -r 6fb95f94f6aa sage/groups/matrix_gps/matrix_group.py```
 a [2 1]] sage: G.list()[0] in G True 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.list() [[-1  0] [ 0 -1], [-1  0] [ 0  1], [ 1  0] [ 0 -1], [1 0] [0 1]] sage: MG.list()[1] [-1  0] [ 0  1] sage: MG.list()[1].parent() Matrix group over Integer Ring with 3 generators: [[[-1, 0], [0, 1]], [[1, 0], [0, -1]], [[-1, 0], [0, -1]]] sage: GL(2,ZZ).list() Traceback (most recent call last): if not self.is_finite(): raise ValueError, "group must be finite" MS = self.matrix_space() if not self.base_ring().is_field(): s = self._gap_().Elements().str(use_file=True) es = eval(s) v = [MatrixGroupElement(MS(x), self, check=False) for x in es] self.__list = v return list(v) # Get basic properties of the field over which we are working F = self.field_of_definition() n = F.degree() # Finally, create the matrix space in which all these matrices live, # and make each element as a MatrixGroupElement. MS = self.matrix_space() v = [MatrixGroupElement(MS(x), self, check=False) for x in v] self.__list = v return list(v)