Matrix group elements implemented in GAP#

class sage.groups.matrix_gps.group_element_gap.MatrixGroupElement_gap[source]#

Bases: ElementLibGAP

Element of a matrix group over a generic ring.

The group elements are implemented as wrappers around libGAP matrices.

INPUT:

  • M – a matrix

  • parent – the parent

  • check – bool (default: True); if True, do some type checking

  • convert – bool (default: True); if True, convert M to the right matrix space

list()[source]#

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]]
>>> from sage.all import *
>>> F = GF(Integer(3)); MS = MatrixSpace(F,Integer(2),Integer(2))
>>> gens = [MS([[Integer(1),Integer(0)],[Integer(0),Integer(1)]]),MS([[Integer(1),Integer(1)],[Integer(0),Integer(1)]])]
>>> G = MatrixGroup(gens)
>>> g = G.gen(0)
>>> g
[1 0]
[0 1]
>>> g.list()
[[1, 0], [0, 1]]
matrix()[source]#

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: m = G.gen(0).matrix(); m
[1 0]
[0 1]
sage: m.parent()
Full MatrixSpace of 2 by 2 dense matrices over Finite Field of size 3

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
>>> from sage.all import *
>>> F = GF(Integer(3)); MS = MatrixSpace(F,Integer(2),Integer(2))
>>> gens = [MS([[Integer(1),Integer(0)],[Integer(0),Integer(1)]]),MS([[Integer(1),Integer(1)],[Integer(0),Integer(1)]])]
>>> G = MatrixGroup(gens)
>>> m = G.gen(Integer(0)).matrix(); m
[1 0]
[0 1]
>>> m.parent()
Full MatrixSpace of 2 by 2 dense matrices over Finite Field of size 3

>>> k = GF(Integer(7)); G = MatrixGroup([matrix(k,Integer(2),[Integer(1),Integer(1),Integer(0),Integer(1)]), matrix(k,Integer(2),[Integer(1),Integer(0),Integer(0),Integer(2)])])
>>> g = G.gen(0)
>>> g.matrix()
[1 1]
[0 1]
>>> 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
>>> from sage.all import *
>>> g.matrix().charpoly('t')
t^2 + 5*t + 1
multiplicative_order()[source]#

Return the order of this group element, which is the smallest positive integer \(n\) such that \(g^n = 1\), or +Infinity if no such integer exists.

EXAMPLES:

sage: k = GF(7)
sage: G = MatrixGroup([matrix(k,2,[1,1,0,1]), matrix(k,2,[1,0,0,2])]); G
Matrix group over Finite Field of size 7 with 2 generators (
[1 1]  [1 0]
[0 1], [0 2]
)
sage: G.order()
21
sage: G.gen(0).multiplicative_order(), G.gen(1).multiplicative_order()
(7, 3)
>>> from sage.all import *
>>> k = GF(Integer(7))
>>> G = MatrixGroup([matrix(k,Integer(2),[Integer(1),Integer(1),Integer(0),Integer(1)]), matrix(k,Integer(2),[Integer(1),Integer(0),Integer(0),Integer(2)])]); G
Matrix group over Finite Field of size 7 with 2 generators (
[1 1]  [1 0]
[0 1], [0 2]
)
>>> G.order()
21
>>> G.gen(Integer(0)).multiplicative_order(), G.gen(Integer(1)).multiplicative_order()
(7, 3)

order is just an alias for multiplicative_order:

sage: G.gen(0).order(), G.gen(1).order()
(7, 3)

sage: k = QQ
sage: G = MatrixGroup([matrix(k,2,[1,1,0,1]), matrix(k,2,[1,0,0,2])]); G
Matrix group over Rational Field with 2 generators (
[1 1]  [1 0]
[0 1], [0 2]
)
sage: G.order()
+Infinity
sage: G.gen(0).order(), G.gen(1).order()
(+Infinity, +Infinity)

sage: gl = GL(2, ZZ);  gl
General Linear Group of degree 2 over Integer Ring
sage: g = gl.gen(2);  g
[1 1]
[0 1]
sage: g.order()
+Infinity
>>> from sage.all import *
>>> G.gen(Integer(0)).order(), G.gen(Integer(1)).order()
(7, 3)

