code
stringlengths
17
6.64M
def cubie_centers(label): '\n Return the cubie center list element given by ``label``.\n\n EXAMPLES::\n\n sage: from sage.groups.perm_gps.cubegroup import cubie_centers\n sage: cubie_centers(3)\n [0, 2, 2]\n ' return cubie_center_list[label]
def cubie_colors(label, state0): '\n Return the color of the cubie given by ``label`` at ``state0``.\n\n EXAMPLES::\n\n sage: from sage.groups.perm_gps.cubegroup import cubie_colors\n sage: G = CubeGroup()\n sage: g = G.parse("R*U")\n sage: cubie_colors(3, G.facets(g))\n [...
def plot3d_cubie(cnt, clrs): '\n Plot the front, up and right face of a cubie centered at cnt and\n rgbcolors given by clrs (in the order FUR).\n\n Type ``P.show()`` to view.\n\n EXAMPLES::\n\n sage: from sage.groups.perm_gps.cubegroup import plot3d_cubie, blue, red, green\n sage: clrF =...
class CubeGroup(PermutationGroup_generic): '\n A python class to help compute Rubik\'s cube group actions.\n\n .. NOTE::\n\n This group is also available via ``groups.permutation.RubiksCube()``.\n\n EXAMPLES:\n\n If G denotes the cube group then it may be regarded as a\n subgroup of ``Symmet...
def cubie_faces(): '\n This provides a map from the 6 faces of the 27 cubies to the 48\n facets of the larger cube.\n\n -1,-1,-1 is left, top, front\n\n EXAMPLES::\n\n sage: from sage.groups.perm_gps.cubegroup import cubie_faces\n sage: sorted(cubie_faces().items())\n [((-1, -1, -...
@richcmp_method class RubiksCube(SageObject): '\n The Rubik\'s cube (in a given state).\n\n EXAMPLES::\n\n sage: C = RubiksCube().move("R U R\'")\n sage: C.show3d() # needs sage.plot\n\n ::\n\n sage: C = RubiksCube("R*L")...
def load_hap(): '\n Load the GAP hap package into the default GAP interpreter interface.\n\n EXAMPLES::\n\n sage: sage.groups.perm_gps.permgroup.load_hap() # optional - gap_package_hap\n ' from sage.features.gap import GapPackage GapPackage('hap', spkg='gap_packages').require() ...
def hap_decorator(f): '\n A decorator for permutation group methods that require HAP. It\n checks to see that HAP is installed as well as checks that the\n argument ``p`` is either 0 or prime.\n\n EXAMPLES::\n\n sage: # optional - gap_package_hap\n sage: from sage.groups.perm_gps.permgr...
def direct_product_permgroups(P): '\n Takes the direct product of the permutation groups listed in ``P``.\n\n EXAMPLES::\n\n sage: G1 = AlternatingGroup([1,2,4,5])\n sage: G2 = AlternatingGroup([3,4,6,7])\n sage: D = direct_product_permgroups([G1,G2,G1])\n sage: D.order()\n ...
def from_gap_list(G, src): '\n Convert a string giving a list of GAP permutations into a list of\n elements of ``G``.\n\n EXAMPLES::\n\n sage: from sage.groups.perm_gps.permgroup import from_gap_list\n sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]])\n sage: L = from_gap_list(G,...
def PermutationGroup(gens=None, *args, **kwds): '\n Return the permutation group associated to `x` (typically a\n list of generators).\n\n INPUT:\n\n - ``gens`` -- (default: ``None``) list of generators\n\n - ``gap_group`` -- (optional) a gap permutation group\n\n - ``canonicalize`` -- boolea...
@richcmp_method class PermutationGroup_generic(FiniteGroup): '\n A generic permutation group.\n\n EXAMPLES::\n\n sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]])\n sage: G\n Permutation Group with generators [(3,4), (1,2,3)(4,5)]\n sage: G.center()\n Subgroup generate...
class PermutationGroup_subgroup(PermutationGroup_generic): '\n Subgroup subclass of ``PermutationGroup_generic``, so instance methods\n are inherited.\n\n EXAMPLES::\n\n sage: G = CyclicPermutationGroup(4)\n sage: gens = G.gens()\n sage: H = DihedralGroup(4)\n sage: H.subgroup...
class PermutationGroup_action(PermutationGroup_generic): '\n A permutation group given by a finite group action.\n\n EXAMPLES:\n\n A cyclic action::\n\n sage: n = 3\n sage: a = lambda x: SetPartition([[e % n + 1 for e in b] for b in x])\n sage: S = SetPartitions(n) ...
class PermutationGroupMorphism(Morphism): '\n A set-theoretic map between PermutationGroups.\n ' def _repr_type(self): "\n Return the type of this morphism.\n\n This is used for printing the morphism.\n\n EXAMPLES::\n\n sage: G = PSL(2,7)\n sage: D, io...
class PermutationGroupMorphism_id(PermutationGroupMorphism): pass
class PermutationGroupMorphism_from_gap(PermutationGroupMorphism): def __init__(self, G, H, gap_hom): "\n This is a Python trick to allow Sage programmers to create a group\n homomorphism using GAP using very general constructions. An example\n of its usage is in the direct_product i...
class PermutationGroupMorphism_im_gens(PermutationGroupMorphism): def __init__(self, G, H, gens=None): '\n Some python code for wrapping GAP\'s ``GroupHomomorphismByImages``\n function but only for permutation groups. Can be expensive if G is\n large. This returns "fail" if gens does...
def is_PermutationGroupMorphism(f) -> bool: '\n Return ``True`` if the argument ``f`` is a :class:`PermutationGroupMorphism`.\n\n EXAMPLES::\n\n sage: from sage.groups.perm_gps.permgroup_morphism import is_PermutationGroupMorphism\n sage: G = CyclicPermutationGroup(4)\n sage: H = Dihedr...
class PermutationGroup_unique(CachedRepresentation, PermutationGroup_generic): '\n .. TODO::\n\n Fix the broken hash. ::\n\n sage: G = SymmetricGroup(6)\n sage: G3 = G.subgroup([G((1,2,3,4,5,6)),G((1,2))])\n sage: hash(G) == hash(G3) # todo: Should be True!\n ...
class PermutationGroup_symalt(PermutationGroup_unique): '\n This is a class used to factor out some of the commonality\n in the :class:`SymmetricGroup` and :class:`AlternatingGroup` classes.\n ' @staticmethod def __classcall__(cls, domain): '\n Normalizes the input of the construc...
class SymmetricGroup(PermutationGroup_symalt): '\n The full symmetric group of order `n!`, as a permutation group.\n\n If `n` is a list or tuple of positive integers then it returns the\n symmetric group of the associated set.\n\n INPUT:\n\n - ``n`` -- a positive integer, or list or tuple thereof\n...
class AlternatingGroup(PermutationGroup_symalt): def __init__(self, domain=None): '\n The alternating group of order `n!/2`, as a permutation group.\n\n INPUT:\n\n - ``n`` -- a positive integer, or list or tuple thereof\n\n .. note::\n\n This group is also available...
class CyclicPermutationGroup(PermutationGroup_unique): def __init__(self, n): '\n A cyclic group of order `n`, as a permutation group.\n\n INPUT:\n\n - ``n`` -- a positive integer\n\n .. note::\n\n This group is also available via ``groups.permutation.Cyclic()``.\n\...
class DiCyclicGroup(PermutationGroup_unique): '\n The dicyclic group of order `4n`, for `n\\geq 2`.\n\n INPUT:\n\n - ``n`` -- a positive integer, two or greater\n\n OUTPUT:\n\n This is a nonabelian group similar in some respects to the\n dihedral group of the same order, but with far fewer\n ...
class KleinFourGroup(PermutationGroup_unique): def __init__(self): '\n The Klein 4 Group, which has order `4` and exponent `2`, viewed\n as a subgroup of `S_4`.\n\n OUTPUT:\n\n the Klein 4 group of order 4, as a permutation group of degree 4.\n\n .. note::\n\n ...
class JankoGroup(PermutationGroup_unique): def __init__(self, n): '\n Janko Groups `J1, J2`, and `J3`.\n (Note that `J4` is too big to be treated here.)\n\n INPUT:\n\n - ``n`` -- an integer among `\\{1,2,3\\}`.\n\n EXAMPLES::\n\n sage: G = groups.permutation....
class SuzukiSporadicGroup(PermutationGroup_unique): def __init__(self): '\n Suzuki Sporadic Group\n\n EXAMPLES::\n\n sage: G = groups.permutation.SuzukiSporadic(); G # optional - gap_package_atlasrep internet\n Sporadic Suzuki group acting on 1782 po...
class QuaternionGroup(DiCyclicGroup): '\n The quaternion group of order 8.\n\n OUTPUT:\n\n The quaternion group of order 8, as a permutation group.\n See the :class:`DiCyclicGroup` class for a generalization of this\n construction.\n\n .. note::\n\n This group is also available via ``grou...
class GeneralDihedralGroup(PermutationGroup_generic): '\n The Generalized Dihedral Group generated by the abelian group with\n direct factors in the input list.\n\n INPUT:\n\n - ``factors`` -- a list of the sizes of the cyclic factors of the\n abelian group being dihedralized (this will be sorted...
class DihedralGroup(PermutationGroup_unique): def __init__(self, n): '\n The Dihedral group of order `2n` for any integer `n\\geq 1`.\n\n INPUT:\n\n - ``n`` -- a positive integer\n\n OUTPUT:\n\n The dihedral group of order `2n`, as a permutation group\n\n .. NOTE...
class SplitMetacyclicGroup(PermutationGroup_unique): def __init__(self, p, m): "\n The split metacyclic group of order `p^m`.\n\n INPUT:\n\n - ``p`` -- a prime number that is the prime underlying this\n p-group\n\n - ``m`` -- a positive integer such that the order of ...
class SemidihedralGroup(PermutationGroup_unique): def __init__(self, m): "\n The semidihedral group of order `2^m`.\n\n INPUT:\n\n - ``m`` -- a positive integer; the power of 2 that is the\n group's order\n\n OUTPUT:\n\n The semidihedral group of order `2^m`. T...
class MathieuGroup(PermutationGroup_unique): def __init__(self, n): '\n The Mathieu group of degree `n`.\n\n INPUT:\n\n - ``n`` -- a positive integer in {9, 10, 11, 12, 21, 22, 23, 24}.\n\n OUTPUT:\n\n the Mathieu group of degree `n`, as a permutation group\n\n ...
class TransitiveGroup(PermutationGroup_unique): def __init__(self, d, n): '\n The transitive group from the GAP tables of transitive groups.\n\n INPUT:\n\n - ``d`` -- non-negative integer; the degree\n - ``n`` -- positive integer; the index of the group in the GAP database,\n ...
def TransitiveGroups(d=None): "\n INPUT:\n\n - ``d`` -- an integer (optional)\n\n Return the set of all transitive groups of a given degree\n ``d`` up to isomorphisms. If ``d`` is not specified, it returns the set of all\n transitive groups up to isomorphisms.\n\n EXAMPLES::\n\n sage: Tra...
class TransitiveGroupsAll(DisjointUnionEnumeratedSets): '\n The infinite set of all transitive groups up to isomorphisms.\n\n EXAMPLES::\n\n sage: L = TransitiveGroups(); L\n Transitive Groups\n sage: L.category()\n Category of facade infinite enumerated sets\n sage: L.car...
class TransitiveGroupsOfDegree(CachedRepresentation, Parent): '\n The set of all transitive groups of a given (small) degree up\n to isomorphism.\n\n EXAMPLES::\n\n sage: S = TransitiveGroups(4); S\n Transitive Groups of degree 4\n sage: list(S)\n [Transitive group number 1 of...
class PrimitiveGroup(PermutationGroup_unique): '\n The primitive group from the GAP tables of primitive groups.\n\n INPUT:\n\n - ``d`` -- non-negative integer. the degree of the group.\n\n - ``n`` -- positive integer. the index of the group in the GAP\n database, starting at 1\n\n OUTPUT:\n\n ...
def PrimitiveGroups(d=None): '\n Return the set of all primitive groups of a given degree ``d``\n\n INPUT:\n\n - ``d`` -- an integer (optional)\n\n OUTPUT:\n\n The set of all primitive groups of a given degree ``d`` up to\n isomorphisms using GAP. If ``d`` is not specified, it returns the\n s...
class PrimitiveGroupsAll(DisjointUnionEnumeratedSets): '\n The infinite set of all primitive groups up to isomorphisms.\n\n EXAMPLES::\n\n sage: L = PrimitiveGroups(); L\n Primitive Groups\n sage: L.category()\n Category of facade infinite enumerated sets\n sage: L.cardina...
class PrimitiveGroupsOfDegree(CachedRepresentation, Parent): '\n The set of all primitive groups of a given degree up to isomorphisms.\n\n EXAMPLES::\n\n sage: S = PrimitiveGroups(5); S\n Primitive Groups of degree 5\n sage: S.list()\n [C(5), D(2*5), AGL(1, 5), A(5), S(5)]\n ...
class PermutationGroup_plg(PermutationGroup_unique): def base_ring(self): '\n EXAMPLES::\n\n sage: G = PGL(2,3)\n sage: G.base_ring()\n Finite Field of size 3\n\n sage: G = PSL(2,3)\n sage: G.base_ring()\n Finite Field of size 3\n ...
class PGL(PermutationGroup_plg): def __init__(self, n, q, name='a'): "\n The projective general linear groups over `\\GF(q)`.\n\n INPUT:\n\n - ``n`` -- positive integer; the degree\n - ``q`` -- prime power; the size of the ground field\n - ``name`` -- (default: ``'a'``)...
class PSL(PermutationGroup_plg): def __init__(self, n, q, name='a'): "\n The projective special linear groups over `\\GF(q)`.\n\n INPUT:\n\n - ``n`` -- positive integer; the degree\n - ``q`` -- either a prime power (the size of the ground field) or a finite field\n - ``...
class PSp(PermutationGroup_plg): def __init__(self, n, q, name='a'): "\n The projective symplectic linear groups over `\\GF(q)`.\n\n INPUT:\n\n - ``n`` -- positive integer; the degree\n - ``q`` -- prime power; the size of the ground field\n - ``name`` -- (default: ``'a'...
class PermutationGroup_pug(PermutationGroup_plg): def field_of_definition(self): '\n EXAMPLES::\n\n sage: PSU(2,3).field_of_definition() # needs sage.rings.finite_rings\n Finite Field in a of size 3^2\n ' return self._fiel...
class PSU(PermutationGroup_pug): def __init__(self, n, q, name='a'): "\n The projective special unitary groups over `\\GF(q)`.\n\n INPUT:\n\n - n -- positive integer; the degree\n - q -- prime power; the size of the ground field\n - name -- (default: 'a') variable name ...
class PGU(PermutationGroup_pug): def __init__(self, n, q, name='a'): "\n The projective general unitary groups over `\\GF(q)`.\n\n INPUT:\n\n - ``n`` -- positive integer; the degree\n - ``q`` -- prime power; the size of the ground field\n - ``name`` -- (default: ``'a'``...
class SuzukiGroup(PermutationGroup_unique): def __init__(self, q, name='a'): "\n The Suzuki group over `\\GF(q)`,\n `^2 B_2(2^{2k+1}) = Sz(2^{2k+1})`.\n\n A wrapper for the GAP function ``SuzukiGroup``.\n\n INPUT:\n\n - ``q`` -- `2^n`, an odd power of 2; the size of the...
class ComplexReflectionGroup(PermutationGroup_unique): '\n A finite complex reflection group as a permutation group.\n\n We can realize `G(m,1,n)` as `m` copies of the symmetric group\n `S_n` with `s_i` for `1 \\leq i < n` acting as the usual adjacent\n transposition on each copy of `S_n`. We construc...
class SmallPermutationGroup(PermutationGroup_generic): '\n A GAP SmallGroup, returned as a permutation group.\n\n GAP contains a library SGL of small groups, each identified by\n its GAP SmallGroup id. (MAGMA uses the same identifiers).\n The GAP SmallGroup id is a pair ``[n,k]`` consisting of\n ``...
class SymmetricGroupConjugacyClassMixin(): '\n Mixin class which contains methods for conjugacy classes of\n the symmetric group.\n ' def __init__(self, domain, part): "\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: G = SymmetricGroup(5)\n sage: g = G([(...
class SymmetricGroupConjugacyClass(SymmetricGroupConjugacyClassMixin, ConjugacyClassGAP): '\n A conjugacy class of the symmetric group.\n\n INPUT:\n\n - ``group`` -- the symmetric group\n - ``part`` -- a partition or an element of ``group``\n ' def __init__(self, group, part): '\n ...
class PermutationsConjugacyClass(SymmetricGroupConjugacyClassMixin, ConjugacyClass): '\n A conjugacy class of the permutations of `n`.\n\n INPUT:\n\n - ``P`` -- the permutations of `n`\n - ``part`` -- a partition or an element of ``P``\n ' def __init__(self, P, part): '\n Initia...
def default_representative(part, G): '\n Construct the default representative for the conjugacy class of\n cycle type ``part`` of a symmetric group ``G``.\n\n Let `\\lambda` be a partition of `n`. We pick a representative by\n\n .. MATH::\n\n (1, 2, \\ldots, \\lambda_1)\n (\\lambda_1 + 1...
def conjugacy_class_iterator(part, S=None): "\n Return an iterator over the conjugacy class associated to\n the partition ``part``.\n\n The elements are given as a list of tuples, each tuple being a cycle.\n\n INPUT:\n\n - ``part`` -- partition\n\n - ``S`` -- (optional, default: `\\{ 1, 2, \\ldo...
class RightAngledArtinGroup(ArtinGroup): "\n The right-angled Artin group defined by a graph `G`.\n\n Let `\\Gamma = \\{V(\\Gamma), E(\\Gamma)\\}` be a simple graph.\n A *right-angled Artin group* (commonly abbreviated as RAAG) is the group\n\n .. MATH::\n\n A_{\\Gamma} = \\langle g_v : v \\in ...
class CohomologyRAAG(CombinatorialFreeModule): '\n The cohomology ring of a right-angled Artin group.\n\n The cohomology ring of a right-angled Artin group `A`, defined by\n the graph `G`, with coefficients in a field `F` is isomorphic to\n the exterior algebra of `F^N`, where `N` is the number of ver...
class SemimonomialTransformationGroup(FiniteGroup, UniqueRepresentation): "\n A semimonomial transformation group over a ring.\n\n The semimonomial transformation group of degree `n` over a ring `R` is\n the semidirect product of the monomial transformation group of degree `n`\n (also known as the com...
class SemimonomialActionVec(Action): '\n The natural left action of the semimonomial group on vectors.\n\n The action is defined by:\n `(\\phi, \\pi, \\alpha)*(v_0, \\ldots, v_{n-1}) :=\n (\\alpha(v_{\\pi(1)-1}) \\cdot \\phi_0^{-1}, \\ldots, \\alpha(v_{\\pi(n)-1}) \\cdot \\phi_{n-1}^{-1})`.\n (The ...
class SemimonomialActionMat(Action): '\n The left action of\n :class:`~sage.groups.semimonomial_transformations.semimonomial_transformation_group.SemimonomialTransformationGroup`\n on matrices over the same ring whose number of columns is equal to the degree.\n See :class:`~sage.groups.semimonomial_tr...
def algebraic_topological_model(K, base_ring=None): "\n Algebraic topological model for cell complex ``K``\n with coefficients in the field ``base_ring``.\n\n INPUT:\n\n - ``K`` -- either a simplicial complex or a cubical complex\n - ``base_ring`` -- coefficient ring; must be a field\n\n OUTPUT:...
def algebraic_topological_model_delta_complex(K, base_ring=None): '\n Algebraic topological model for cell complex ``K``\n with coefficients in the field ``base_ring``.\n\n This has the same basic functionality as\n :func:`algebraic_topological_model`, but it also works for\n `\\Delta`-complexes. F...
def _latex_module(R, m): "\n LaTeX string representing a free module over ``R`` of rank ``m``.\n\n INPUT:\n\n - ``R`` -- a commutative ring\n - ``m`` -- non-negative integer\n\n This is used by the ``_latex_`` method for chain complexes.\n\n EXAMPLES::\n\n sage: from sage.homology.chain_c...
def ChainComplex(data=None, base_ring=None, grading_group=None, degree_of_differential=1, degree=1, check=True): "\n Define a chain complex.\n\n INPUT:\n\n - ``data`` -- the data defining the chain complex; see below for\n more details.\n\n The following keyword arguments are supported:\n\n - ...
class Chain_class(ModuleElement): def __init__(self, parent, vectors, check=True): '\n A Chain in a Chain Complex\n\n A chain is collection of module elements for each module `C_n`\n of the chain complex `(C_n, d_n)`. There is no restriction on\n how the differentials `d_n` ac...
class ChainComplex_class(Parent): '\n See :func:`ChainComplex` for full documentation.\n\n The differentials are required to be in the following canonical form:\n\n * All differentials that are not `0 \\times 0` must be specified\n (even if they have zero rows or zero columns), and\n\n * Differen...
def is_ChainComplexHomspace(x): '\n Return ``True`` if and only if ``x`` is a morphism of chain complexes.\n\n EXAMPLES::\n\n sage: from sage.homology.chain_complex_homspace import is_ChainComplexHomspace\n sage: T = SimplicialComplex([[1,2,3,4],[7,8,9]])\n sage: C = T.chain_complex(aug...
class ChainComplexHomspace(sage.categories.homset.Homset): '\n Class of homspaces of chain complex morphisms.\n\n EXAMPLES::\n\n sage: T = SimplicialComplex([[1,2,3,4],[7,8,9]])\n sage: C = T.chain_complex(augmented=True, cochain=True)\n sage: G = Hom(C, C)\n sage: G\n Set...
def is_ChainComplexMorphism(x): '\n Return ``True`` if and only if ``x`` is a chain complex morphism.\n\n EXAMPLES::\n\n sage: # needs sage.graphs\n sage: from sage.homology.chain_complex_morphism import is_ChainComplexMorphism\n sage: S = simplicial_complexes.Sphere(14)\n sage: ...
class ChainComplexMorphism(Morphism): '\n An element of this class is a morphism of chain complexes.\n ' def __init__(self, matrices, C, D, check=True): '\n Create a morphism from a dictionary of matrices.\n\n EXAMPLES::\n\n sage: # needs sage.graphs\n sage: ...
class ChainHomotopy(Morphism): '\n A chain homotopy.\n\n A chain homotopy `H` between chain maps `f, g: C \\to D` is a sequence\n of maps `H_n: C_n \\to D_{n+1}` (if the chain complexes are graded\n homologically) satisfying\n\n .. MATH::\n\n \\partial_D H + H \\partial_C = f - g.\n\n INPU...
class ChainContraction(ChainHomotopy): '\n A chain contraction.\n\n An algebraic gradient vector field `H: C \\to C` (that is a chain\n homotopy satisfying `H H = 0`) for which there are chain\n maps `\\pi: C \\to D` ("projection") and `\\iota: D \\to C`\n ("inclusion") such that\n\n - `H` is a ...
class CellComplexReference(): def __init__(self, cell_complex, degree, cells=None): '\n Auxiliary base class for chains and cochains\n\n INPUT:\n\n - ``cell_complex`` -- The cell complex to reference\n\n - ``degree`` -- integer. The degree of the (co)chains\n\n - ``cell...
class Chains(CellComplexReference, CombinatorialFreeModule): '\n Class for the free module of chains in a given degree.\n\n INPUT:\n\n - ``n_cells`` -- tuple of `n`-cells, which thus forms a basis for\n this module\n - ``base_ring`` -- optional (default `\\ZZ`)\n\n One difference between chain...
class Cochains(CellComplexReference, CombinatorialFreeModule): '\n Class for the free module of cochains in a given degree.\n\n INPUT:\n\n - ``n_cells`` -- tuple of `n`-cells, which thus forms a basis for\n this module\n - ``base_ring`` -- optional (default `\\ZZ`)\n\n One difference between c...
class FreeResolution(SageObject, metaclass=ClasscallMetaclass): '\n A free resolution.\n\n Let `R` be a commutative ring. A *free resolution* of an `R`-module `M`\n is a (possibly infinite) chain complex of free `R`-modules\n\n .. MATH::\n\n R^{n_1} \\xleftarrow{d_1} R^{n_1} \\xleftarrow{d_2}\...
class FiniteFreeResolution(FreeResolution): '\n Finite free resolutions.\n\n The matrix at index `i` in the list defines the differential map from\n `(i + 1)`-th free module to the `i`-th free module over the base ring by\n multiplication on the left. The number of matrices in the list is the\n len...
class FiniteFreeResolution_free_module(FiniteFreeResolution): '\n Free resolutions of a free module.\n\n INPUT:\n\n - ``module`` -- a free module or ideal over a PID\n - ``name`` -- the name of the base ring\n\n EXAMPLES::\n\n sage: R.<x> = QQ[]\n sage: M = R^3\n sage: v = M([x...
class FiniteFreeResolution_singular(FiniteFreeResolution): "\n Minimal free resolutions of ideals or submodules of free modules\n of multivariate polynomial rings implemented in Singular.\n\n INPUT:\n\n - ``module`` -- a submodule of a free module `M` of rank `n` over `S` or\n an ideal of a multi...
class GradedFiniteFreeResolution(FiniteFreeResolution): '\n Graded finite free resolutions.\n\n INPUT:\n\n - ``module`` -- a homogeneous submodule of a free module `M` of rank `n`\n over `S` or a homogeneous ideal of a multivariate polynomial ring `S`\n - ``degrees`` -- (default: a list with all ...
class GradedFiniteFreeResolution_free_module(GradedFiniteFreeResolution, FiniteFreeResolution_free_module): '\n Graded free resolution of free modules.\n\n .. WARNING::\n\n This does not check that the module is homogeneous.\n\n EXAMPLES::\n\n sage: from sage.homology.free_resolution import...
class GradedFiniteFreeResolution_singular(GradedFiniteFreeResolution, FiniteFreeResolution_singular): '\n Graded free resolutions of submodules and ideals of multivariate\n polynomial rings implemented using Singular.\n\n INPUT:\n\n - ``module`` -- a homogeneous submodule of a free module `M` of rank ...
class HochschildComplex(UniqueRepresentation, Parent): '\n The Hochschild complex.\n\n Let `A` be an algebra over a commutative ring `R` such\n that `A` a projective `R`-module, and `M` an `A`-bimodule.\n The *Hochschild complex* is the chain complex given by\n\n .. MATH::\n\n C_n(A, M) := M...
class HomologyGroup_class(AdditiveAbelianGroup_fixed_gens): '\n Discrete Abelian group on `n` generators. This class inherits from\n :class:`~sage.groups.additive_abelian.additive_abelian_group.AdditiveAbelianGroup_fixed_gens`;\n see :mod:`sage.groups.additive_abelian.additive_abelian_group` for more\n ...
def HomologyGroup(n, base_ring, invfac=None): '\n Abelian group on `n` generators which represents a homology group in a\n fixed degree.\n\n INPUT:\n\n - ``n`` -- integer; the number of generators\n\n - ``base_ring`` -- ring; the base ring over which the homology is computed\n\n - ``inv_fac`` --...
class InducedHomologyMorphism(Morphism): '\n An element of this class is a morphism of (co)homology groups\n induced by a map of simplicial complexes. It requires working\n with field coefficients.\n\n INPUT:\n\n - ``map`` -- the map of simplicial complexes\n - ``base_ring`` -- a field (optional...
class HomologyVectorSpaceWithBasis(CombinatorialFreeModule): '\n Homology (or cohomology) vector space.\n\n This provides enough structure to allow the computation of cup\n products and cohomology operations. See the class\n :class:`CohomologyRing` (which derives from this) for examples.\n\n It als...
class HomologyVectorSpaceWithBasis_mod2(HomologyVectorSpaceWithBasis): '\n Homology vector space mod 2.\n\n Based on :class:`HomologyVectorSpaceWithBasis`, with Steenrod\n operations included.\n\n .. NOTE::\n\n This is not intended to be created directly by the user, but\n instead via th...
class CohomologyRing(HomologyVectorSpaceWithBasis): '\n The cohomology ring.\n\n .. NOTE::\n\n This is not intended to be created directly by the user, but\n instead via the\n :meth:`cohomology ring<sage.topology.cell_complex.GenericCellComplex.cohomology_ring>`\n of a :class:`ce...
class CohomologyRing_mod2(CohomologyRing): '\n The mod 2 cohomology ring.\n\n Based on :class:`CohomologyRing`, with Steenrod operations included.\n\n .. NOTE::\n\n This is not intended to be created directly by the user, but\n instead via the\n :meth:`cohomology ring<sage.topology.c...
def sum_indices(k, i_k_plus_one, S_k_plus_one): '\n This is a recursive function for computing the indices for the\n nested sums in GonzΓ‘lez-DΓ­az and RΓ©al [GDR1999]_, Corollary 3.2.\n\n In the paper, given indices `i_n`, `i_{n-1}`, ..., `i_{k+1}`,\n given `k`, and given `S(k+1)`, the number `S(k)` is ...
def is_GF2(R): "\n Return ``True`` iff ``R`` is isomorphic to the field `\\GF{2}`.\n\n EXAMPLES::\n\n sage: from sage.homology.homology_vector_space_with_basis import is_GF2\n sage: is_GF2(GF(2))\n True\n sage: is_GF2(GF(2, impl='ntl'))\n True\n sage: is_GF2(GF(3))\...
class KoszulComplex(ChainComplex_class, UniqueRepresentation): '\n A Koszul complex.\n\n Let `R` be a ring and consider `x_1, x_2, \\ldots, x_n \\in R`. The\n *Koszul complex* `K_*(x_1, \\ldots, x_n)` is given by defining a\n chain complex structure on the exterior algebra `\\bigwedge^n R` with\n t...
def dhsw_snf(mat, verbose=False): '\n Preprocess a matrix using the "Elimination algorithm" described by\n Dumas et al. [DHSW2003]_, and then call ``elementary_divisors`` on the\n resulting (smaller) matrix.\n\n .. NOTE::\n\n \'snf\' stands for \'Smith Normal Form\'.\n\n INPUT:\n\n - ``ma...
def random_chain_complex(level=1): '\n Return a random chain complex, defined by specifying a single\n random matrix in a random degree, with differential of degree\n either 1 or -1. The matrix is randomly sparse or dense.\n\n :param level: measure of complexity: the larger this is, the\n larger...
@random_testing def test_random_chain_complex(level=1, trials=1, verbose=False): '\n Compute the homology of a random chain complex with and without\n CHomP, and compare the results. If they are not the same, raise\n an error.\n\n This function is deprecated: see :trac:`33777`.\n\n :param level: m...
def random_simplicial_complex(level=1, p=0.5): '\n Return a random simplicial complex.\n\n :param level: measure of complexity: the larger this is, the more\n vertices and therefore the larger the possible dimension of the\n complex.\n :type level: positive integer; optional, default 1\n :pa...
@random_testing def test_random_simplicial_complex(level=1, trials=1, verbose=False): '\n Compute the homology of a random simplicial complex with and\n without CHomP, and compare the results. If they are not the same,\n raise an error.\n\n :param level: measure of complexity of the simplicial comple...