code
stringlengths
17
6.64M
class SchemeMorphism_fan_toric_variety_dominant(SchemeMorphism_fan_toric_variety): "\n Construct a morphism determined by a dominant fan morphism.\n\n A dominant morphism is one that is surjective onto a dense\n subset. In the context of toric morphisms, this means that it is\n onto the big torus orbi...
class SchemeMorphism_fan_fiber_component_toric_variety(SchemeMorphism): "\n The embedding of a fiber component of a toric morphism.\n\n Note that the embedding map of a fiber component of a toric morphism is\n itself not a toric morphism!\n\n INPUT:\n\n - ``toric_morphism`` -- a toric morphism. The...
class InfinitePointEnumerator(): def __init__(self, fan, ring): '\n Point enumerator for infinite fields.\n\n INPUT:\n\n - ``fan`` -- fan of the toric variety.\n\n - ``ring`` -- infinite base ring over which to enumerate\n points.\n\n TESTS::\n\n sag...
class NaiveFinitePointEnumerator(): def __init__(self, fan, ring): '\n The naive point enumerator.\n\n This is very slow.\n\n INPUT:\n\n - ``fan`` -- fan of the toric variety.\n\n - ``ring`` -- finite base ring over which to enumerate points.\n\n EXAMPLES::\n\n ...
class FiniteFieldPointEnumerator(NaiveFinitePointEnumerator): @cached_method def multiplicative_generator(self): "\n Return the multiplicative generator of the finite field.\n\n OUTPUT: A finite field element.\n\n EXAMPLES::\n\n sage: point_set = toric_varieties.P2(bas...
class NaiveSubschemePointEnumerator(): def __init__(self, polynomials, ambient): '\n Point enumerator for algebraic subschemes of toric varieties.\n\n INPUT:\n\n - ``polynomials`` -- list/tuple/iterable of polynomials. The\n defining polynomials.\n\n - ``ambient`` -- ...
class FiniteFieldSubschemePointEnumerator(NaiveSubschemePointEnumerator): def inhomogeneous_equations(self, ring, nonzero_coordinates, cokernel): '\n Inhomogenize the defining polynomials\n\n INPUT:\n\n - ``ring`` -- the polynomial ring for inhomogeneous\n coordinates.\n\n ...
def TangentBundle(X): '\n Construct the tangent bundle of a toric variety.\n\n INPUT:\n\n - ``X`` -- a toric variety. The base space of the bundle.\n\n OUTPUT:\n\n The tangent bundle as a Klyachko bundle.\n\n EXAMPLES::\n\n sage: dP7 = toric_varieties.dP7()\n sage: from sage.scheme...
def CotangentBundle(X): '\n Construct the cotangent bundle of a toric variety.\n\n INPUT:\n\n - ``X`` -- a toric variety. The base space of the bundle.\n\n OUTPUT:\n\n The cotangent bundle as a Klyachko bundle.\n\n EXAMPLES::\n\n sage: dP7 = toric_varieties.dP7()\n sage: from sage....
def TrivialBundle(X, rank=1): '\n Return the trivial bundle of rank ``r``.\n\n INPUT:\n\n - ``X`` -- a toric variety. The base space of the bundle.\n\n - ``rank`` -- the rank of the bundle.\n\n OUTPUT:\n\n The trivial bundle as a Klyachko bundle.\n\n EXAMPLES::\n\n sage: P2 = toric_var...
def LineBundle(X, D): '\n Construct the rank-1 bundle `O(D)`.\n\n INPUT:\n\n - ``X`` -- a toric variety. The base space of the bundle.\n\n - ``D`` -- a toric divisor.\n\n OUTPUT:\n\n The line bundle `O(D)` as a Klyachko bundle of rank 1.\n\n EXAMPLES::\n\n sage: X = toric_varieties.dP8...
class SheafLibrary(): def __init__(self, toric_variety): "\n Utility object to construct sheaves on toric varieties.\n\n .. warning::\n\n You should never construct instances manually. Can be\n accessed from a toric variety via the\n :attr:`sage.schemes.tori...
def is_KlyachkoBundle(X): "\n Test whether ``X`` is a Klyachko bundle\n\n INPUT:\n\n - ``X`` -- anything.\n\n OUTPUT: A boolean.\n\n EXAMPLES::\n\n sage: from sage.schemes.toric.sheaf.klyachko import is_KlyachkoBundle\n sage: is_KlyachkoBundle('test')\n False\n " return ...
def Bundle(toric_variety, multi_filtration, check=True): '\n Construct a Klyacho bundle\n\n INPUT:\n\n - ``toric_variety`` -- a toric variety. The base space of the bundle.\n\n - ``multi_filtration`` -- a multi-filtered vectors space with\n multiple filtrations being indexed by the one-dimensiona...
@richcmp_method class KlyachkoBundle_class(SageObject): def __init__(self, toric_variety, multi_filtration, check=True): "\n A toric bundle using Klyachko's representation.\n\n .. warning::\n\n You should always use the :func:`Bundle` factory function\n to construct in...
class AlgebraicScheme_subscheme_toric(AlgebraicScheme_subscheme): '\n Construct an algebraic subscheme of a toric variety.\n\n .. WARNING::\n\n You should not create objects of this class directly. The\n preferred method to construct such subschemes is to use\n :meth:`~ToricVariety_fiel...
class AlgebraicScheme_subscheme_affine_toric(AlgebraicScheme_subscheme_toric): '\n Construct an algebraic subscheme of an affine toric variety.\n\n .. WARNING::\n\n You should not create objects of this class directly. The preferred\n method to construct such subschemes is to use\n :met...
def is_ToricVariety(x): '\n Check if ``x`` is a toric variety.\n\n INPUT:\n\n - ``x`` -- anything.\n\n OUTPUT:\n\n - ``True`` if ``x`` is a :class:`toric variety <ToricVariety_field>` and\n ``False`` otherwise.\n\n .. NOTE::\n\n While projective spaces are toric varieties mathematica...
def ToricVariety(fan, coordinate_names=None, names=None, coordinate_indices=None, base_ring=QQ, base_field=None): '\n Construct a toric variety.\n\n INPUT:\n\n - ``fan`` -- :class:`rational polyhedral fan\n <sage.geometry.fan.RationalPolyhedralFan>`;\n\n - ``coordinate_names`` -- names of variabl...
def AffineToricVariety(cone, *args, **kwds): '\n Construct an affine toric variety.\n\n INPUT:\n\n - ``cone`` -- :class:`strictly convex rational polyhedral cone\n <sage.geometry.cone.ConvexRationalPolyhedralCone>`.\n\n This cone will be used to construct a :class:`rational polyhedral fan\n <s...
class ToricVariety_field(AmbientSpace): '\n Construct a toric variety associated to a rational polyhedral fan.\n\n .. WARNING::\n\n This class does not perform any checks of correctness of input. Use\n :func:`ToricVariety` and :func:`AffineToricVariety` to construct toric\n varieties.\n...
def normalize_names(names=None, ngens=None, prefix=None, indices=None, return_prefix=False): '\n Return a list of names in the standard form.\n\n INPUT:\n\n All input parameters are optional.\n\n - ``names`` -- names given either as a single string (with individual\n names separated by commas or ...
class CohomologyRing(QuotientRing_generic, UniqueRepresentation): '\n The (even) cohomology ring of a toric variety.\n\n Irregardles of the variety\'s base ring, we always work with the\n variety over `\\CC` and its topology.\n\n The cohomology is always the singular cohomology with\n `\\QQ`-coeffi...
def is_CohomologyClass(x): "\n Check whether ``x`` is a cohomology class of a toric variety.\n\n INPUT:\n\n - ``x`` -- anything.\n\n OUTPUT:\n\n ``True`` or ``False`` depending on whether ``x`` is an instance of\n :class:`CohomologyClass`\n\n EXAMPLES::\n\n sage: P2 = toric_varieties.P...
class CohomologyClass(QuotientRingElement): '\n An element of the :class:`CohomologyRing`.\n\n .. WARNING::\n\n You should not create instances of this class manually. The\n generators of the cohomology ring as well as the cohomology\n classes associated to cones of the fan can be obtai...
def Discriminant(polynomial, variables=None): '\n The discriminant of the elliptic curve.\n\n INPUT:\n\n See :func:`WeierstrassForm` for how to specify the input\n polynomial(s) and variables.\n\n OUTPUT: The discriminant of the elliptic curve.\n\n EXAMPLES::\n\n sage: from sage.schemes.t...
def j_invariant(polynomial, variables=None): '\n Return the `j`-invariant of the elliptic curve.\n\n INPUT:\n\n See :func:`WeierstrassForm` for how to specify the input\n polynomial(s) and variables.\n\n OUTPUT:\n\n The j-invariant of the (irreducible) cubic. Notable special values:\n\n * The...
def Newton_polytope_vars_coeffs(polynomial, variables): '\n Return the Newton polytope in the given variables.\n\n INPUT:\n\n See :func:`WeierstrassForm` for how to specify the input\n polynomial and variables.\n\n OUTPUT:\n\n A dictionary with keys the integral values of the Newton polytope\n ...
def Newton_polygon_embedded(polynomial, variables): '\n Embed the Newton polytope of the polynomial in one of the three\n maximal reflexive polygons.\n\n This function is a helper for :func:`WeierstrassForm`\n\n INPUT:\n\n Same as :func:`WeierstrassForm` with only a single polynomial passed.\n\n ...
def WeierstrassForm(polynomial, variables=None, transformation=False): '\n Return the Weierstrass form of an elliptic curve inside either\n inside a toric surface or `\\mathbb{P}^3`.\n\n INPUT:\n\n - ``polynomial`` -- either a polynomial or a list of polynomials\n defining the elliptic curve.\n ...
def _check_homogeneity(polynomial, variables, weights, total_weight=None): '\n Raise ``ValueError`` if the polynomial is not weighted\n homogeneous.\n\n INPUT:\n\n - ``polynomial`` -- the input polynomial. See\n :func:`WeierstrassForm` for details.\n\n - ``variables`` -- the variables. See :f...
def _extract_coefficients(polynomial, monomials, variables): '\n Return the coefficients of ``monomials``.\n\n INPUT:\n\n - ``polynomial`` -- the input polynomial\n\n - ``monomials`` -- a list of monomials in the polynomial ring\n\n - ``variables`` -- a list of variables in the polynomial ring\n\n ...
def _check_polynomial_P2(cubic, variables): '\n Check the polynomial is weighted homogeneous in standard variables.\n\n INPUT:\n\n - ``cubic`` -- the input polynomial. See\n :func:`WeierstrassForm` for details.\n\n - ``variables`` -- the variables or ``None``. See\n :func:`WeierstrassForm` ...
def WeierstrassForm_P2(polynomial, variables=None): '\n Bring a cubic into Weierstrass form.\n\n Input/output is the same as :func:`WeierstrassForm`, except that\n the input polynomial must be a standard cubic in `\\mathbb{P}^2`,\n\n .. MATH::\n\n \\begin{split}\n p(x,y) =&\\;\n ...
def _check_polynomial_P1xP1(biquadric, variables): '\n Check the polynomial is weighted homogeneous in standard variables.\n\n INPUT:\n\n - ``biquadric`` -- the input polynomial. See\n :func:`WeierstrassForm` for details.\n\n - ``variables`` -- the variables or ``None``. See\n :func:`Weiers...
def _partial_discriminant(quadric, y0, y1=None): '\n Return the partial discriminant wrt. `(y_0, y_1)`.\n\n INPUT:\n\n - ``quadric`` -- a biquadric.\n\n - ``y_0``, ``y_1`` -- the variables of the quadric. The ``y_1``\n variable can be omitted if the quadric is inhomogeneous.\n\n OUTPUT:\n\n ...
def WeierstrassForm_P1xP1(biquadric, variables=None): '\n Bring a biquadric into Weierstrass form\n\n Input/output is the same as :func:`WeierstrassForm`, except that\n the input polynomial must be a standard biquadric in `\\mathbb{P}^2`,\n\n .. MATH::\n\n \\begin{split}\n p(x,y) =&\\;...
def _check_polynomial_P2_112(polynomial, variables): '\n Check the polynomial is weighted homogeneous in standard variables.\n\n INPUT:\n\n - ``polynomial`` -- the input polynomial. See\n :func:`WeierstrassForm` for details.\n\n - ``variables`` -- the variables or ``None``. See\n :func:`Wei...
def WeierstrassForm_P2_112(polynomial, variables=None): '\n Bring an anticanonical hypersurface in `\\mathbb{P}^2[1,1,2]` into Weierstrass form.\n\n Input/output is the same as :func:`WeierstrassForm`, except that\n the input polynomial must be a standard anticanonical hypersurface\n in weighted proje...
def WeierstrassMap(polynomial, variables=None): '\n Return the Weierstrass form of an anticanonical hypersurface.\n\n You should use\n :meth:`sage.schemes.toric.weierstrass.WeierstrassForm` with\n ``transformation=True`` to get the transformation. This function\n is only for internal use.\n\n IN...
def WeierstrassMap_P2(polynomial, variables=None): '\n Map a cubic to its Weierstrass form.\n\n Input/output is the same as :func:`WeierstrassMap`, except that\n the input polynomial must be a cubic in `\\mathbb{P}^2`,\n\n .. MATH::\n\n \\begin{split}\n p(x,y) =&\\;\n a_{30} x...
def WeierstrassMap_P1xP1(polynomial, variables=None): "\n Map an anticanonical hypersurface in\n `\\mathbb{P}^1 \\times \\mathbb{P}^1` into Weierstrass form.\n\n Input/output is the same as :func:`WeierstrassMap`, except that\n the input polynomial must be a standard anticanonical hypersurface\n in...
def WeierstrassMap_P2_112(polynomial, variables=None): "\n Map an anticanonical hypersurface in `\\mathbb{P}^2[1,1,2]` into Weierstrass form.\n\n Input/output is the same as :func:`WeierstrassMap`, except that\n the input polynomial must be a standard anticanonical hypersurface\n in weighted projectiv...
def WeierstrassForm2(polynomial, variables=None, transformation=False): '\n Helper function for :func:`~sage.schemes.toric.weierstrass.WeierstrassForm`\n\n Currently, only the case of the complete intersection of two\n quadratic equations in `\\mathbb{P}^3` is supported.\n\n INPUT / OUTPUT:\n\n See...
def _check_polynomials_P3(quadratic1, quadratic2, variables): '\n Check that the polynomial is weighted homogeneous in standard variables.\n\n INPUT:\n\n - ``quadratic1``, ``quadratic2`` -- two quadratic polynomials in 4\n homogeneous or 3 inhomogeneous variables.\n\n - ``variables`` -- the varia...
def _biquadratic_syzygy_quartic(quadratic1, quadratic2, variables=None): "\n Helper function for the Weierstrass form of a biquadratic in `\\mathbb{P}^3`\n\n The invariants and covariants of a quaternary biquadratic satisfy\n the relation\n :meth:`sage.rings.invariant_theory.TwoQuaternaryQuadratics.sy...
def WeierstrassForm_P3(quadratic1, quadratic2, variables=None): '\n Bring a complete intersection of two quadratics into Weierstrass form.\n\n Input/output is the same as\n :func:`sage.schemes.toric.weierstrass.WeierstrassForm`, except\n that the two input polynomials must be quadratic polynomials in\...
def WeierstrassMap_P3(quadratic1, quadratic2, variables=None): '\n Bring a complete intersection of two quadratics into Weierstrass form.\n\n Input/output is the same as\n :func:`sage.schemes.toric.weierstrass.WeierstrassForm`, except\n that the two input polynomials must be quadratic polynomials in\n...
class CartesianProduct(UniqueRepresentation, Parent): '\n A class implementing a raw data structure for Cartesian products\n of sets (and elements thereof). See :obj:`cartesian_product` for\n how to construct full fledged Cartesian products.\n\n EXAMPLES::\n\n sage: G = cartesian_product([GF(5)...
class ConditionSet(Set_generic, Set_base, Set_boolean_operators, Set_add_sub_operators, UniqueRepresentation): '\n Set of elements of a universe that satisfy given predicates\n\n INPUT:\n\n - ``universe`` -- a set\n\n - ``*predicates`` -- callables\n\n - ``vars`` or ``names`` -- (default: inferred ...
class DisjointUnionEnumeratedSets(UniqueRepresentation, Parent): '\n A class for disjoint unions of enumerated sets.\n\n INPUT:\n\n - ``family`` -- a list (or iterable or family) of enumerated sets\n - ``keepkey`` -- a boolean\n - ``facade`` -- a boolean\n\n This models the enumerated set o...
class FiniteEnumeratedSet(UniqueRepresentation, Parent): '\n A class for finite enumerated set.\n\n Returns the finite enumerated set with elements in ``elements``\n where ``element`` is any (finite) iterable object.\n\n The main purpose is to provide a variant of ``list`` or ``tuple``,\n which is ...
class FiniteSetMaps(UniqueRepresentation, Parent): '\n Maps between finite sets\n\n Constructs the set of all maps between two sets. The sets can be\n given using any of the three following ways:\n\n 1. an object in the category ``Sets()``.\n\n 2. a finite iterable. In this case, an object of the c...
class FiniteSetMaps_MN(FiniteSetMaps): '\n The set of all maps from `\\{1, 2, \\dots, m\\}` to `\\{1, 2, \\dots, n\\}`.\n\n Users should use the factory class :class:`FiniteSetMaps` to\n create instances of this class.\n\n INPUT:\n\n - ``m``, ``n`` -- integers\n\n - ``category`` -- the category ...
class FiniteSetMaps_Set(FiniteSetMaps_MN): '\n The sets of all maps between two sets\n\n Users should use the factory class :class:`FiniteSetMaps` to\n create instances of this class.\n\n INPUT:\n\n - ``domain`` -- an object in the category ``FiniteSets()``.\n\n - ``codomain`` -- an object in th...
class FiniteSetEndoMaps_N(FiniteSetMaps_MN): '\n The sets of all maps from `\\{1, 2, \\dots, n\\}` to itself\n\n Users should use the factory class :class:`FiniteSetMaps` to\n create instances of this class.\n\n INPUT:\n\n - ``n`` -- an integer.\n\n - ``category`` -- the category in which the se...
class FiniteSetEndoMaps_Set(FiniteSetMaps_Set, FiniteSetEndoMaps_N): '\n The sets of all maps from a set to itself\n\n Users should use the factory class :class:`FiniteSetMaps` to\n create instances of this class.\n\n INPUT:\n\n - ``domain`` -- an object in the category ``FiniteSets()``.\n\n - `...
class ImageSubobject(Parent): '\n The subset defined as the image of another set under a fixed map.\n\n Let `f: X \\to Y` be a function. Then the image of `f` is defined as\n\n .. MATH::\n\n \\{ f(x) | x \\in X \\} \\subseteq Y.\n\n INPUT:\n\n - ``map`` -- a function\n\n - ``domain_subset...
class ImageSet(ImageSubobject, Set_base, Set_add_sub_operators, Set_boolean_operators): '\n Image of a set by a map.\n\n EXAMPLES::\n\n sage: from sage.sets.image_set import ImageSet\n\n Symbolics::\n\n sage: ImageSet(sin, RealSet.open(0, pi/4)) # needs ...
class IntegerRange(UniqueRepresentation, Parent): "\n The class of :class:`Integer <sage.rings.integer.Integer>` ranges\n\n Returns an enumerated set containing an arithmetic progression of integers.\n\n INPUT:\n\n - ``begin`` -- an integer, Infinity or -Infinity\n - ``end`` -- an i...
class IntegerRangeEmpty(IntegerRange, FiniteEnumeratedSet): '\n A singleton class for empty integer ranges\n\n See :class:`IntegerRange` for more details.\n ' @staticmethod def __classcall__(cls, *args): '\n TESTS::\n\n sage: from sage.sets.integer_range import IntegerR...
class IntegerRangeFinite(IntegerRange): '\n The class of finite enumerated sets of integers defined by finite\n arithmetic progressions\n\n See :class:`IntegerRange` for more details.\n ' def __init__(self, begin, end, step=Integer(1)): '\n TESTS::\n\n sage: I = IntegerR...
class IntegerRangeInfinite(IntegerRange): ' The class of infinite enumerated sets of integers defined by infinite\n arithmetic progressions.\n\n See :class:`IntegerRange` for more details.\n ' def __init__(self, begin, step=Integer(1)): '\n TESTS::\n\n sage: I = IntegerRang...
class IntegerRangeFromMiddle(IntegerRange): '\n The class of finite or infinite enumerated sets defined with\n an inside point, a progression and two limits.\n\n See :class:`IntegerRange` for more details.\n ' def __init__(self, begin, end, step=Integer(1), middle_point=Integer(1)): '\n ...
class NonNegativeIntegers(UniqueRepresentation, Parent): '\n The enumerated set of non negative integers.\n\n This class implements the set of non negative integers, as an\n enumerated set (see :class:`InfiniteEnumeratedSets\n <sage.categories.infinite_enumerated_sets.InfiniteEnumeratedSets>`).\n\n ...
class PositiveIntegers(IntegerRangeInfinite): '\n The enumerated set of positive integers. To fix the ideas,\n we mean `\\{1, 2, 3, 4, 5, \\dots \\}`.\n\n This class implements the set of positive integers, as an\n enumerated set (see :class:`InfiniteEnumeratedSets\n <sage.categories.infinite_enume...
class Primes(Set_generic, UniqueRepresentation): '\n The set of prime numbers.\n\n EXAMPLES::\n\n sage: P = Primes(); P\n Set of all prime numbers: 2, 3, 5, 7, ...\n\n We show various operations on the set of prime numbers::\n\n sage: P.cardinality()\n +Infinity\n sage:...
@richcmp_method class InternalRealInterval(UniqueRepresentation, Parent): '\n A real interval.\n\n You are not supposed to create :class:`InternalRealInterval` objects\n yourself. Always use :class:`RealSet` instead.\n\n INPUT:\n\n - ``lower`` -- real or minus infinity; the lower bound of the\n ...
@richcmp_method class RealSet(UniqueRepresentation, Parent, Set_base, Set_boolean_operators, Set_add_sub_operators): '\n A subset of the real line, a finite union of intervals\n\n INPUT:\n\n - ``*args`` -- arguments defining a real set. Possibilities are either:\n\n - two extended real numbers ``a, ...
def has_finite_length(obj): '\n Return ``True`` if ``obj`` is known to have finite length.\n\n This is mainly meant for pure Python types, so we do not call any\n Sage-specific methods.\n\n EXAMPLES::\n\n sage: from sage.sets.set import has_finite_length\n sage: has_finite_length(tuple(r...
def Set(X=None, category=None): "\n Create the underlying set of ``X``.\n\n If ``X`` is a list, tuple, Python set, or ``X.is_finite()`` is\n ``True``, this returns a wrapper around Python's enumerated immutable\n ``frozenset`` type with extra functionality. Otherwise it returns a\n more formal wra...
class Set_base(): '\n Abstract base class for sets, not necessarily parents.\n ' def union(self, X): '\n Return the union of ``self`` and ``X``.\n\n EXAMPLES::\n\n sage: Set(QQ).union(Set(ZZ))\n Set-theoretic union of\n Set of elements of Rational...
class Set_boolean_operators(): '\n Mix-in class providing the Boolean operators ``__or__``, ``__and__``, ``__xor__``.\n\n The operators delegate to the methods ``union``, ``intersection``, and\n ``symmetric_difference``, which need to be implemented by the class.\n ' def __or__(self, X): ...
class Set_add_sub_operators(): '\n Mix-in class providing the operators ``__add__`` and ``__sub__``.\n\n The operators delegate to the methods ``union`` and ``intersection``,\n which need to be implemented by the class.\n ' def __add__(self, X): "\n Return the union of ``self`` and...
@richcmp_method class Set_object(Set_generic, Set_base, Set_boolean_operators, Set_add_sub_operators): '\n A set attached to an almost arbitrary object.\n\n EXAMPLES::\n\n sage: K = GF(19)\n sage: Set(K)\n {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}\n sage:...
class Set_object_enumerated(Set_object): '\n A finite enumerated set.\n ' def __init__(self, X, category=None): '\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: S = Set(GF(19)); S\n {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}\n ...
class Set_object_binary(Set_object, metaclass=ClasscallMetaclass): '\n An abstract common base class for sets defined by a binary operation (ex.\n :class:`Set_object_union`, :class:`Set_object_intersection`,\n :class:`Set_object_difference`, and\n :class:`Set_object_symmetric_difference`).\n\n INPU...
class Set_object_union(Set_object_binary): '\n A formal union of two sets.\n ' def __init__(self, X, Y, category=None): '\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: # needs sage.modules\n sage: S = Set(QQ^2)\n sage: T = Set(ZZ)\n sa...
class Set_object_intersection(Set_object_binary): '\n Formal intersection of two sets.\n ' def __init__(self, X, Y, category=None): '\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: # needs sage.modules\n sage: S = Set(QQ^2)\n sage: T = Set(ZZ)\n ...
class Set_object_difference(Set_object_binary): '\n Formal difference of two sets.\n ' def __init__(self, X, Y, category=None): '\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: S = Set(QQ)\n sage: T = Set(ZZ)\n sage: X = S.difference(T); X\n ...
class Set_object_symmetric_difference(Set_object_binary): '\n Formal symmetric difference of two sets.\n ' def __init__(self, X, Y, category=None): '\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: S = Set(QQ)\n sage: T = Set(ZZ)\n sage: X = S.symm...
class EnumeratedSetFromIterator(Parent): '\n A class for enumerated set built from an iterator.\n\n INPUT:\n\n - ``f`` -- a function that returns an iterable from which the set is built from\n\n - ``args`` -- tuple -- arguments to be sent to the function ``f``\n\n - ``kwds`` -- dictionary -- keywor...
@instancedoc class Decorator(): '\n Abstract class that manage documentation and sources of the wrapped object.\n\n The method needs to be stored in the attribute ``self.f``\n ' def _instancedoc_(self): '\n Provide documentation for the wrapped function.\n\n TESTS::\n\n ...
@instancedoc class EnumeratedSetFromIterator_function_decorator(Decorator): '\n Decorator for :class:`EnumeratedSetFromIterator`.\n\n Name could be string or a function ``(args, kwds) -> string``.\n\n .. WARNING::\n\n If you are going to use this with the decorator :func:`cached_function`,\n ...
@instancedoc class EnumeratedSetFromIterator_method_caller(Decorator): '\n Caller for decorated method in class.\n\n INPUT:\n\n - ``inst`` -- an instance of a class\n\n - ``f`` -- a method of a class of ``inst`` (and not of the instance itself)\n\n - ``name`` -- optional -- either a string (which m...
class EnumeratedSetFromIterator_method_decorator(): '\n Decorator for enumerated set built from a method.\n\n INPUT:\n\n - ``f`` -- Optional function from which are built the enumerated sets at\n each call\n\n - ``name`` -- Optional string (which may contains substitution rules from\n argume...
class DummyExampleForPicklingTest(): '\n Class example to test pickling with the decorator :class:`set_from_method`.\n\n .. WARNING::\n\n This class is intended to be used in doctest only.\n\n EXAMPLES::\n\n sage: from sage.sets.set_from_iterator import DummyExampleForPicklingTest\n ...
class TotallyOrderedFiniteSetElement(Element): '\n Element of a finite totally ordered set.\n\n EXAMPLES::\n\n sage: S = TotallyOrderedFiniteSet([2,7], facade=False)\n sage: x = S(2)\n sage: print(x)\n 2\n sage: x.parent()\n {2, 7}\n ' def __init__(self, par...
class TotallyOrderedFiniteSet(FiniteEnumeratedSet): "\n Totally ordered finite set.\n\n This is a finite enumerated set assuming that the elements are\n ordered based upon their rank (i.e. their position in the set).\n\n INPUT:\n\n - ``elements`` -- A list of elements in the set\n\n - ``facade``...
def mean(v): '\n Return the mean of the elements of `v`.\n\n We define the mean of the empty list to be the (symbolic) NaN,\n following the convention of MATLAB, Scipy, and R.\n\n This function is deprecated. Use :func:`numpy.mean` or :func:`numpy.nanmean`\n instead.\n\n INPUT:\n\n - ``v`` -...
def mode(v): "\n Return the mode of `v`.\n\n The mode is the list of the most frequently occurring\n elements in `v`. If `n` is the most times that any element occurs\n in `v`, then the mode is the list of elements of `v` that\n occur `n` times. The list is sorted if possible.\n\n This function ...
def std(v, bias=False): '\n Return the standard deviation of the elements of `v`.\n\n We define the standard deviation of the empty list to be NaN,\n following the convention of MATLAB, Scipy, and R.\n\n This function is deprecated. Use :func:`numpy.std` or :func:`numpy.nanstd`\n instead.\n\n I...
def variance(v, bias=False): '\n Return the variance of the elements of `v`.\n\n We define the variance of the empty list to be NaN,\n following the convention of MATLAB, Scipy, and R.\n\n This function is deprecated. Use :func:`numpy.var` or :func:`numpy.nanvar`\n instead.\n\n INPUT:\n\n - ...
def median(v): "\n Return the median (middle value) of the elements of `v`\n\n If `v` is empty, we define the median to be NaN, which is\n consistent with NumPy (note that R returns NULL).\n If `v` is comprised of strings, :class:`TypeError` occurs.\n For elements other than numbers, the median is ...
def moving_average(v, n): '\n Return the moving average of a list `v`.\n\n The moving average of a list is often used to smooth out noisy data.\n\n If `v` is empty, we define the entries of the moving average to be NaN.\n\n This method is deprecated. Use :meth:`pandas.Series.rolling` instead.\n\n ...
def _iter_vectors(n, lower, upper, step=None): '\n Iterate over all integer vectors of length ``n`` between ``lower`` and\n ``upper`` bound.\n\n INPUT:\n\n - ``n`` - length, integer ``>0``,\n - ``lower`` - lower bound (inclusive), integer ``< upper``.\n - ``upper`` - upper bound (exclusive), int...
class DiscreteGaussianDistributionLatticeSampler(SageObject): "\n GPV sampler for Discrete Gaussians over Lattices.\n\n EXAMPLES::\n\n sage: from sage.stats.distributions.discrete_gaussian_lattice import DiscreteGaussianDistributionLatticeSampler\n sage: D = DiscreteGaussianDistributionLattice...
class DiscreteGaussianDistributionPolynomialSampler(SageObject): "\n Discrete Gaussian sampler for polynomials.\n\n EXAMPLES::\n\n sage: from sage.stats.distributions.discrete_gaussian_polynomial import DiscreteGaussianDistributionPolynomialSampler\n sage: p = DiscreteGaussianDistributionPolyn...
def ttest(x, y, conf_level=0.95, **kw): '\n T-Test using R\n\n INPUT:\n\n - ``x``, ``y`` -- vectors of same length\n - conf_level -- confidence level of the interval, [0,1) in percent\n\n OUTPUT:\n\n Tuple: (p-value, R return object)\n\n EXAMPLES::\n\n sage: a, b = ttest([1,2,3,4,5],[1...
class CoercionException(TypeError): '\n This is the baseclass of exceptions that the coercion model raises\n when trying to discover coercions. We do not use standard Python\n exceptions to avoid inadvertently catching and suppressing real errors.\n\n Usually one raises this to indicate the attempted ...