>>> k = QQ
>>> G = MatrixGroup([matrix(k,Integer(2),[Integer(1),Integer(1),Integer(0),Integer(1)]), matrix(k,Integer(2),[Integer(1),Integer(0),Integer(0),Integer(2)])]); G
Matrix group over Rational Field with 2 generators (
[1 1]  [1 0]
[0 1], [0 2]
)
>>> G.order()
+Infinity
>>> G.gen(Integer(0)).order(), G.gen(Integer(1)).order()
(+Infinity, +Infinity)

>>> gl = GL(Integer(2), ZZ);  gl
General Linear Group of degree 2 over Integer Ring
>>> g = gl.gen(Integer(2));  g
[1 1]
[0 1]
>>> g.order()
+Infinity
word_problem(gens=None)[source]#

Solve the word problem.

This method writes the group element as a product of the elements of the list gens, or the standard generators of the parent of self if gens is None.

INPUT:

  • gens – a list/tuple/iterable of elements (or objects that can be converted to group elements), or None (default); by default, the generators of the parent group are used

OUTPUT:

A factorization object that contains information about the order of factors and the exponents. A ValueError is raised if the group element cannot be written as a word in gens.

ALGORITHM:

Use GAP, which has optimized algorithms for solving the word problem (the GAP functions EpimorphismFromFreeGroup and PreImagesRepresentative).

EXAMPLES:

sage: G = GL(2,5); G
General Linear Group of degree 2 over Finite Field of size 5
sage: G.gens()
(
[2 0]  [4 1]
[0 1], [4 0]
)
sage: G(1).word_problem([G.gen(0)])
1
sage: type(_)
<class 'sage.structure.factorization.Factorization'>

sage: g = G([0,4,1,4])
sage: g.word_problem()
([4 1]
 [4 0])^-1
>>> from sage.all import *
>>> G = GL(Integer(2),Integer(5)); G
General Linear Group of degree 2 over Finite Field of size 5
>>> G.gens()
(
[2 0]  [4 1]
[0 1], [4 0]
)
>>> G(Integer(1)).word_problem([G.gen(Integer(0))])
1
>>> type(_)
<class 'sage.structure.factorization.Factorization'>

>>> g = G([Integer(0),Integer(4),Integer(1),Integer(4)])
>>> g.word_problem()
([4 1]
 [4 0])^-1

Next we construct a more complicated element of the group from the generators:

sage: s,t = G.0, G.1
sage: a = (s * t * s); b = a.word_problem(); b
([2 0]
 [0 1]) *
([4 1]
 [4 0]) *
([2 0]
 [0 1])
sage: flatten(b)
[
[2 0]     [4 1]     [2 0]
[0 1], 1, [4 0], 1, [0 1], 1
]
sage: b.prod() == a
True
>>> from sage.all import *
>>> s,t = G.gen(0), G.gen(1)
>>> a = (s * t * s); b = a.word_problem(); b
([2 0]
 [0 1]) *
([4 1]
 [4 0]) *
([2 0]
 [0 1])
>>> flatten(b)
[
[2 0]     [4 1]     [2 0]
[0 1], 1, [4 0], 1, [0 1], 1
]
>>> b.prod() == a
True

We solve the word problem using some different generators:

sage: s = G([2,0,0,1]); t = G([1,1,0,1]); u = G([0,-1,1,0])
sage: a.word_problem([s,t,u])
([2 0]
 [0 1])^-1 *
([1 1]
 [0 1])^-1 *
([0 4]
 [1 0]) *
([2 0]
 [0 1])^-1
>>> from sage.all import *
>>> s = G([Integer(2),Integer(0),Integer(0),Integer(1)]); t = G([Integer(1),Integer(1),Integer(0),Integer(1)]); u = G([Integer(0),-Integer(1),Integer(1),Integer(0)])
>>> a.word_problem([s,t,u])
([2 0]
 [0 1])^-1 *
([1 1]
 [0 1])^-1 *
([0 4]
 [1 0]) *
([2 0]
 [0 1])^-1

We try some elements that don’t actually generate the group:

sage: a.word_problem([t,u])
Traceback (most recent call last):
...
ValueError: word problem has no solution
>>> from sage.all import *
>>> a.word_problem([t,u])
Traceback (most recent call last):
...
ValueError: word problem has no solution

AUTHORS:

  • David Joyner and William Stein

  • David Loeffler (2010): fixed some bugs

  • Volker Braun (2013): LibGAP