Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/groups/matrix_gps/homset.py
4066 views
1
"""
2
Matrix Group Homsets
3
4
AUTHORS:
5
6
- William Stein (2006-05-07): initial version
7
"""
8
9
##############################################################################
10
# Copyright (C) 2006 David Joyner and William Stein <[email protected]>
11
#
12
# Distributed under the terms of the GNU General Public License (GPL)
13
#
14
# The full text of the GPL is available at:
15
#
16
# http://www.gnu.org/licenses/
17
##############################################################################
18
19
from sage.groups.group_homset import GroupHomset_generic
20
from sage.categories.homset import HomsetWithBase
21
from sage.categories.all import Groups
22
GROUPS = Groups()
23
24
import matrix_group_morphism
25
26
def is_MatrixGroupHomset(x):
27
r"""
28
EXAMPLES::
29
30
sage: from sage.groups.matrix_gps.homset import is_MatrixGroupHomset
31
sage: is_MatrixGroupHomset(4)
32
False
33
34
::
35
36
sage: F = GF(5)
37
sage: gens = [matrix(F,2,[1,2, -1, 1]), matrix(F,2, [1,1, 0,1])]
38
sage: G = MatrixGroup(gens)
39
sage: from sage.groups.matrix_gps.homset import MatrixGroupHomset
40
sage: M = MatrixGroupHomset(G, G)
41
sage: is_MatrixGroupHomset(M)
42
True
43
"""
44
return isinstance(x, MatrixGroupHomset)
45
46
class MatrixGroupHomset(GroupHomset_generic):
47
r"""
48
Return the homset of two matrix groups.
49
50
INPUT:
51
52
- ``G`` - a matrix group
53
- ``H`` - a matrix group
54
55
OUTPUT:
56
57
The homset of two matrix groups.
58
59
EXAMPLES::
60
61
sage: F = GF(5)
62
sage: gens = [matrix(F,2,[1,2, -1, 1]), matrix(F,2, [1,1, 0,1])]
63
sage: G = MatrixGroup(gens)
64
sage: from sage.groups.matrix_gps.homset import MatrixGroupHomset
65
sage: MatrixGroupHomset(G, G)
66
Set of Homomorphisms from Matrix group over Finite Field of size 5 with 2 generators:
67
[[[1, 2], [4, 1]], [[1, 1], [0, 1]]] to Matrix group over Finite Field of size 5 with 2 generators:
68
[[[1, 2], [4, 1]], [[1, 1], [0, 1]]]
69
70
"""
71
def __init__(self, G, H):
72
r"""
73
See ``MatrixGroupHomset`` for full documentation.
74
75
EXAMPLES::
76
77
sage: F = GF(5)
78
sage: gens = [matrix(F,2,[1,2, -1, 1]), matrix(F,2, [1,1, 0,1])]
79
sage: G = MatrixGroup(gens)
80
sage: from sage.groups.matrix_gps.homset import MatrixGroupHomset
81
sage: MatrixGroupHomset(G, G)
82
Set of Homomorphisms from Matrix group over Finite Field of size 5 with 2 generators:
83
[[[1, 2], [4, 1]], [[1, 1], [0, 1]]] to Matrix group over Finite Field of size 5 with 2 generators:
84
[[[1, 2], [4, 1]], [[1, 1], [0, 1]]]
85
"""
86
HomsetWithBase.__init__(self, G, H, GROUPS, G.base_ring())
87
88
def __call__(self, im_gens, check=True):
89
"""
90
Return the homomorphism defined by images of generators.
91
92
INPUT:
93
94
- ``im_gens`` - iterable, the list of images of the generators of
95
the domain
96
- ``check`` - bool (optional, default: ``True``), whether to check
97
if images define a valid homomorphism
98
99
EXAMPLES::
100
101
sage: F = GF(5)
102
sage: gens = [matrix(F,2,[1,2, -1, 1]), matrix(F,2, [1,1, 0,1])]
103
sage: G = MatrixGroup(gens)
104
sage: from sage.groups.matrix_gps.homset import MatrixGroupHomset
105
sage: M = MatrixGroupHomset(G, G)
106
sage: M(gens)
107
Homomorphism : Matrix group over Finite Field of size 5 with 2 generators:
108
[[[1, 2], [4, 1]], [[1, 1], [0, 1]]] --> Matrix group over Finite Field of size 5 with 2 generators:
109
[[[1, 2], [4, 1]], [[1, 1], [0, 1]]]
110
111
"""
112
try:
113
return matrix_group_morphism.MatrixGroupMorphism_im_gens(self,
114
im_gens, check=check)
115
except (NotImplementedError, ValueError), err:
116
raise TypeError, "images (=%s) do not define a valid homomorphism"%im_gens
117
118
119
120