code
stringlengths
17
6.64M
class VertexOrder(EdgeSelection): def __init__(self, order): '\n EXAMPLES::\n\n sage: from sage.graphs.tutte_polynomial import VertexOrder\n sage: A = VertexOrder([4,6,3,2,1,7])\n sage: A.order\n [4, 6, 3, 2, 1, 7]\n sage: A.inverse_order\n ...
class MinimizeSingleDegree(EdgeSelection): def __call__(self, graph): '\n EXAMPLES::\n\n sage: from sage.graphs.tutte_polynomial import MinimizeSingleDegree\n sage: G = graphs.PathGraph(6)\n sage: MinimizeSingleDegree()(G)\n (0, 1, None)\n ' ...
class MinimizeDegree(EdgeSelection): def __call__(self, graph): '\n EXAMPLES::\n\n sage: from sage.graphs.tutte_polynomial import MinimizeDegree\n sage: G = graphs.PathGraph(6)\n sage: MinimizeDegree()(G)\n (0, 1, None)\n ' degrees = dict(...
class MaximizeDegree(EdgeSelection): def __call__(self, graph): '\n EXAMPLES::\n\n sage: from sage.graphs.tutte_polynomial import MaximizeDegree\n sage: G = graphs.PathGraph(6)\n sage: MaximizeDegree()(G)\n (1, 2, None)\n ' degrees = dict(...
def _cache_key(G): '\n Return the key used to cache the result for the graph G\n\n This is used by the decorator :func:`_cached`.\n\n EXAMPLES::\n\n sage: from sage.graphs.tutte_polynomial import _cache_key\n sage: G = graphs.DiamondGraph()\n sage: print(_cache_key(G))\n ((0, ...
def _cached(func): '\n Wrapper used to cache results of the function `func`\n\n This uses the function :func:`_cache_key`.\n\n EXAMPLES::\n\n sage: from sage.graphs.tutte_polynomial import tutte_polynomial\n sage: G = graphs.PetersenGraph()\n sage: T = tutte_polynomial(G) #indirect ...
@_cached def tutte_polynomial(G, edge_selector=None, cache=None): "\n Return the Tutte polynomial of the graph `G`.\n\n INPUT:\n\n - ``edge_selector`` (optional; method) this argument allows the user\n to specify his own heuristic for selecting edges used in the deletion\n contraction recurrenc...
@_cached def _tutte_polynomial_internal(G, x, y, edge_selector, cache=None): '\n Does the recursive computation of the Tutte polynomial.\n\n INPUT:\n\n - ``G`` -- the graph\n - ``x,y`` -- the variables `x,y` respectively\n - ``edge_selector`` -- the heuristic for selecting edges used in the\n ...
class AbelianGroupAutomorphism(ElementLibGAP): '\n Automorphisms of abelian groups with gap.\n\n INPUT:\n\n - ``x`` -- a libgap element\n - ``parent`` -- the parent :class:`~AbelianGroupAutomorphismGroup_gap`\n - ``check`` -- bool (default:True) checks if ``x`` is an element\n of the group\n\n...
class AbelianGroupAutomorphismGroup_gap(CachedRepresentation, GroupMixinLibGAP, Group, ParentLibGAP): '\n Base class for groups of automorphisms of abelian groups.\n\n Do not construct this directly.\n\n INPUT:\n\n - ``domain`` -- :class:`~sage.groups.abelian_gps.abelian_group_gap.AbelianGroup_gap`\n...
class AbelianGroupAutomorphismGroup(AbelianGroupAutomorphismGroup_gap): '\n The full automorphism group of a finite abelian group.\n\n INPUT:\n\n - ``AbelianGroupGap`` -- an instance of\n :class:`~sage.groups.abelian_gps.abelian_group_gap.AbelianGroup_gap`\n\n EXAMPLES::\n\n sage: from sag...
class AbelianGroupAutomorphismGroup_subgroup(AbelianGroupAutomorphismGroup_gap): '\n Groups of automorphisms of abelian groups.\n\n They are subgroups of the full automorphism group.\n\n .. NOTE::\n\n Do not construct this class directly; instead use\n :meth:`sage.groups.abelian_gps.abelian...
def word_problem(words, g, verbose=False): "\n G and H are abelian, g in G, H is a subgroup of G generated by a\n list (words) of elements of G. If g is in H, return the expression\n for g as a word in the elements of (words).\n\n The 'word problem' for a finite abelian group G boils down to the\n ...
def _normalize(n, gens_orders=None, names='f'): "\n Helper function for :func:`AbelianGroup`. Beat some sense into the\n arguments.\n\n This function is also used by some descendents of\n :class:`AbelianGroup_class`.\n\n INPUT:\n\n See :func:`AbelianGroup`\n\n OUTPUT:\n\n Unique data for d...
def AbelianGroup(n, gens_orders=None, names='f'): '\n Create the multiplicative abelian group in `n` generators\n with given orders of generators (which need not be prime powers).\n\n INPUT:\n\n - ``n`` -- integer (optional). If not specified, will be derived\n from ``gens_orders``.\n\n - ``g...
def is_AbelianGroup(x): '\n Return True if ``x`` is an Abelian group.\n\n EXAMPLES::\n\n sage: from sage.groups.abelian_gps.abelian_group import is_AbelianGroup\n sage: F = AbelianGroup(5,[5,5,7,8,9], names=list("abcde")); F\n Multiplicative Abelian group isomorphic to C5 x C5 x C7 x C8...
class AbelianGroup_class(UniqueRepresentation, AbelianGroupBase): '\n The parent for Abelian groups with chosen generator orders.\n\n .. warning::\n\n You should use :func:`AbelianGroup` to construct Abelian\n groups and not instantiate this class directly.\n\n INPUT:\n\n - ``generator_o...
class AbelianGroup_subgroup(AbelianGroup_class): '\n Subgroup subclass of AbelianGroup_class, so instance methods are\n inherited.\n\n .. TODO::\n\n There should be a way to coerce an element of a subgroup\n into the ambient group.\n ' def __init__(self, ambient, gens, names='f', ca...
def is_AbelianGroupElement(x): "\n Return true if x is an abelian group element, i.e., an element of\n type AbelianGroupElement.\n\n EXAMPLES: Though the integer 3 is in the integers, and the integers\n have an abelian group structure, 3 is not an AbelianGroupElement::\n\n sage: from sage.group...
class AbelianGroupElement(AbelianGroupElementBase): "\n Elements of an\n :class:`~sage.groups.abelian_gps.abelian_group.AbelianGroup`\n\n INPUT:\n\n - ``x`` -- list/tuple/iterable of integers (the element vector)\n\n - ``parent`` -- the parent\n :class:`~sage.groups.abelian_gps.abelian_group.A...
class AbelianGroupElement_gap(ElementLibGAP): '\n An element of an abelian group via libgap.\n\n EXAMPLES::\n\n sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap\n sage: G = AbelianGroupGap([3,6])\n sage: G.gens()\n (f1, f2)\n ' def __init__(self...
class AbelianGroupElement_polycyclic(AbelianGroupElement_gap): '\n An element of an abelian group using the GAP package ``Polycyclic``.\n\n TESTS::\n\n sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap\n sage: G = AbelianGroupGap([4,7,0]) # optional - gap_pac...
class AbelianGroup_gap(UniqueRepresentation, GroupMixinLibGAP, ParentLibGAP, AbelianGroupBase): '\n Finitely generated abelian groups implemented in GAP.\n\n Needs the gap package ``Polycyclic`` in case the group is infinite.\n\n INPUT:\n\n - ``G`` -- a GAP group\n - ``category`` -- a category\n ...
class AbelianGroupGap(AbelianGroup_gap): '\n Abelian groups implemented using GAP.\n\n INPUT:\n\n - ``generator_orders`` -- a list of nonnegative integers where `0`\n gives a factor isomorphic to `\\ZZ`\n\n OUTPUT:\n\n - an abelian group\n\n EXAMPLES::\n\n sage: from sage.groups.abel...
class AbelianGroupSubgroup_gap(AbelianGroup_gap): '\n Subgroups of abelian groups with GAP.\n\n INPUT:\n\n - ``ambient`` -- the ambient group\n - ``gens`` -- generators of the subgroup\n\n .. NOTE::\n\n Do not construct this class directly. Instead use\n :meth:`~sage.groups.abelian_gr...
class AbelianGroupQuotient_gap(AbelianGroup_gap): '\n Quotients of abelian groups by a subgroup.\n\n .. NOTE::\n\n Do not call this directly. Instead use :meth:`quotient`.\n\n EXAMPLES::\n\n sage: from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap\n sage: A = Abeli...
def is_AbelianGroupMorphism(f): return isinstance(f, AbelianGroupMorphism)
class AbelianGroupMap(Morphism): '\n A set-theoretic map between AbelianGroups.\n ' def __init__(self, parent): '\n The Python constructor.\n ' Morphism.__init__(self, parent) def _repr_type(self): return 'AbelianGroup'
class AbelianGroupMorphism(Morphism): '\n Some python code for wrapping GAP\'s GroupHomomorphismByImages\n function for abelian groups. Returns "fail" if gens does not\n generate self or if the map does not extend to a group\n homomorphism, self - other.\n\n EXAMPLES::\n\n sage: G = AbelianG...
def is_DualAbelianGroup(x): '\n Return True if `x` is the dual group of an abelian group.\n\n EXAMPLES::\n\n sage: from sage.groups.abelian_gps.dual_abelian_group import is_DualAbelianGroup\n sage: F = AbelianGroup(5,[3,5,7,8,9], names=list("abcde"))\n sage: Fd = F.dual_group()\n ...
class DualAbelianGroup_class(UniqueRepresentation, AbelianGroupBase): '\n Dual of abelian group.\n\n EXAMPLES::\n\n sage: F = AbelianGroup(5,[3,5,7,8,9], names="abcde")\n sage: F.dual_group()\n Dual of Abelian Group isomorphic to Z/3Z x Z/5Z x Z/7Z x Z/8Z x Z/9Z\n over Cyclotomic...
def is_DualAbelianGroupElement(x) -> bool: '\n Test whether ``x`` is a dual Abelian group element.\n\n INPUT:\n\n - ``x`` -- anything\n\n OUTPUT:\n\n Boolean\n\n EXAMPLES::\n\n sage: from sage.groups.abelian_gps.dual_abelian_group import is_DualAbelianGroupElement\n sage: F = Abeli...
class DualAbelianGroupElement(AbelianGroupElementBase): '\n Base class for abelian group elements\n ' def __call__(self, g): '\n Evaluate ``self`` on a group element ``g``.\n\n OUTPUT:\n\n An element in\n :meth:`~sage.groups.abelian_gps.dual_abelian_group.DualAbelian...
class AbelianGroupElementBase(MultiplicativeGroupElement): '\n Base class for abelian group elements\n\n The group element is defined by a tuple whose ``i``-th entry is an\n integer in the range from 0 (inclusively) to ``G.gen(i).order()``\n (exclusively) if the `i`-th generator is of finite order, an...
def AbelianGroupWithValues(values, n, gens_orders=None, names='f', check=False, values_group=None): '\n Construct an Abelian group with values associated to the generators.\n\n INPUT:\n\n - ``values`` -- a list/tuple/iterable of values that you want to\n associate to the generators.\n\n - ``n`` -...
class AbelianGroupWithValuesEmbedding(Morphism): '\n The morphism embedding the Abelian group with values in its values group.\n\n INPUT:\n\n - ``domain`` -- a :class:`AbelianGroupWithValues_class`\n\n - ``codomain`` -- the values group (need not be in the category of\n groups, e.g. symbolic ring...
class AbelianGroupWithValuesElement(AbelianGroupElement): '\n An element of an Abelian group with values assigned to generators.\n\n INPUT:\n\n - ``exponents`` -- tuple of integers. The exponent vector defining\n the group element.\n\n - ``parent`` -- the parent.\n\n - ``value`` -- the value a...
class AbelianGroupWithValues_class(AbelianGroup_class): '\n The class of an Abelian group with values associated to the generator.\n\n INPUT:\n\n - ``generator_orders`` -- tuple of integers. The orders of the\n generators.\n\n - ``names`` -- string or list of strings. The names for the generators...
def AdditiveAbelianGroup(invs, remember_generators=True): '\n Construct a finitely-generated additive abelian group.\n\n INPUT:\n\n - ``invs`` (list of integers): the invariants.\n These should all be greater than or equal to zero.\n\n - ``remember_generators`` (boolean): whether or not to fix a ...
def cover_and_relations_from_invariants(invs): '\n A utility function to construct modules required to initialize the super class.\n\n Given a list of integers, this routine constructs the obvious pair of\n free modules such that the quotient of the two free modules over `\\ZZ`\n is naturally isomorph...
class AdditiveAbelianGroupElement(FGP_Element): '\n An element of an :class:`AdditiveAbelianGroup_class`.\n ' def _hermite_lift(self): '\n This gives a certain canonical lifting of elements of this group\n (represented as a quotient `G/H` of free abelian groups) to `G`, using\n ...
class AdditiveAbelianGroup_class(FGP_Module_class, AbelianGroup): '\n An additive abelian group, implemented using the `\\ZZ`-module machinery.\n\n INPUT:\n\n - ``cover`` -- the covering group as `\\ZZ`-module.\n\n - ``relations`` -- the relations as submodule of ``cover``.\n ' Element = Additi...
class AdditiveAbelianGroup_fixed_gens(AdditiveAbelianGroup_class): '\n A variant which fixes a set of generators, which need not be in Smith form\n (or indeed independent).\n ' def __init__(self, cover, rels, gens): '\n Standard initialisation function\n\n EXAMPLES::\n\n ...
class UnwrappingMorphism(Morphism): '\n The embedding into the ambient group. Used by the coercion framework.\n ' def __init__(self, domain): "\n EXAMPLES::\n\n sage: G = AdditiveAbelianGroupWrapper(QQbar, # needs sage.rings.number_field\n ...
class AdditiveAbelianGroupWrapperElement(addgp.AdditiveAbelianGroupElement): '\n An element of an :class:`AdditiveAbelianGroupWrapper`.\n ' def __init__(self, parent, vector, element=None, check=False): '\n EXAMPLES::\n\n sage: from sage.groups.additive_abelian.additive_abelia...
class AdditiveAbelianGroupWrapper(addgp.AdditiveAbelianGroup_fixed_gens): '\n This class is used to wrap a subgroup of an existing\n additive abelian group as a new additive abelian group.\n\n EXAMPLES::\n\n sage: G2 = AdditiveAbelianGroupWrapper(Zmod(42), [2], [21]); G2\n Additive abelian ...
def _discrete_log_pgroup(p, vals, aa, b): "\n Attempt to express an element of p-power order in terms of\n generators of a nontrivial p-subgroup of this group.\n\n Used as a subroutine in :meth:`discrete_log`.\n\n ALGORITHM:\n\n This implements a basic version of the recursive algorithm\n from [...
def _expand_basis_pgroup(p, alphas, vals, beta, h, rel): '\n Given a basis of a `p`-subgroup of a finite abelian group\n and an element lying outside the subgroup, extend the basis\n to the subgroup spanned jointly by the original subgroup and\n the new element.\n\n Used as a subroutine in :func:`b...
def basis_from_generators(gens, ords=None): "\n Given a generating set of some finite abelian group\n (additively written), compute and return a basis of\n the group.\n\n .. NOTE::\n\n A *basis* of a finite abelian group is a generating\n set `\\{g_1, \\ldots, g_n\\}` such that each elem...
class QmodnZ(Parent, UniqueRepresentation): '\n The ``QmodnZ`` class represents the abelian group `\\Q/n\\Z`.\n\n INPUT:\n\n The constructor may be called in any of the following ways.\n\n #. ``QmodnZ(n)``, where\n\n - `n` -- a rational number (including 0 or negative rational numbers).\n\n ...
class QmodnZ_Element(AdditiveGroupElement): '\n The ``QmodnZ_Element`` class represents an element of the abelian\n group `\\Q/n\\Z`.\n\n INPUT:\n\n - ``q`` -- a rational number.\n\n - ``parent`` -- the parent abelian group `\\Q/n\\Z`.\n\n OUTPUT:\n\n The element `q` of abelian group `\\Q/n\\...
class AffineGroup(UniqueRepresentation, Group): "\n An affine group.\n\n The affine group `\\mathrm{Aff}(A)` (or general affine group) of an affine\n space `A` is the group of all invertible affine transformations from the\n space into itself.\n\n If we let `A_V` be the affine space of a vector spa...
class EuclideanGroup(AffineGroup): "\n A Euclidean group.\n\n The Euclidean group `E(A)` (or general affine group) of an affine\n space `A` is the group of all invertible affine transformations from\n the space into itself preserving the Euclidean metric.\n\n If we let `A_V` be the affine space of ...
class AffineGroupElement(MultiplicativeGroupElement): "\n An affine group element.\n\n INPUT:\n\n - ``A`` -- an invertible matrix, or something defining a\n matrix if ``convert==True``.\n\n - ``b``-- a vector, or something defining a vector if\n ``convert==True`` (default: ``0``, defining th...
class ArtinGroupElement(FinitelyPresentedGroupElement): "\n An element of an Artin group.\n\n It is a particular case of element of a finitely presented group.\n\n EXAMPLES::\n\n sage: # needs sage.rings.number_field\n sage: A.<s1,s2,s3> = ArtinGroup(['B',3])\n sage: A\n Artin...
class FiniteTypeArtinGroupElement(ArtinGroupElement): '\n An element of a finite-type Artin group.\n ' def _richcmp_(self, other, op): "\n Compare ``self`` and ``other``.\n\n TESTS::\n\n sage: # needs sage.rings.number_field\n sage: A = ArtinGroup(['B',3])\n ...
class ArtinGroup(FinitelyPresentedGroup): "\n An Artin group.\n\n Fix an index set `I`. Let `M = (m_{ij})_{i,j \\in I}` be a\n :class:`Coxeter matrix\n <sage.combinat.root_system.coxeter_matrix.CoxeterMatrix>`.\n An *Artin group* is a group `A_M` that has a presentation\n given by generators `\\...
class FiniteTypeArtinGroup(ArtinGroup): "\n A finite-type Artin group.\n\n An Artin group is *finite-type* or *spherical* if the corresponding\n Coxeter group is finite. Finite type Artin groups are known to be\n torsion free, have a Garside structure given by `\\Delta` (see\n :meth:`delta`) and ha...
class CactusGroup(UniqueRepresentation, Group): '\n The cactus group.\n\n The `n`-fruit cactus group `J_n` is the group generated by `s_{pq}`\n for `1 \\leq p < q \\leq n` with relations:\n\n - `s_{pq}^2 = 1`\n - `s_{pq} s_{kl} = s_{kl} s_{pq}` if the intervals `[p, q]` and `[k, l]`\n are disj...
class PureCactusGroup(KernelSubgroup): '\n The pure cactus group.\n\n The *pure cactus group* `PJ_n` is the kernel of the natural\n surjection of the cactus group `J_n` onto the symmetric group\n `S_n`. In particular, we have the following (non-split) exact sequence:\n\n .. MATH::\n\n 1 \\lo...
def ClassFunction(group, values): '\n Construct a class function.\n\n INPUT:\n\n - ``group`` -- a group.\n\n - ``values`` -- list/tuple/iterable of numbers. The values of the\n class function on the conjugacy classes, in that order.\n\n\n EXAMPLES::\n\n sage: G = CyclicPermutationGroup(...
@richcmp_method class ClassFunction_gap(SageObject): "\n A wrapper of GAP's ClassFunction function.\n\n .. NOTE::\n\n It is *not* checked whether the given values describes a character,\n since GAP does not do this.\n\n EXAMPLES::\n\n sage: G = CyclicPermutationGroup(4)\n sage...
@richcmp_method class ClassFunction_libgap(SageObject): "\n A wrapper of GAP's ``ClassFunction`` function.\n\n .. NOTE::\n\n It is *not* checked whether the given values describes a character,\n since GAP does not do this.\n\n EXAMPLES::\n\n sage: G = SO(3,3)\n sage: values =...
class ConjugacyClass(Parent): '\n Generic conjugacy classes for elements in a group.\n\n This is the default fall-back implementation to be used whenever\n GAP cannot handle the group.\n\n EXAMPLES::\n\n sage: G = SymmetricGroup(4)\n sage: g = G((1,2,3,4))\n sage: ConjugacyClass(G...
class ConjugacyClassGAP(ConjugacyClass): '\n Class for a conjugacy class for groups defined over GAP.\n\n Intended for wrapping GAP methods on conjugacy classes.\n\n INPUT:\n\n - ``group`` -- the group in which the conjugacy class is taken\n\n - ``element`` -- the element generating the conjugacy c...
def _reduce_tietze(tietze_list): '\n Reduce the length of a list representing a cubic braid as much as it is\n easily possible using the second braid relation and degree reduction.\n\n EXAMPLES::\n\n sage: from sage.groups.cubic_braid import _reduce_tietze\n sage: _reduce_tietze((2, 2, -3, ...
def AssionGroupS(n=None, names='s'): "\n Construct cubic braid groups :class:`CubicBraidGroup` which have been\n investigated by J.Assion using the notation S(m). This function is a short hand cut\n for setting the construction arguments ``cbg_type=CubicBraidGroup.type.AssionS``\n and default ``names=...
def AssionGroupU(n=None, names='u'): "\n Construct cubic braid groups as instance of :class:`CubicBraidGroup` which have been\n investigated by J.Assion using the notation U(m). This function is a short hand cut\n for setting the construction arguments ``cbg_type=CubicBraidGroup.type.AssionU``\n and d...
class CubicBraidElement(FinitelyPresentedGroupElement): '\n Elements of cubic factor groups of the braid group.\n\n For more information see :class:`CubicBraidGroup`.\n\n EXAMPLES::\n\n sage: C4.<c1, c2, c3> = CubicBraidGroup(4); C4\n Cubic Braid group on 4 strands\n sage: ele1 = c1*...
class CubicBraidGroup(FinitelyPresentedGroup): "\n Factor groups of the Artin braid group mapping their generators to elements\n of order 3.\n\n These groups are implemented as a particular case of finitely presented\n groups similar to the :class:`BraidGroup_class`.\n\n A cubic braid group can be ...
class GroupMorphismWithGensImages(SetMorphism): '\n Class used for morphisms from finitely presented groups to\n other groups. It just adds the images of the generators at the\n end of the representation.\n\n EXAMPLES::\n\n sage: F = FreeGroup(3)\n sage: G = F / [F([1, 2, 3, 1, 2, 3]), F...
class FinitelyPresentedGroupElement(FreeGroupElement): "\n A wrapper of GAP's Finitely Presented Group elements.\n\n The elements are created by passing the Tietze list that determines them.\n\n EXAMPLES::\n\n sage: G = FreeGroup('a, b')\n sage: H = G / [G([1]), G([2, 2, 2])]\n sage:...
def wrap_FpGroup(libgap_fpgroup): "\n Wrap a GAP finitely presented group.\n\n This function changes the comparison method of\n ``libgap_free_group`` to comparison by Python ``id``. If you want\n to put the LibGAP free group into a container ``(set, dict)`` then you\n should understand the implicat...
class RewritingSystem(): "\n A class that wraps GAP's rewriting systems.\n\n A rewriting system is a set of rules that allow to transform\n one word in the group to an equivalent one.\n\n If the rewriting system is confluent, then the transformed\n word is a unique reduced form of the element of th...
class FinitelyPresentedGroup(GroupMixinLibGAP, UniqueRepresentation, Group, ParentLibGAP): "\n A class that wraps GAP's Finitely Presented Groups.\n\n .. WARNING::\n\n You should use\n :meth:`~sage.groups.free_group.FreeGroup_class.quotient` to\n construct finitely presented groups as q...
def CyclicPresentation(n): '\n Build cyclic group of order `n` as a finitely presented group.\n\n INPUT:\n\n - ``n`` -- The order of the cyclic presentation to be returned.\n\n OUTPUT:\n\n The cyclic group of order `n` as finite presentation.\n\n EXAMPLES::\n\n sage: groups.presentation.C...
def FinitelyGeneratedAbelianPresentation(int_list): "\n Return canonical presentation of finitely generated abelian group.\n\n INPUT:\n\n - ``int_list`` -- List of integers defining the group to be returned, the defining list\n is reduced to the invariants of the input list before generating the cor...
def FinitelyGeneratedHeisenbergPresentation(n=1, p=0): '\n Return a finite presentation of the Heisenberg group.\n\n The Heisenberg group is the group of `(n+2) \\times (n+2)` matrices\n over a ring `R` with diagonal elements equal to 1, first row and\n last column possibly nonzero, and all the other ...
def DihedralPresentation(n): '\n Build the Dihedral group of order `2n` as a finitely presented group.\n\n INPUT:\n\n - ``n`` -- The size of the set that `D_n` is acting on.\n\n OUTPUT:\n\n Dihedral group of order `2n`.\n\n EXAMPLES::\n\n sage: D = groups.presentation.Dihedral(7); D\n ...
def DiCyclicPresentation(n): '\n Build the dicyclic group of order `4n`, for `n \\geq 2`, as a finitely\n presented group.\n\n INPUT:\n\n - ``n`` -- positive integer, 2 or greater, determining the order of\n the group (`4n`).\n\n OUTPUT:\n\n The dicyclic group of order `4n` is defined by th...
def SymmetricPresentation(n): '\n Build the Symmetric group of order `n!` as a finitely presented group.\n\n INPUT:\n\n - ``n`` -- The size of the underlying set of arbitrary symbols being acted\n on by the Symmetric group of order `n!`.\n\n OUTPUT:\n\n Symmetric group as a finite presentation...
def QuaternionPresentation(): '\n Build the Quaternion group of order 8 as a finitely presented group.\n\n OUTPUT:\n\n Quaternion group as a finite presentation.\n\n EXAMPLES::\n\n sage: Q = groups.presentation.Quaternion(); Q\n Finitely presented group < a, b | a^4, b^2*a^-2, a*b*a*b^-1...
def AlternatingPresentation(n): '\n Build the Alternating group of order `n!/2` as a finitely presented group.\n\n INPUT:\n\n - ``n`` -- The size of the underlying set of arbitrary symbols being acted\n on by the Alternating group of order `n!/2`.\n\n OUTPUT:\n\n Alternating group as a finite ...
def KleinFourPresentation(): '\n Build the Klein group of order `4` as a finitely presented group.\n\n OUTPUT:\n\n Klein four group (`C_2 \\times C_2`) as a finitely presented group.\n\n EXAMPLES::\n\n sage: K = groups.presentation.KleinFour(); K\n Finitely presented group < a, b | a^2, ...
def BinaryDihedralPresentation(n): '\n Build a binary dihedral group of order `4n` as a finitely presented group.\n\n The binary dihedral group `BD_n` has the following presentation\n (note that there is a typo in [Sun2010]_):\n\n .. MATH::\n\n BD_n = \\langle x, y, z | x^2 = y^2 = z^n = x y z ...
def CactusPresentation(n): '\n Build the `n`-fruit cactus group as a finitely presented group.\n\n OUTPUT:\n\n Cactus group `J_n` as a finitely presented group.\n\n EXAMPLES::\n\n sage: J3 = groups.presentation.Cactus(3); J3 # needs sage.graphs\n Finite...
class FqfIsometry(AbelianGroupAutomorphism): '\n Isometry of a finite quadratic/bilinear form.\n\n INPUT:\n\n - ``parent`` -- the parent :class:`~FqfOrthogonalGroup`\n - ``x`` -- a libgap element\n - ``check`` -- bool (default: ``True``)\n\n EXAMPLES::\n\n sage: q = matrix.diagonal([2...
class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup): '\n Return a group of isometries of this torsion quadratic form.\n\n Do not call this class directly instead use\n :meth:`sage.modules.torsion_quadratic_module.orthogonal_group`.\n\n INPUT:\n\n - ``T`` -- a non degenerate torsion qua...
class ActionOnFqf(Action): '\n Action on a finite quadratic module.\n\n INPUT:\n\n - ``orthogonal_grp`` -- an instance of :class:`GroupOfIsometries`\n - ``fqf`` -- a torsion quadratic module\n - ``on_subquotient`` -- bool (default: ``False``)\n - ``is_left`` -- bool (default: ``False``)\n\n ...
def _isom_fqf(A, B=None): '\n Return isometries from `A` to `B`.\n\n INPUT:\n\n - ``A`` -- a torsion quadratic module\n - ``B`` -- (default: ``None``) a torsion quadratic module\n\n OUTPUT:\n\n A list of generators of the orthogonal group of A.\n If ``B`` is given returns instead a single iso...
def is_FreeGroup(x): "\n Test whether ``x`` is a :class:`FreeGroup_class`.\n\n INPUT:\n\n - ``x`` -- anything.\n\n OUTPUT:\n\n Boolean.\n\n EXAMPLES::\n\n sage: from sage.groups.free_group import is_FreeGroup\n sage: is_FreeGroup('a string') ...
def _lexi_gen(zeroes=False): "\n Return a generator object that produces variable names suitable for the\n generators of a free group.\n\n INPUT:\n\n - ``zeroes`` -- Boolean defaulting as ``False``. If ``True``, the\n integers appended to the output string begin at zero at the\n first iterat...
class FreeGroupElement(ElementLibGAP): "\n A wrapper of GAP's Free Group elements.\n\n INPUT:\n\n - ``x`` -- something that determines the group element. Either a\n :class:`~sage.libs.gap.element.GapElement` or the Tietze list\n (see :meth:`Tietze`) of the group element.\n\n - ``parent`` -- ...
def FreeGroup(n=None, names='x', index_set=None, abelian=False, **kwds): "\n Construct a Free Group.\n\n INPUT:\n\n - ``n`` -- integer or ``None`` (default). The number of\n generators. If not specified the ``names`` are counted.\n\n - ``names`` -- string or list/tuple/iterable of strings (defaul...
def wrap_FreeGroup(libgap_free_group): "\n Wrap a LibGAP free group.\n\n This function changes the comparison method of\n ``libgap_free_group`` to comparison by Python ``id``. If you want\n to put the LibGAP free group into a container (set, dict) then you\n should understand the implications of\n ...
class FreeGroup_class(UniqueRepresentation, Group, ParentLibGAP): "\n A class that wraps GAP's FreeGroup\n\n See :func:`FreeGroup` for details.\n\n TESTS::\n\n sage: G = FreeGroup('a, b')\n sage: TestSuite(G).run()\n sage: G.category()\n Category of infinite groups\n " ...
def _alg_key(self, algorithm=None, recompute=False): '\n Return a key for use in cached_method calls.\n\n If recompute is false, will cache using ``None`` as the key, so no recomputation will be done.\n\n If recompute is true, will cache by algorithm, yielding a recomputation for each different algorithm...
class _GMixin(): '\n This class provides some methods for Galois groups to be used for both permutation groups\n and abelian groups, subgroups and full Galois groups.\n\n It is just intended to provide common functionality between various different Galois group classes.\n ' @lazy_attribute de...
class _GaloisMixin(_GMixin): '\n This class provides methods for Galois groups, allowing concrete instances\n to inherit from both permutation group and abelian group classes.\n ' @lazy_attribute def _field(self): '\n The top field, ie the field whose Galois closure elements of th...
class _SubGaloisMixin(_GMixin): '\n This class provides methods for subgroups of Galois groups, allowing concrete instances\n to inherit from both permutation group and abelian group classes.\n ' @lazy_attribute def _ambient_group(self): "\n The ambient Galois group of which this ...