Group homomorphisms for groups with a libGAP backend

EXAMPLES:

sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap
sage: A = AbelianGroupGap([2, 4])
sage: F.<a,b> = FreeGroup()
sage: f = F.hom([g for g in A.gens()])
sage: K = f.kernel()
sage: K
Group(<free, no generators known>)

AUTHORS:

  • Simon Brandhorst (2018-02-08): initial version
class sage.groups.libgap_morphism.GroupHomset_libgap(G, H, category=None, check=True)

Bases: sage.categories.homset.HomsetWithBase

Homsets of groups with a libgap backend.

Do not call this directly instead use Hom().

INPUT:

  • G – a libgap group
  • H – a libgap group
  • category – a category

OUTPUT:

The homset of two libgap groups.

EXAMPLES:

sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap
sage: A = AbelianGroupGap([2,4])
sage: H = A.Hom(A)
sage: H
Set of Morphisms from Abelian group with gap, generator orders (2, 4)
 to Abelian group with gap, generator orders (2, 4)
 in Category of finite enumerated commutative groups
Element

alias of GroupMorphism_libgap

class sage.groups.libgap_morphism.GroupMorphism_libgap(homset, imgs, check=True)

Bases: sage.categories.morphism.Morphism

Group morphism specified by the images of generators.

This wraps GAP’s GroupHomomorphismByImages function. Checking if the input defines a group homomorphism can be expensive if the group is large.

INPUT:

  • homset – the parent
  • imgs – a tuple of generators
  • check – (default: True) check if the images define a group homomorphism

EXAMPLES:

sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap
sage: A = AbelianGroupGap([2, 4])
sage: A.hom([g^2 for g in A.gens()])
Group endomorphism of Abelian group with gap, generator orders (2, 4)

Homomorphisms can be defined between different kinds of libGAP groups:

sage: G = MatrixGroup([Matrix(ZZ, 2, [0,1,1,0])])
sage: f = A.hom([G.0, G(1)])
sage: f
Group morphism:
From: Abelian group with gap, generator orders (2, 4)
To:   Matrix group over Integer Ring with 1 generators (
[0 1]
[1 0]
)
sage: G.<a,b> = FreeGroup()
sage: H = G / (G([1]), G([2])^3)
sage: f = G.hom(H.gens())
sage: f
Group morphism:
  From: Free Group on generators {a, b}
  To:   Finitely presented group < a, b | a, b^3 >
gap()

Return the underlying LibGAP group homomorphism.

EXAMPLES:

sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap
sage: A = AbelianGroupGap([2,4])
sage: f = A.hom([g^2 for g in A.gens()])
sage: f.gap()
[ f1, f2 ] -> [ <identity> of ..., f3 ]
image(J, *args, **kwds)

The image of an element or a subgroup.

INPUT:

  • J – a subgroup or an element of the domain of self

OUTPUT:

The image of J under self.

Note

pushforward is the method that is used when a map is called on anything that is not an element of its domain. For historical reasons, we keep the alias image() for this method.

EXAMPLES:

sage: G.<a,b> = FreeGroup()
sage: H = G / (G([1]), G([2])^3)
sage: f = G.hom(H.gens())
sage: S = G.subgroup([a.gap()])
sage: f.pushforward(S)
Group([ a ])
sage: x = f.image(a)
sage: x
a
sage: x.parent()
Finitely presented group < a, b | a, b^3 >
kernel()

Return the kernel of self.

EXAMPLES:

sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap
sage: A1 = AbelianGroupGap([6, 6])
sage: A2 = AbelianGroupGap([3, 3])
sage: f = A1.hom(A2.gens())
sage: f.kernel()
Subgroup of Abelian group with gap, generator orders (6, 6)
 generated by (f1*f2, f3*f4)
sage: f.kernel().order()
4
lift(h)

Return an element of the domain that maps to h.

EXAMPLES:

sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap
sage: A = AbelianGroupGap([2,4])
sage: f = A.hom([g^2 for g in A.gens()])
sage: a = A.gens()[1]
sage: f.lift(a^2)
f2

If the element is not in the image, we raise an error:

sage: f.lift(a)
Traceback (most recent call last):
...
ValueError: f2 is not an element of the image of Group endomorphism
 of Abelian group with gap, generator orders (2, 4)
preimage(S)

Return the preimage of the subgroup S.

INPUT:

  • S – a subgroup of this group

EXAMPLES:

sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap
sage: A = AbelianGroupGap([2,4])
sage: B = AbelianGroupGap([4])
sage: f = A.hom([B.one(), B.gen(0)^2])
sage: S = B.subgroup([B.one()])
sage: f.preimage(S) == f.kernel()
True
pushforward(J, *args, **kwds)

The image of an element or a subgroup.

INPUT:

  • J – a subgroup or an element of the domain of self

OUTPUT:

The image of J under self.

Note

pushforward is the method that is used when a map is called on anything that is not an element of its domain. For historical reasons, we keep the alias image() for this method.

EXAMPLES:

sage: G.<a,b> = FreeGroup()
sage: H = G / (G([1]), G([2])^3)
sage: f = G.hom(H.gens())
sage: S = G.subgroup([a.gap()])
sage: f.pushforward(S)
Group([ a ])
sage: x = f.image(a)
sage: x
a
sage: x.parent()
Finitely presented group < a, b | a, b^3 >