code
stringlengths
17
6.64M
class FloatingPointGeneric(LocalGeneric): def is_floating_point(self): '\n Return whether this `p`-adic ring uses a floating point precision model.\n\n Elements in the floating point model are stored by giving a\n valuation and a unit part. Arithmetic is done where the unit\n ...
class FloatingPointRingGeneric(FloatingPointGeneric): pass
class FloatingPointFieldGeneric(FloatingPointGeneric): pass
class CappedRelativeRingGeneric(CappedRelativeGeneric): pass
class CappedRelativeFieldGeneric(CappedRelativeGeneric): pass
class pAdicLatticeGeneric(pAdicGeneric): '\n An implementation of the `p`-adic rationals with lattice precision.\n\n INPUT:\n\n - ``p`` -- the underlying prime number\n\n - ``prec`` -- the precision\n\n - ``subtype`` -- either ``"cap"`` or ``"float"``,\n specifying the precision model used for...
class pAdicRelaxedGeneric(pAdicGeneric): "\n Generic class for relaxed `p`-adics.\n\n INPUT:\n\n - ``p`` -- the underlying prime number\n\n - ``prec`` -- the default precision\n\n TESTS::\n\n sage: R = ZpER(17) # indirect doctest # needs sage.libs.fl...
class pAdicRingGeneric(pAdicGeneric, sage.rings.abc.pAdicRing): def is_field(self, proof=True): '\n Return whether this ring is actually a field, ie ``False``.\n\n EXAMPLES::\n\n sage: Zp(5).is_field()\n False\n ' return False def krull_dimension(se...
class pAdicFieldGeneric(pAdicGeneric, sage.rings.abc.pAdicField): pass
class pAdicFixedModRingGeneric(pAdicRingGeneric, FixedModGeneric): pass
class pAdicCappedAbsoluteRingGeneric(pAdicRingGeneric, CappedAbsoluteGeneric): pass
class pAdicCappedRelativeRingGeneric(pAdicRingGeneric, CappedRelativeRingGeneric): pass
class pAdicCappedRelativeFieldGeneric(pAdicFieldGeneric, CappedRelativeFieldGeneric): pass
class pAdicFloatingPointRingGeneric(pAdicRingGeneric, FloatingPointRingGeneric): pass
class pAdicFloatingPointFieldGeneric(pAdicFieldGeneric, FloatingPointFieldGeneric): pass
class pAdicRingBaseGeneric(pAdicBaseGeneric, pAdicRingGeneric): def construction(self, forbid_frac_field=False): "\n Return the functorial construction of ``self``, namely,\n completion of the rational numbers with respect to a given prime.\n\n Also preserves other information that m...
class pAdicFieldBaseGeneric(pAdicBaseGeneric, pAdicFieldGeneric): def composite(self, subfield1, subfield2): '\n Return the composite of two subfields of ``self``, i.e., the\n largest subfield containing both\n\n INPUT:\n\n - ``self`` -- a `p`-adic field\n - ``subfield1...
class pRational(): '\n This class implements rational numbers viewed as elements of ``Qp``.\n In particular, it provides additional methods which are specific to\n `p`-adics (as `p`-adic valuation).\n\n Only for internal use.\n\n INPUT:\n\n - ``p`` -- a prime number\n\n - ``x`` -- a rational ...
class DifferentialPrecisionGeneric(SageObject): "\n A generic class for precision objects obtained by automatic\n differentiation.\n\n INPUT:\n\n - ``p`` -- a prime number\n\n - ``label`` -- a string, the label of the parents to which the elements\n belong that are tracked by this precision mo...
class PrecisionLattice(UniqueRepresentation, DifferentialPrecisionGeneric): "\n A class for handling precision lattices which are used to\n track precision in the ZpLC model.\n\n The precision lattice is stored as a triangular matrix whose\n rows are generators of the lattice.\n\n INPUT:\n\n - `...
class PrecisionModule(UniqueRepresentation, DifferentialPrecisionGeneric): '\n A class for handling precision modules which are used to\n track precision in the ZpLF model.\n\n The precision module (which is not necessarily a lattice)\n is stored as a matrix whose rows are generators.\n ' def ...
class pAdicLatticeElementWeakProxy(): "\n The implementations of :class:`DifferentialPrecisionGeneric` hold\n weak references to :class:`pAdicLatticeElement`. They are stored in\n dictionaries, e.g., a dictionary that maps an element to the corresponding\n column in the precision lattice matrix.\n ...
def list_of_padics(elements): '\n Convert a list of `p`-adic composed elements (such as polynomials, matrices)\n to a list of weak references of their `p`-adic coefficients.\n\n This is a helper function for the method :meth:`precision_lattice`.\n\n TESTS::\n\n sage: from sage.rings.padics.latt...
class LocalGeneric(CommutativeRing): def __init__(self, base, prec, names, element_class, category=None): "\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: R = Zp(5) # indirect doctest\n sage: R.precision_cap()\n 20\n\n In :trac:`14084`, the category...
def gauss_sum(a, p, f, prec=20, factored=False, algorithm='pari', parent=None): '\n Return the Gauss sum `g_q(a)` as a `p`-adic number.\n\n The Gauss sum `g_q(a)` is defined by\n\n .. MATH::\n\n g_q(a)= \\sum_{u\\in F_q^*} \\omega(u)^{-a} \\zeta_q^u,\n\n where `q = p^f`, `\\omega` is the Teichm...
def min(*L): '\n Return the minimum of the inputs, where the minimum of the empty\n list is `\\infty`.\n\n EXAMPLES::\n\n sage: from sage.rings.padics.misc import min\n sage: min()\n +Infinity\n sage: min(2,3)\n 2\n ' if ((len(L) == 1) and isinstance(L[0], (list,...
def max(*L): '\n Return the maximum of the inputs, where the maximum of the empty\n list is `-\\infty`.\n\n EXAMPLES::\n\n sage: from sage.rings.padics.misc import max\n sage: max()\n -Infinity\n sage: max(2,3)\n 3\n ' if ((len(L) == 1) and isinstance(L[0], (list...
def precprint(prec_type, prec_cap, p): "\n String describing the precision mode on a p-adic ring or field.\n\n EXAMPLES::\n\n sage: from sage.rings.padics.misc import precprint\n sage: precprint('capped-rel', 12, 2)\n 'with capped relative precision 12'\n sage: precprint('capped-...
def trim_zeros(L): '\n Strips trailing zeros/empty lists from a list.\n\n EXAMPLES::\n\n sage: from sage.rings.padics.misc import trim_zeros\n sage: trim_zeros([1,0,1,0])\n [1, 0, 1]\n sage: trim_zeros([[1],[],[2],[],[]])\n [[1], [], [2]]\n sage: trim_zeros([[],[]])...
class pAdicBaseGeneric(pAdicGeneric): _implementation = 'GMP' def __init__(self, p, prec, print_mode, names, element_class): '\n Initialization\n\n TESTS::\n\n sage: R = Zp(5) # indirect doctest\n ' if self.is_relaxed(): from sage.rings.padics.pow_...
class pAdicRingCappedRelative(pAdicRingBaseGeneric, pAdicCappedRelativeRingGeneric): '\n An implementation of the `p`-adic integers with capped relative\n precision.\n ' def __init__(self, p, prec, print_mode, names): "\n Initialization.\n\n INPUT:\n\n - ``p`` -- prime\n...
class pAdicRingCappedAbsolute(pAdicRingBaseGeneric, pAdicCappedAbsoluteRingGeneric): '\n An implementation of the `p`-adic integers with capped absolute precision.\n ' def __init__(self, p, prec, print_mode, names): "\n Initialization.\n\n INPUT:\n\n - ``p`` -- prime\n ...
class pAdicRingFloatingPoint(pAdicRingBaseGeneric, pAdicFloatingPointRingGeneric): '\n An implementation of the `p`-adic integers with floating point\n precision.\n ' def __init__(self, p, prec, print_mode, names): "\n Initialization.\n\n INPUT:\n\n - ``p`` -- prime\n ...
class pAdicRingFixedMod(pAdicRingBaseGeneric, pAdicFixedModRingGeneric): '\n An implementation of the `p`-adic integers using fixed modulus.\n ' def __init__(self, p, prec, print_mode, names): "\n Initialization\n\n INPUT:\n\n - ``p`` -- prime\n - ``prec`` -- precisi...
class pAdicFieldCappedRelative(pAdicFieldBaseGeneric, pAdicCappedRelativeFieldGeneric): '\n An implementation of `p`-adic fields with capped relative precision.\n\n EXAMPLES::\n\n sage: K = Qp(17, 1000000) # indirect doctest\n sage: K = Qp(101) # indirect doctest\n\n ' def __init__(s...
class pAdicFieldFloatingPoint(pAdicFieldBaseGeneric, pAdicFloatingPointFieldGeneric): '\n An implementation of the `p`-adic rationals with floating point\n precision.\n ' def __init__(self, p, prec, print_mode, names): "\n Initialization.\n\n INPUT:\n\n - ``p`` -- prime\...
class pAdicRingLattice(pAdicLatticeGeneric, pAdicRingBaseGeneric): "\n An implementation of the `p`-adic integers with lattice precision.\n\n INPUT:\n\n - ``p`` -- prime\n\n - ``prec`` -- precision cap, given as a pair (``relative_cap``, ``absolute_cap``)\n\n - ``subtype`` -- either ``'cap'`` or ``...
class pAdicFieldLattice(pAdicLatticeGeneric, pAdicFieldBaseGeneric): "\n An implementation of the `p`-adic numbers with lattice precision.\n\n INPUT:\n\n - ``p`` -- prime\n\n - ``prec`` -- precision cap, given as a pair (``relative_cap``, ``absolute_cap``)\n\n - ``subtype`` -- either ``'cap'`` or `...
class pAdicRingRelaxed(pAdicRelaxedGeneric, pAdicRingBaseGeneric): "\n An implementation of relaxed arithmetics over `\\ZZ_p`.\n\n INPUT:\n\n - ``p`` -- prime\n\n - ``prec`` -- default precision\n\n - ``print_mode`` -- dictionary with print options\n\n - ``names`` -- how to print the prime\n\n ...
class pAdicFieldRelaxed(pAdicRelaxedGeneric, pAdicFieldBaseGeneric): "\n An implementation of relaxed arithmetics over `\\QQ_p`.\n\n INPUT:\n\n - ``p`` -- prime\n\n - ``prec`` -- default precision\n\n - ``print_mode`` -- dictionary with print options\n\n - ``names`` -- how to print the prime\n\n...
class pAdicExtensionGeneric(pAdicGeneric): def __init__(self, poly, prec, print_mode, names, element_class): '\n Initialization\n\n EXAMPLES::\n\n sage: R = Zp(5,5)\n sage: S.<x> = R[]\n sage: f = x^5 + 75*x^3 - 15*x^2 +125*x - 5\n sage: W.<w> = R...
class pAdicModuleIsomorphism(Map): '\n A base class for various isomorphisms between p-adic rings/fields and free modules\n\n EXAMPLES::\n\n sage: K.<a> = Qq(125)\n sage: V, fr, to = K.free_module()\n sage: from sage.rings.padics.padic_extension_generic import pAdicModuleIsomorphism\n ...
class MapFreeModuleToOneStep(pAdicModuleIsomorphism): "\n The isomorphism from the underlying module of a one-step p-adic extension\n to the extension.\n\n EXAMPLES::\n\n sage: K.<a> = Qq(125)\n sage: V, fr, to = K.free_module()\n sage: TestSuite(fr).run(skip=['_test_nonzero_equal'])...
class MapOneStepToFreeModule(pAdicModuleIsomorphism): '\n The isomorphism from a one-step p-adic extension to its underlying free module\n\n EXAMPLES::\n\n sage: K.<a> = Qq(125)\n sage: V, fr, to = K.free_module()\n sage: TestSuite(to).run()\n ' def _call_(self, x): '\n ...
class MapFreeModuleToTwoStep(pAdicModuleIsomorphism): "\n The isomorphism from the underlying module of a two-step p-adic extension\n to the extension.\n\n EXAMPLES::\n\n sage: K.<a> = Qq(125)\n sage: R.<x> = ZZ[]\n sage: L.<b> = K.extension(x^2 - 5*x + 5)\n sage: V, fr, to = ...
class MapTwoStepToFreeModule(pAdicModuleIsomorphism): '\n The isomorphism from a two-step p-adic extension to its underlying free module\n\n EXAMPLES::\n\n sage: K.<a> = Qq(125)\n sage: R.<x> = ZZ[]\n sage: L.<b> = K.extension(x^2 - 5*x + 5)\n sage: V, fr, to = L.free_module(base...
class DefPolyConversion(Morphism): "\n Conversion map between p-adic rings/fields with the same defining polynomial.\n\n INPUT:\n\n - ``R`` -- a p-adic extension ring or field.\n - ``S`` -- a p-adic extension ring or field with the same defining polynomial.\n\n EXAMPLES::\n\n sage: R.<a> = Z...
def _make_integral_poly(exact_modulus, p, prec): '\n Convert a defining polynomial into one with integral coefficients.\n\n INPUT:\n\n - ``exact_modulus`` -- a univariate polynomial\n\n - ``p`` -- a prime\n\n - ``prec`` -- the precision\n\n EXAMPLES::\n\n sage: from sage.rings.padics.padi...
class UnramifiedExtensionRingCappedRelative(UnramifiedExtensionGeneric, pAdicCappedRelativeRingGeneric): "\n TESTS::\n\n sage: R.<a> = ZqCR(27,1000) # needs sage.libs.ntl\n sage: TestSuite(R).run(skip='_test_log',max_runs=4) ...
class UnramifiedExtensionFieldCappedRelative(UnramifiedExtensionGeneric, pAdicCappedRelativeFieldGeneric): "\n TESTS::\n\n sage: R.<a> = QqCR(27,1000) # needs sage.libs.ntl\n sage: TestSuite(R).run(skip='_test_log',max_runs=4) ...
class UnramifiedExtensionRingCappedAbsolute(UnramifiedExtensionGeneric, pAdicCappedAbsoluteRingGeneric): "\n TESTS::\n\n sage: R.<a> = ZqCA(27,1000) # needs sage.libs.flint\n sage: TestSuite(R).run(skip='_test_log',max_runs=4) ...
class UnramifiedExtensionRingFixedMod(UnramifiedExtensionGeneric, pAdicFixedModRingGeneric): "\n TESTS::\n\n sage: R.<a> = ZqFM(27,1000) # needs sage.libs.flint\n sage: TestSuite(R).run(skip='_test_log',max_runs=4) # long time # ...
class UnramifiedExtensionRingFloatingPoint(UnramifiedExtensionGeneric, pAdicFloatingPointRingGeneric): '\n TESTS::\n\n sage: R.<a> = ZqFP(27,10000); R == loads(dumps(R)) # needs sage.libs.flint\n True\n ' def __init__(self, exact_modulus, poly, prec, print_mod...
class UnramifiedExtensionFieldFloatingPoint(UnramifiedExtensionGeneric, pAdicFloatingPointFieldGeneric): '\n TESTS::\n\n sage: R.<a> = QqFP(27,10000); R == loads(dumps(R)) # needs sage.libs.flint\n True\n ' def __init__(self, exact_modulus, poly, prec, print_m...
class EisensteinExtensionRingCappedRelative(EisensteinExtensionGeneric, pAdicCappedRelativeRingGeneric): "\n TESTS::\n\n sage: R = Zp(3, 1000, print_pos=False); S.<x> = ZZ[]; f = x^3 + 9*x - 3\n sage: W.<w> = R.ext(f) # needs sage.libs.ntl ...
class EisensteinExtensionFieldCappedRelative(EisensteinExtensionGeneric, pAdicCappedRelativeFieldGeneric): "\n TESTS::\n\n sage: R = Qp(3, 1000, print_pos=False); S.<x> = ZZ[]; f = x^3 + 9*x - 3\n sage: W.<w> = R.ext(f) # needs sage.libs.nt...
class EisensteinExtensionRingCappedAbsolute(EisensteinExtensionGeneric, pAdicCappedAbsoluteRingGeneric): "\n TESTS::\n\n sage: R = ZpCA(3, 1000, print_pos=False); S.<x> = ZZ[]; f = x^3 + 9*x - 3\n sage: W.<w> = R.ext(f) # needs sage.libs.nt...
class EisensteinExtensionRingFixedMod(EisensteinExtensionGeneric, pAdicFixedModRingGeneric): "\n TESTS::\n\n sage: R = ZpFM(3, 1000, print_pos=False); S.<x> = ZZ[]; f = x^3 + 9*x - 3\n sage: W.<w> = R.ext(f) # needs sage.libs.ntl sage.rings...
class pAdicGeneric(PrincipalIdealDomain, LocalGeneric): def __init__(self, base, p, prec, print_mode, names, element_class, category=None): '\n Initialize ``self``.\n\n INPUT:\n\n - ``base`` -- base ring\n - ``p`` -- prime\n - ``print_mode`` -- dictionary of print optio...
class ResidueReductionMap(Morphism): '\n Reduction map from a p-adic ring or field to its residue field or ring.\n\n These maps must be created using the :meth:`_create_` method in order\n to support categories correctly.\n\n EXAMPLES::\n\n sage: from sage.rings.padics.padic_generic import Resi...
class ResidueLiftingMap(Morphism): '\n Lifting map to a p-adic ring or field from its residue field or ring.\n\n These maps must be created using the :meth:`_create_` method in order\n to support categories correctly.\n\n EXAMPLES::\n\n sage: from sage.rings.padics.padic_generic import ResidueL...
def local_print_mode(obj, print_options, pos=None, ram_name=None): "\n Context manager for safely temporarily changing the print_mode\n of a p-adic ring/field.\n\n EXAMPLES::\n\n sage: R = Zp(5)\n sage: R(45)\n 4*5 + 5^2 + O(5^21)\n sage: with local_print_mode(R, 'val-unit'):\...
def unpickle_le(parent, value, prec): '\n Unpickle `p`-adic elements.\n\n INPUT:\n\n - ``parent`` -- the parent, a `p`-adic ring\n\n - ``value`` -- a rational number\n\n - ``prec`` -- an integer\n\n EXAMPLES::\n\n sage: from sage.rings.padics.padic_lattice_element import unpickle_le\n ...
class pAdicLatticeElement(pAdicGenericElement): '\n Constructs new element with given parent and value.\n\n INPUT:\n\n - ``parent`` -- the parent of this element\n\n - ``x`` -- the newly created element\n\n - ``prec`` -- an integer; the absolute precision at which this\n element has to be capp...
class pAdicLatticeCapElement(pAdicLatticeElement): def _declare_new_element(self, dx, prec, dx_mode): '\n Declare this element to the precision object and\n return the precision at which this element can be truncated safely.\n\n Only for internal use.\n\n TESTS::\n\n ...
class pAdicLatticeFloatElement(pAdicLatticeElement): def _declare_new_element(self, dx, prec, dx_mode): '\n Declare this element to the precision object and\n return the precision at which this element can be truncated safely.\n\n Only for internal use.\n\n TESTS::\n\n ...
class PadicValuationFactory(UniqueFactory): '\n Create a ``prime``-adic valuation on ``R``.\n\n INPUT:\n\n - ``R`` -- a subring of a number field or a subring of a local field in\n characteristic zero\n\n - ``prime`` -- a prime that does not split, a discrete (pseudo-)valuation,\n a fraction...
class pAdicValuation_base(DiscreteValuation): '\n Abstract base class for `p`-adic valuations.\n\n INPUT:\n\n - ``ring`` -- an integral domain\n\n - ``p`` -- a rational prime over which this valuation lies, not\n necessarily a uniformizer for the valuation\n\n EXAMPLES::\n\n sage: ZZ.va...
class pAdicValuation_padic(pAdicValuation_base): '\n The `p`-adic valuation of a complete `p`-adic ring.\n\n INPUT:\n\n - ``R`` -- a `p`-adic ring\n\n EXAMPLES::\n\n sage: v = Qp(2).valuation(); v # indirect doctest\n 2-adic valuation\n\n TESTS::\n\n sage: TestSuite(v).run() ...
class pAdicValuation_int(pAdicValuation_base): '\n A `p`-adic valuation on the integers or the rationals.\n\n EXAMPLES::\n\n sage: v = ZZ.valuation(3); v\n 3-adic valuation\n\n TESTS::\n\n sage: TestSuite(v).run() # long time # needs sage.ge...
class pAdicFromLimitValuation(FiniteExtensionFromLimitValuation, pAdicValuation_base): "\n A `p`-adic valuation on a number field or a subring thereof, i.e., a\n valuation that extends the `p`-adic valuation on the integers.\n\n EXAMPLES::\n\n sage: v = GaussianIntegers().valuation(3); v ...
def _fraction_field(ring): '\n Return a fraction field of ``ring``.\n\n EXAMPLES:\n\n This works around some annoyances with ``ring.fraction_field()``::\n\n sage: R.<x> = ZZ[]\n sage: S = R.quo(x^2 + 1)\n sage: S.fraction_field()\n Fraction Field of Univariate Quotient Polynom...
class PrecisionError(ArithmeticError): pass
class pAdicRelativeBaseringInjection(Morphism): '\n The injection of the unramified base into the two-step extension.\n\n INPUT:\n\n - ``R`` -- an unramified `p`-adic ring or field\n - ``S`` -- an eisenstein extension of ``R``.\n\n EXAMPLES::\n\n sage: # needs sage.libs.ntl\n sage: K....
class pAdicRelativeBaseringSection(Morphism): '\n The map from a two-step extension back to its maximal unramified subextension.\n\n EXAMPLES::\n\n sage: # needs sage.libs.ntl\n sage: K.<a> = Qq(2^10)\n sage: R.<x> = K[]\n sage: W.<w> = K.extension(x^4 + 2*a*x^2 - 16*x - 6)\n ...
class RelativeRamifiedExtensionRingFixedMod(EisensteinExtensionGeneric, pAdicFixedModRingGeneric): '\n Two-step extension ring with fixed-mod precision.\n\n EXAMPLES::\n\n sage: # needs sage.libs.flint\n sage: A.<a> = ZqFM(2^10)\n sage: R.<x> = A[]\n sage: W.<w> = A.extension(x^4...
class RelativeRamifiedExtensionRingCappedAbsolute(EisensteinExtensionGeneric, pAdicCappedAbsoluteRingGeneric): '\n Two-step extension ring with capped absolute precision.\n\n EXAMPLES::\n\n sage: # needs sage.libs.flint\n sage: A.<a> = ZqCA(2^10)\n sage: R.<x> = A[]\n sage: W.<w>...
class RelativeRamifiedExtensionRingCappedRelative(EisensteinExtensionGeneric, pAdicCappedRelativeRingGeneric): '\n Two-step extension ring with capped relative precision.\n\n EXAMPLES::\n\n sage: # needs sage.libs.ntl\n sage: A.<a> = ZqCR(2^10)\n sage: R.<x> = A[]\n sage: W.<w> =...
class RelativeRamifiedExtensionFieldCappedRelative(EisensteinExtensionGeneric, pAdicCappedRelativeFieldGeneric): '\n Two-step extension field with capped relative precision.\n\n EXAMPLES::\n\n sage: # needs sage.libs.ntl\n sage: A.<a> = QqCR(2^10)\n sage: R.<x> = A[]\n sage: W.<w...
class RelativeRamifiedExtensionRingFloatingPoint(EisensteinExtensionGeneric, pAdicFloatingPointRingGeneric): '\n Two-step extension ring with floating point precision.\n\n EXAMPLES::\n\n sage: # needs sage.libs.flint\n sage: A.<a> = ZqFP(2^10)\n sage: R.<x> = A[]\n sage: W.<w> = ...
class RelativeRamifiedExtensionFieldFloatingPoint(EisensteinExtensionGeneric, pAdicFloatingPointFieldGeneric): '\n Two-step extension field with floating point precision.\n\n EXAMPLES::\n\n sage: # needs sage.libs.flint\n sage: A.<a> = QqFP(2^10)\n sage: R.<x> = A[]\n sage: W.<w>...
class UnramifiedExtensionGeneric(pAdicExtensionGeneric): '\n An unramified extension of `\\QQ_p` or `\\ZZ_p`.\n ' def __init__(self, poly, prec, print_mode, names, element_class): '\n Initializes ``self``.\n\n INPUT:\n\n - ``poly`` -- Polynomial defining this extension.\n ...
class Pari(RingElement): '\n Element of Pari pseudo-ring.\n ' def __init__(self, x, parent=None): "\n EXAMPLES::\n\n sage: R = PariRing()\n sage: f = R('x^3 + 1/2')\n sage: f\n x^3 + 1/2\n sage: type(f)\n <class 'sage.ring...
class PariRing(Singleton, ring.Ring): '\n EXAMPLES::\n\n sage: R = PariRing(); R\n Pseudoring of all PARI objects.\n sage: loads(R.dumps()) is R\n True\n ' Element = Pari def __init__(self): ring.Ring.__init__(self, self) def __repr__(self): return '...
def covariant_z0(F, z0_cov=False, prec=53, emb=None, error_limit=1e-06): '\n Return the covariant and Julia invariant from Cremona-Stoll [CS2003]_.\n\n In [CS2003]_ and [HS2018]_ the Julia invariant is denoted as `\\Theta(F)`\n or `R(F, z(F))`. Note that you may get faster convergence if you first move\n...
def epsinv(F, target, prec=53, target_tol=0.001, z=None, emb=None): '\n Compute a bound on the hyperbolic distance.\n\n The true minimum will be within the computed bound.\n It is computed as the inverse of epsilon_F from [HS2018]_.\n\n INPUT:\n\n - ``F`` -- binary form of degree at least 3 with no...
def get_bound_poly(F, prec=53, norm_type='norm', emb=None): "\n The hyperbolic distance from `j` which must contain the smallest poly.\n\n This defines the maximum possible distance from `j` to the `z_0` covariant\n in the hyperbolic 3-space for which the associated `F` could have smaller\n coefficien...
def smallest_poly(F, prec=53, norm_type='norm', emb=None): "\n Determine the poly with smallest coefficients in `SL(2,\\Z)` orbit of ``F``\n\n Smallest can be in the sense of `L_2` norm or height.\n The method is the algorithm in Hutz-Stoll [HS2018]_.\n\n ``F`` needs to be a binary form with no multip...
def interval_roots(p, rts, prec): '\n We are given a squarefree polynomial p, a list of estimated roots,\n and a precision.\n\n We attempt to verify that the estimated roots are in fact distinct\n roots of the polynomial, using interval arithmetic of precision prec.\n If we succeed, we return a lis...
def intervals_disjoint(intvs): '\n Given a list of complex intervals, check whether they are pairwise\n disjoint.\n\n EXAMPLES::\n\n sage: from sage.rings.polynomial.complex_roots import intervals_disjoint\n sage: a = CIF(RIF(0, 3), 0)\n sage: b = CIF(0, RIF(1, 3))\n sage: c =...
def complex_roots(p, skip_squarefree=False, retval='interval', min_prec=0): "\n Compute the complex roots of a given polynomial with exact\n coefficients (integer, rational, Gaussian rational, and algebraic\n coefficients are supported). Returns a list of pairs of a root\n and its multiplicity.\n\n ...
def convolution(L1, L2): '\n Return convolution of non-empty lists L1 and L2.\n\n L1 and L2 may have arbitrary lengths.\n\n EXAMPLES::\n\n sage: convolution([1, 2, 3], [4, 5, 6, 7])\n [4, 13, 28, 34, 32, 21]\n\n TESTS::\n\n sage: R = Integers(47)\n sage: L1 = [R.random_elem...
def _convolution_naive(L1, L2): '\n Return convolution of non-empty lists L1 and L2, using naive algorithm.\n\n L1 and L2 may have arbitrary lengths.\n\n EXAMPLES::\n\n sage: from sage.rings.polynomial.convolution import _convolution_naive\n sage: _convolution_naive([2], [3])\n [6]\n...
def _negaconvolution_naive(L1, L2): '\n Negacyclic convolution of L1 and L2, using naive algorithm.\n\n L1 and L2 must be the same length.\n\n EXAMPLES::\n\n sage: from sage.rings.polynomial.convolution import _negaconvolution_naive\n sage: from sage.rings.polynomial.convolution import _con...
def _forward_butterfly(L1, L2, r): '\n L1 and L2 are both lists of length K, and\n `0 \\leq r \\leq K`. They represent polynomials in\n `S = R[y]/(y^K + 1)`. This function returns\n `(L_1 + y^r L_2, L_1 - y^r L_2)`, as a list.\n ' assert (len(L1) == len(L2)) assert (0 <= r <= len(L1)) K...
def _inverse_butterfly(L1, L2, r): '\n L1 and L2 are both lists of length `K`, and\n `0 \\leq r \\leq K`. They represent polynomials in\n `S = R[y]/(y^K + 1)`. This function returns\n `(L_1 + L_2, y^{-r}*(L_1 - L_2))`, as a list.\n ' assert (len(L1) == len(L2)) assert (0 <= r <= len(L1)) ...
def _fft(L, K, start, depth, root): '\n L is a list of length `M = 2^m`, each entry a list of\n length `K = 2^k`.\n\n This function only operates on the [start, start + D) portion of L,\n where `D = 2^\\text{depth}`. This portion is interpreted as\n a polynomial in `S[x]/(x^D - y^(2*root))`, where\...
def _ifft(L, K, start, depth, root): '\n Inverse operation of ``_fft_trunc()`` (except that\n result is a factor of ``2^depth`` too big)\n ' half = (1 << (depth - 1)) start2 = (start + half) if (depth >= 2): _ifft(L, K, start, (depth - 1), (root >> 1)) _ifft(L, K, start2, (dep...
def _split(L, m, k): '\n Assumes L is a list of length `2^{m+k-1}`. Splits it into\n `2^m` lists of length `2^{k-1}`, returned as a list\n of lists. Each list is zero padded up to length `2^k`.\n\n EXAMPLES::\n\n sage: from sage.rings.polynomial.convolution import _split\n sage: _split([...
def _combine(L, m, k): '\n Assumes L is a list of length `2^m`, each entry a list of\n length `2^k`. Combines together into a single list,\n effectively inverting ``_split()``, but overlaying\n coefficients, i.e. list #i gets added in starting at position\n `2^{k-1} i`. Note that the second half of...