# Ticket #5241: trac_5241-rebased.patch

File trac_5241-rebased.patch, 2.2 KB (added by AlexGhitza, 11 years ago)

rebased against 4.0

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

```# HG changeset patch
# User David Joyner <wdjoyner@gmail.com>
# Date 1243775593 -36000
# Node ID e91fe5c60f3b4ace6bf9d9a76e25d9f27cce4ee6
# Parent  fd89fee664d87b20ab77bb6e248d9a71c17affe4
fixed the bug reported in trac # 5241. - wdj

diff -r fd89fee664d8 -r e91fe5c60f3b sage/groups/matrix_gps/matrix_group.py```
 a [2 1]] sage: G.list()[0] in G True An example over a ring (see trac 5241):: 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() 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)