EXAMPLES:
sage: GL(4,QQ)
General Linear Group of degree 4 over Rational Field
sage: GL(1,ZZ)
General Linear Group of degree 1 over Integer Ring
sage: GL(100,RR)
General Linear Group of degree 100 over Real Field with 53 bits of precision
sage: GL(3,GF(49,'a'))
General Linear Group of degree 3 over Finite Field in a of size 7^2
AUTHORS:
Return the general linear group of degree over the ring
.
Note
This group is also available via groups.matrix.GL().
EXAMPLES:
sage: G = GL(6,GF(5))
sage: G.order()
11064475422000000000000000
sage: G.base_ring()
Finite Field of size 5
sage: G.category()
Category of finite groups
sage: TestSuite(G).run()
sage: G = GL(6, QQ)
sage: G.category()
Category of groups
sage: TestSuite(G).run()
Here is the Cayley graph of (relatively small) finite General Linear Group:
sage: g = GL(2,3)
sage: d = g.cayley_graph(); d
Digraph on 48 vertices
sage: d.show(color_by_label=True, vertex_size=0.03, vertex_labels=False)
sage: d.show3d(color_by_label=True)
sage: F = GF(3); MS = MatrixSpace(F,2,2)
sage: gens = [MS([[0,1],[1,0]]),MS([[1,1],[0,1]])]
sage: G = MatrixGroup(gens)
sage: G.order()
48
sage: G.cardinality()
48
sage: H = GL(2,F)
sage: H.order()
48
sage: H == G # Do we really want this equality?
False
sage: H.as_matrix_group() == G
True
sage: H.gens()
[
[2 0]
[0 1],
[2 1]
[2 0]
]
TESTS:
sage: groups.matrix.GL(2, 3)
General Linear Group of degree 2 over Finite Field of size 3
Bases: sage.groups.matrix_gps.general_linear.GeneralLinearGroup_generic, sage.groups.matrix_gps.matrix_group.MatrixGroup_gap_finite_field
INPUT:
Return a random element of this group.
EXAMPLES:
sage: G = GL(4, GF(3))
sage: G.random_element() # random
[2 1 1 1]
[1 0 2 1]
[0 1 1 0]
[1 0 0 1]
sage: G.random_element() in G
True
ALGORITHM:
The random matrix is generated by rejection sampling: 1. Generate a random matrix 2. Check if is is invertible, if so return it 3. Go back to step 1
The expected number of iterations of this procedure is of
order where
is the size of the field. In all
cases, the expected number of iterations is less than 4.
Bases: sage.structure.unique_representation.UniqueRepresentation, sage.groups.matrix_gps.matrix_group.MatrixGroup_gap
TESTS:
sage: G6 = GL(6, QQ)
sage: G6 == G6
True
sage: G6 != G6 # check that #8695 is fixed.
False