def __init__(self, degree, ring): """ Initialize ``self``. INPUT: - ``degree`` -- integer. The degree of the affine group, that is, the dimension of the affine space the group is acting on naturally. - ``ring`` -- a ring. The base ring of the affine space. EXAMPLES:: sage: Aff6 = AffineGroup(6, QQ) sage: Aff6 == Aff6 True sage: Aff6 != Aff6 False TESTS:: sage: G = AffineGroup(2, GF(5)); G Affine Group of degree 2 over Finite Field of size 5 sage: TestSuite(G).run() """ self._degree = degree Group.__init__(self, base=ring)
def __init__(self, generator_names, libgap_free_group=None): """ Python constructor. INPUT: - ``generator_names`` -- a tuple of strings. The names of the generators. - ``libgap_free_group`` -- a LibGAP free group or ``None`` (default). The LibGAP free group to wrap. If ``None``, a suitable group will be constructed. TESTS:: sage: G.<a,b> = FreeGroup() # indirect doctest sage: G Free Group on generators {a, b} sage: G.variable_names() ('a', 'b') """ n = len(generator_names) self._assign_names(generator_names) if libgap_free_group is None: libgap_free_group = libgap.FreeGroup(generator_names) ParentLibGAP.__init__(self, libgap_free_group) Group.__init__(self)
def __init__(self, free_group, relations): """ The Python constructor TESTS:: sage: G = FreeGroup('a, b') sage: H = G / (G([1]), G([2])^3) sage: H Finitely presented group < a, b | a, b^3 > sage: F = FreeGroup('a, b') sage: J = F / (F([1]), F([2, 2, 2])) sage: J is H True sage: TestSuite(H).run() sage: TestSuite(J).run() """ from sage.groups.free_group import is_FreeGroup assert is_FreeGroup(free_group) assert isinstance(relations, tuple) self._free_group = free_group self._relations = relations self._assign_names(free_group.variable_names()) parent_gap = free_group.gap() / libgap([ rel.gap() for rel in relations]) ParentLibGAP.__init__(self, parent_gap) Group.__init__(self)
def __init__(self, surface, base): if not surface.is_finite(): raise ValueError("the method only work for finite surfaces") self._s = surface self._b = base Group.__init__(self, category=Groups().Infinite())
def __init__(self, degree, ring): """ Initialize ``self``. INPUT: - ``degree`` -- integer. The degree of the affine group, that is, the dimension of the affine space the group is acting on naturally. - ``ring`` -- a ring. The base ring of the affine space. EXAMPLES:: sage: Aff6 = AffineGroup(6, QQ) sage: Aff6 == Aff6 True sage: Aff6 != Aff6 False TESTS:: sage: G = AffineGroup(2, GF(5)); G Affine Group of degree 2 over Finite Field of size 5 sage: TestSuite(G).run() """ self._degree = degree Group.__init__(self, base=ring)
def __init__(self, free_group, relations): """ The Python constructor. TESTS:: sage: G = FreeGroup('a, b') sage: H = G / (G([1]), G([2])^3) sage: H Finitely presented group < a, b | a, b^3 > sage: F = FreeGroup('a, b') sage: J = F / (F([1]), F([2, 2, 2])) sage: J is H True sage: TestSuite(H).run() sage: TestSuite(J).run() """ from sage.groups.free_group import is_FreeGroup assert is_FreeGroup(free_group) assert isinstance(relations, tuple) self._free_group = free_group self._relations = relations self._assign_names(free_group.variable_names()) parent_gap = free_group.gap() / libgap( [rel.gap() for rel in relations]) ParentLibGAP.__init__(self, parent_gap) Group.__init__(self)
def __init__(self, surface, base): if not surface.is_finite(): raise ValueError("the method only work for finite surfaces") self._s = surface self._b = base Group.__init__(self, category=Groups().Infinite())
def __init__(self, generator_names, libgap_free_group=None): """ Python constructor. INPUT: - ``generator_names`` -- a tuple of strings. The names of the generators. - ``libgap_free_group`` -- a LibGAP free group or ``None`` (default). The LibGAP free group to wrap. If ``None``, a suitable group will be constructed. TESTS:: sage: G.<a,b> = FreeGroup() # indirect doctest sage: G Free Group on generators {a, b} sage: G.variable_names() ('a', 'b') """ n = len(generator_names) self._assign_names(generator_names) if libgap_free_group is None: libgap_free_group = libgap.FreeGroup(generator_names) ParentLibGAP.__init__(self, libgap_free_group) Group.__init__(self)
def __init__(self, base_ring): r""" TESTS:: sage: from flatsurf.geometry.similarity import SimilarityGroup sage: TestSuite(SimilarityGroup(QQ)).run() sage: TestSuite(SimilarityGroup(AA)).run() """ self._ring = base_ring Group.__init__(self, category=Groups().Infinite())
def __init__(self, base_field): r""" TESTS:: sage: from flatsurf.geometry.similarity import SimilarityGroup sage: TestSuite(SimilarityGroup(QQ)).run() # not tested sage: TestSuite(SimilarityGroup(AA)).run() # not tested """ self._field = base_field # The vector space of vectors Group.__init__(self, category=Groups().Infinite())
def __init__(self, base_field): r""" TESTS:: sage: from flatsurf.geometry.similarity import SimilarityGroup sage: TestSuite(SimilarityGroup(QQ)).run() sage: TestSuite(SimilarityGroup(AA)).run() """ self._field = base_field # The vector space of vectors Group.__init__(self, category=Groups().Infinite())
def __init__(self, domain, gap_group, category, ambient=None): """ Constructor. EXAMPLES:: sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap sage: G = AbelianGroupGap([2,3,4,5]) sage: G.aut() Full group of automorphisms of Abelian group with gap, generator orders (2, 3, 4, 5) """ self._domain = domain n = len(self._domain.gens()) self._covering_matrix_ring = MatrixSpace(ZZ, n) ParentLibGAP.__init__(self, gap_group, ambient=ambient) Group.__init__(self, category=category)
def __init__(self, pos, neg=None): r""" INPUT: - ``pos`` - the alphabet of positive letters - ``neg`` - the alphabet of negative letters - ``bij`` - bijection between positive and negative letters """ Group.__init__(self, category=(Groups(),InfiniteEnumeratedSets())) self._pos = pos self._neg = neg self._invert = {} self._invert.update(zip(pos,neg)) self._invert.update(zip(neg,pos)) self._alphabet = build_alphabet(pos.list() + neg.list())
def __init__(self, degree, ring): """ Initialize ``self``. INPUT: - ``degree`` -- integer. The degree of the affine group, that is, the dimension of the affine space the group is acting on naturally. - ``ring`` -- a ring. The base ring of the affine space. EXAMPLES:: sage: Aff6 = AffineGroup(6, QQ) sage: Aff6 == Aff6 True sage: Aff6 != Aff6 False TESTS:: sage: G = AffineGroup(2, GF(5)); G Affine Group of degree 2 over Finite Field of size 5 sage: TestSuite(G).run() sage: G.category() Category of finite groups sage: Aff6 = AffineGroup(6, QQ) sage: Aff6.category() Category of infinite groups """ self._degree = degree cat = Groups() if degree == 0 or ring in Rings().Finite(): cat = cat.Finite() elif ring in Rings().Infinite(): cat = cat.Infinite() self._GL = GL(degree, ring) Group.__init__(self, base=ring, category=cat)
def __init__(self, *args, **kwds): """ Group interface for LibGAP-based groups. INPUT: Same as :class:`~sage.groups.libgap_wrapper.ParentLibGAP`. TESTS:: sage: F.<a,b> = FreeGroup() sage: G_gap = libgap.Group([ (a*b^2).gap() ]) sage: from sage.groups.libgap_group import GroupLibGAP sage: G = GroupLibGAP(G_gap); G Group([ a*b^2 ]) sage: g = G.gen(0); g a*b^2 sage: TestSuite(G).run(skip=['_test_pickling', '_test_elements']) sage: TestSuite(g).run(skip=['_test_pickling']) """ ParentLibGAP.__init__(self, *args, **kwds) Group.__init__(self)
def __init__(self, *args, **kwds): """ Group interface for LibGAP-based groups. INPUT: Same as :class:`~sage.groups.libgap_wrapper.ParentLibGAP`. TESTS:: sage: F.<a,b> = FreeGroup() sage: G_gap = libgap.Group([ (a*b^2).gap() ]) sage: from sage.groups.libgap_group import GroupLibGAP sage: G = GroupLibGAP(G_gap); G Group([ a*b^2 ]) sage: g = G.gen(0); g a*b^2 sage: TestSuite(G).run(skip=['_test_pickling', '_test_elements']) sage: TestSuite(g).run(skip=['_test_pickling']) """ ParentLibGAP.__init__(self, *args, **kwds) Group.__init__(self)
def __call__(self, *args, **kwds): r""" Call method. This exists *purely* to override the old-fashioned behaviour of the parent AbelianGroup class and ensure that :meth:`element_constructor` gets called. EXAMPLE:: sage: K.<b> = NumberField(x^2 + 389) sage: C = K.class_group() sage: C(K.ideal(b)) Trivial principal fractional ideal class """ return Group.__call__(self, *args, **kwds)
def __call__(self, *args, **kwds): r""" Call method. This exists *purely* to override the old-fashioned behaviour of the parent AbelianGroup class and ensure that :meth:`element_constructor` gets called. EXAMPLE:: sage: K.<b> = NumberField(x^2 + 389) sage: C = K.class_group() sage: C(K.ideal(b)) Trivial principal fractional ideal class """ return Group.__call__(self, *args, **kwds)
def __call__(self, *args, **kwds): r""" Call method. EXAMPLES:: sage: K.<a> = QuadraticField(-14) sage: I = K.ideal(2,a) sage: S = (I,) sage: CS = K.S_class_group(S) sage: J = K.ideal(7,a) sage: G = K.ideal(3,a+1) sage: CS(I) Trivial S-ideal class sage: CS(J) Trivial S-ideal class sage: CS(G) Fractional S-ideal class (3, a + 1) """ return Group.__call__(self, *args, **kwds)
def __call__(self, *args, **kwds): r""" Call method. EXAMPLES:: sage: K.<a> = QuadraticField(-14) sage: I = K.ideal(2,a) sage: S = (I,) sage: CS = K.S_class_group(S) sage: J = K.ideal(7,a) sage: G = K.ideal(3,a+1) sage: CS(I) Trivial S-ideal class sage: CS(J) Trivial S-ideal class sage: CS(G) Fractional S-ideal class (3, a + 1) """ return Group.__call__(self, *args, **kwds)
def __init__(self): Group.__init__(self, category=Groups().Infinite())
def __init__(self, base_field): self._f=base_field # The vector space of vectors self._vs = VectorSpace(self._f,2) Group.__init__(self, category=Groups().Infinite())
def __init__(self): Group.__init__(self, category=Groups().Infinite())