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] [1 1]
[0 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 +:
'FinitelyGeneratedMatrixGroup_gap_with_category.element_class' and
'FinitelyGeneratedMatrixGroup_gap_with_category.element_class'
sage: g.matrix() + h.matrix()
[2 0]
[0 2]
Similarly, you cannot multiply group elements by scalars but you can do it with the underlying matrices:
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] [1 1]
[0 1], [0 1]
)'
AUTHORS:
Bases: sage.structure.element.MultiplicativeGroupElement
Base class for elements of matrix groups.
You should use one of the two subclasses:
The base class only assumes that derived classes implement matrix().
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)
sage: g = G.random_element()
sage: type(g)
<class 'sage.groups.matrix_gps.group_element.FinitelyGeneratedMatrixGroup_gap_with_category.element_class'>
Return list representation of this matrix.
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)
sage: g = G.0
sage: g
[1 0]
[0 1]
sage: g.list()
[[1, 0], [0, 1]]
Bases: sage.groups.libgap_mixin.GroupElementMixinLibGAP, sage.groups.matrix_gps.group_element.MatrixGroupElement_base, sage.groups.libgap_wrapper.ElementLibGAP
Element of a matrix group over a generic ring.
The group elements are implemented as Sage matrices.
INPUT:
TESTS:
sage: MS = MatrixSpace(GF(3),2,2)
sage: G = MatrixGroup(MS([[1,0],[0,1]]), MS([[1,1],[0,1]]))
sage: G.gen(0)
[1 0]
[0 1]
sage: g = G.random_element()
sage: TestSuite(g).run()
Return the conjugacy class of self.
OUTPUT:
The conjugacy class of g in the group self. If self is the
group denoted by , this method computes the set
.
EXAMPLES:
sage: G = SL(2, QQ)
sage: g = G([[1,1],[0,1]])
sage: g.conjugacy_class()
Conjugacy class of [1 1]
[0 1] in Special Linear Group of degree 2 over Rational Field
Obtain the usual matrix (as an element of a matrix space) associated to this matrix group element.
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)
sage: G.gen(0).matrix()
[1 0]
[0 1]
sage: _.parent()
Full MatrixSpace of 2 by 2 dense matrices over Finite Field of size 3
Bases: sage.groups.matrix_gps.group_element.MatrixGroupElement_base
Element of a matrix group over a generic ring.
The group elements are implemented as Sage matrices.
INPUT:
M – a matrix.
parent – the parent.
type checking.
convert – bool (default: True). If true convert M to the right matrix space.
TESTS:
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)
sage: g = G.random_element()
sage: TestSuite(g).run()
Return the conjugacy class of self.
OUTPUT:
The conjugacy class of g in the group self. If self is the
group denoted by , this method computes the set
.
EXAMPLES:
sage: G = SL(2, GF(2))
sage: g = G.gens()[0]
sage: g.conjugacy_class()
Conjugacy class of [1 1]
[0 1] in Special Linear Group of degree 2 over Finite Field of size 2
Return the inverse group element
OUTPUT:
A matrix group element.
EXAMPLES:
sage: G = GL(2,3)
sage: g = G([1,2,1,0]); g
[1 2]
[1 0]
sage: g.__invert__()
[0 1]
[2 1]
sage: g * (~g)
[1 0]
[0 1]
Obtain the usual matrix (as an element of a matrix space) associated to this matrix group element.
One reason to compute the associated matrix is that matrices support a huge range of functionality.
EXAMPLES:
sage: k = GF(7); G = MatrixGroup([matrix(k,2,[1,1,0,1]), matrix(k,2,[1,0,0,2])])
sage: g = G.0
sage: g.matrix()
[1 1]
[0 1]
sage: parent(g.matrix())
Full MatrixSpace of 2 by 2 dense matrices over Finite Field of size 7
Matrices have extra functionality that matrix group elements do not have:
sage: g.matrix().charpoly('t')
t^2 + 5*t + 1
Test whether x is a matrix group element
INPUT:
OUTPUT:
Boolean.
EXAMPLES:
sage: from sage.groups.matrix_gps.group_element import is_MatrixGroupElement
sage: is_MatrixGroupElement('helloooo')
False
sage: G = GL(2,3)
sage: is_MatrixGroupElement(G.an_element())
True