Package sage :: Package groups :: Package matrix_gps :: Module matrix_group_element
[hide private]
[frames] | no frames]

Module matrix_group_element

source code


Matrix Group Elements

AUTHORS:
   David Joyner -- initial version
   David Joyner -- (2006-05) various modifications to address William
                   Stein's TODO's.
   William Stein (2006-12-09): many revisions.                

EXAMPLES:

    sage: F = GF(3); MS = MatrixSpace(F,2,2)
    sage: gens = [MS([[1,0],[0,1]]),MS([[1,1],[0,1]])]
    sage: G = MatrixGroup(gens); G
    Matrix group over Finite Field of size 3 with 2 generators: 
     [[[1, 0], [0, 1]], [[1, 1], [0, 1]]]    
    sage: g = G([[1,1],[0,1]])
    sage: h = G([[1,2],[0,1]])
    sage: g*h
    [1 0]
    [0 1]    

You cannot add two matrices, since this is not a group
operation.  You can coerce matrices back to the
matrix space and add them there:
    sage: g + h
    Traceback (most recent call last):
    ...
    TypeError: unsupported operand type(s) for +: 'MatrixGroupElement' and 'MatrixGroupElement'
    
    sage: g.matrix() + h.matrix()
    [2 0]
    [0 2]
    
    sage: 2*g
    Traceback (most recent call last):
    ...
    TypeError: unsupported operand parent(s) for '*': 'Integer Ring' and 'Matrix group over Finite Field of size 3 with 2 generators: 
     [[[1, 0], [0, 1]], [[1, 1], [0, 1]]]'
    sage: 2*g.matrix()
    [2 2]
    [0 2]



Classes [hide private]
  MatrixGroupElement
An element of a matrix group.
Functions [hide private]
 
is_MatrixGroupElement(x) source code