def _Hom_(self, G, cat=None): """ Construct a homset. INPUT: - ``G`` -- group. The codomain. - ``cat`` -- a category. Must be unset. OUTPUT: The set of homomorphisms from ``self`` to ``G``. EXAMPLES:: sage: MS = MatrixSpace(SR, 2, 2) sage: G = MatrixGroup([MS(1), MS([1,2,3,4])]) sage: G.Hom(G) Set of Homomorphisms from Matrix group over Symbolic Ring with 2 generators ( [1 0] [1 2] [0 1], [3 4] ) to Matrix group over Symbolic Ring with 2 generators ( [1 0] [1 2] [0 1], [3 4] ) """ if not (cat is None or (cat is G.category() and cat is self.category())): raise TypeError if not is_MatrixGroup(G): raise TypeError, "G (=%s) must be a matrix group."%G import homset return homset.MatrixGroupHomset(self, G)
def _Hom_(self, G, cat=None): if not (cat is None or (cat is G.category() and cat is self.category())): raise TypeError if not is_MatrixGroup(G): raise TypeError, "G (=%s) must be a matrix group." % G import homset return homset.MatrixGroupHomset(self, G)
def _Hom_(self, G, cat=None): """ Construct a homset. INPUT: - ``G`` -- group; the codomain - ``cat`` -- category; must be unset OUTPUT: The set of homomorphisms from ``self`` to ``G``. EXAMPLES:: sage: MS = MatrixSpace(SR, 2, 2) sage: G = MatrixGroup([MS(1), MS([1,2,3,4])]) sage: G.Hom(G) Set of Homomorphisms from Matrix group over Symbolic Ring with 2 generators ( [1 0] [1 2] [0 1], [3 4] ) to Matrix group over Symbolic Ring with 2 generators ( [1 0] [1 2] [0 1], [3 4] ) TESTS: Check that :trac:`19407` is fixed:: sage: G = GL(2, GF(2)) sage: H = GL(3, ZZ) sage: Hom(G, H) Set of Homomorphisms from General Linear Group of degree 2 over Finite Field of size 2 to General Linear Group of degree 3 over Integer Ring """ if not is_MatrixGroup(G): raise TypeError("G (=%s) must be a matrix group." % G) import homset return homset.MatrixGroupHomset(self, G, cat)