rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
computed bound is greater than a value set by the eclib | computed bound is greater than a value set by the ``eclib`` | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
- ``odd_primes_only`` (bool, default False) -- only do | - ``odd_primes_only`` (bool, default ``False``) -- only do | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
via 2-descent they should alreday be 2-saturated.) | via :meth:``two_descent()`` they should already be 2-saturated.) | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
- ``ok`` (bool) is True if and only if the saturation was | - ``ok`` (bool) -- ``True`` if and only if the saturation was | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
the computed saturation bound being too high, then True indicates that the subgroup is saturated at `\emph{all}` | the computed saturation bound being too high, then ``True`` indicates that the subgroup is saturated at *all* | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
- ``index`` (int) is the index of the group generated by the | - ``index`` (int) -- the index of the group generated by the | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
uses floating points methods based on elliptic logarithms to | uses floating point methods based on elliptic logarithms to | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
We emphasize that if this function returns True as the first return argument, and if the default was used for the parameter ``sat_bnd``, then the points in the basis after calling this function are saturated at `\emph{all}` primes, | We emphasize that if this function returns ``True`` as the first return argument (``ok``), and if the default was used for the parameter ``max_prime``, then the points in the basis after calling this function are saturated at *all* primes, | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
saturate up to, and that prime is `\leq` ``max_prime``. | saturate up to, and that prime might be smaller than ``max_prime``. | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
calling search. So calling search up to height 20 then calling saturate results in another search up to height 18. | calling :meth:`search()`. So calling :meth:`search()` up to height 20 then calling :meth:`saturate()` results in another search up to height 18. | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
Subgroup of Mordell Weil group: [[1547:-2967:343], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]] | Subgroup of Mordell-Weil group: [[1547:-2967:343], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]] | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
Subgroup of Mordell Weil group: [[-2:3:1], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]] | Subgroup of Mordell-Weil group: [[-2:3:1], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]] | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
Subgroup of Mordell Weil group: [[-2:3:1], [-14:25:8], [-13422227300:-49322830557:12167000000]] | Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [-13422227300:-49322830557:12167000000]] | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
Subgroup of Mordell Weil group: [[-2:3:1], [-14:25:8], [1:-1:1]] | Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [1:-1:1]] | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
Of course, the ``process`` function would have done all this | Of course, the :meth:`process()` function would have done all this | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
But we would still need to use the ``saturate`` function to | But we would still need to use the :meth:`saturate()` function to | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
side-effect. It proves that the inde of the points in their | side-effect. It proves that the index of the points in their | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
by reducing the poits modulo all primes of good reduction up | by reducing the points modulo all primes of good reduction up | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... |
On 32-bit machines, this MUST be < 21.48 else $\exp(h_lim)>2^31$ and overflows. On 64-bit machines it must be at most 43.668. However, this bound is a logarithic | On 32-bit machines, this *must* be < 21.48 else `\exp(h_{\text{lim}}) > 2^{31}` and overflows. On 64-bit machines, it must be *at most* 43.668. However, this bound is a logarithmic | def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. |
Subgroup of Mordell Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]] In the next example, a serach bound of 12 is needed to find a non-torsin point:: | Subgroup of Mordell-Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]] In the next example, a search bound of 12 is needed to find a non-torsion point:: | def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. |
Subgroup of Mordell Weil group: [] | Subgroup of Mordell-Weil group: [] | def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. |
Subgroup of Mordell Weil group: [[4413270:10381877:27000]] | Subgroup of Mordell-Weil group: [[4413270:10381877:27000]] | def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. |
verbose == bool(verbose) | verbose = bool(verbose) | def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. |
(list) a list of lists of length 3, each holding the | (list) A list of lists of length 3, each holding the | def points(self): """ Return a list of the generating points in this Mordell-Weil group. |
be overfull if : - `n` is odd - It satisfies `2m > (n-1)\Delta(G)`, where `\Delta(G)` denotes the maximal degree of a vertex in `G` | be overfull if: - `n` is odd - It satisfies `2m > (n-1)\Delta(G)`, where `\Delta(G)` denotes the maximum degree among all vertices in `G`. | def is_overfull(self): r""" Tests whether the current graph is overfull. |
EXAMPLE: A complete graph is overfull if and only if its number of vertices is odd:: | EXAMPLES: A complete graph of order `n > 1` is overfull if and only if `n` is odd:: | def is_overfull(self): r""" Tests whether the current graph is overfull. |
return (self.order() % 2 == 1) and \ (2*self.size() > max(self.degree())*(self.order()-1)) | return (self.order() % 2 == 1) and ( 2 * self.size() > max(self.degree()) * (self.order() - 1)) | def is_overfull(self): r""" Tests whether the current graph is overfull. |
To see a list of all word constructors, type "words." and then | To see a list of all word constructors, type ``words.`` and then | def __new__(cls, *args, **kwds): r""" TEST: sage: from sage.combinat.words.word_generators import ChristoffelWord_Lower sage: w = ChristoffelWord_Lower(1,0); w doctest:1: DeprecationWarning: ChristoffelWord_Lower is deprecated, use LowerChristoffelWord instead word: 1 """ from sage.misc.misc import deprecation deprecat... |
This function returns the part of the fractional ideal self which is coprime to the prime ideals in the list S NOTE: This function assumes S is a list of prime ideals, it does not check this. This function will fail if S is not a list of prime ideals. | Return the part of this fractional ideal which is coprime to the prime ideals in the list ``S``. .. note:: This function assumes that `S` is a list of prime ideals, but does not check this. This function will fail if `S` is not a list of prime ideals. | def prime_to_S_part(self,S): r""" This function returns the part of the fractional ideal self which is coprime to the prime ideals in the list S NOTE: This function assumes S is a list of prime ideals, it does not check this. This function will fail if S is not a list of prime ideals. INPUT: - "self" - fractional ide... |
- "self" - fractional ideal - "S" - a list of prime ideals | - `S` - a list of prime ideals | def prime_to_S_part(self,S): r""" This function returns the part of the fractional ideal self which is coprime to the prime ideals in the list S NOTE: This function assumes S is a list of prime ideals, it does not check this. This function will fail if S is not a list of prime ideals. INPUT: - "self" - fractional ide... |
- an ideal coprime to the ideals in S | A fractional ideal coprime to the primes in `S`, whose prime factorization is that of ``self`` withe the primes in `S` removed. | def prime_to_S_part(self,S): r""" This function returns the part of the fractional ideal self which is coprime to the prime ideals in the list S NOTE: This function assumes S is a list of prime ideals, it does not check this. This function will fail if S is not a list of prime ideals. INPUT: - "self" - fractional ide... |
r''' Returns True if the ideal is an unit with respect to the list of primes S. INPUT:: - `S` - a list of prime ideals (not checked if they are indeed prime). OUTPUT:: True, if the ideal is `S`-unit. False, otherwise. | r""" Return True if this fractional ideal is a unit with respect to the list of primes ``S``. INPUT: - `S` - a list of prime ideals (not checked if they are indeed prime). .. note:: This function assumes that `S` is a list of prime ideals, but does not check this. This function will fail if `S` is not a list of pr... | def is_S_unit(self,S): r''' Returns True if the ideal is an unit with respect to the |
''' | """ | def is_S_unit(self,S): r''' Returns True if the ideal is an unit with respect to the |
r''' Returns True if the ideal is an unit with respect to the list of primes S. INPUT:: - `S` - a list of prime ideals (not checked if they are indeed prime). OUTPUT:: True, if the ideal is `S`-integral. False, otherwise. | r""" Return True if this fractional ideal is integral with respect to the list of primes ``S``. INPUT: - `S` - a list of prime ideals (not checked if they are indeed prime). .. note:: This function assumes that `S` is a list of prime ideals, but does not check this. This function will fail if `S` is not a list of ... | def is_S_integral(self,S): r''' Returns True if the ideal is an unit with respect to the |
''' | """ | def is_S_integral(self,S): r''' Returns True if the ideal is an unit with respect to the |
EXAMPLES: | Load and *execute* the content of ``filename`` in Macaulay2. :param filename: the name of the file to be loaded and executed. :type filename: string :returns: Macaulay2 command loading and executing commands in ``filename``, that is, ``'load "filename"'``. :rtype: string TESTS:: | def _read_in_file_command(self, filename): """ EXAMPLES: sage: from sage.misc.misc import tmp_filename sage: filename = tmp_filename() sage: f = open(filename, "w") sage: f.write("Hello") sage: f.close() sage: command = macaulay2._read_in_file_command(filename) sage: macaulay2.eval(command) #optional Hello sage: impor... |
sage: f.write("Hello") | sage: f.write("sage_test = 7;") | def _read_in_file_command(self, filename): """ EXAMPLES: sage: from sage.misc.misc import tmp_filename sage: filename = tmp_filename() sage: f = open(filename, "w") sage: f.write("Hello") sage: f.close() sage: command = macaulay2._read_in_file_command(filename) sage: macaulay2.eval(command) #optional Hello sage: impor... |
Hello | sage: macaulay2.eval("sage_test") 7 | def _read_in_file_command(self, filename): """ EXAMPLES: sage: from sage.misc.misc import tmp_filename sage: filename = tmp_filename() sage: f = open(filename, "w") sage: f.write("Hello") sage: f.close() sage: command = macaulay2._read_in_file_command(filename) sage: macaulay2.eval(command) #optional Hello sage: impor... |
""" return 'get "%s"'%filename | sage: macaulay2._read_in_file_command("test") 'load "test"' sage: macaulay2(10^10000) == 10^10000 True """ return 'load "%s"' % filename | def _read_in_file_command(self, filename): """ EXAMPLES: sage: from sage.misc.misc import tmp_filename sage: filename = tmp_filename() sage: f = open(filename, "w") sage: f.write("Hello") sage: f.close() sage: command = macaulay2._read_in_file_command(filename) sage: macaulay2.eval(command) #optional Hello sage: impor... |
(\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (`$ or $`), because of strings like | (\\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (\`$ or \$`), because of strings like | def process_dollars(s): r"""nodetex Replace dollar signs with backticks. More precisely, do a regular expression search. Replace a plain dollar sign ($) by a backtick (`). Replace an escaped dollar sign (\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (`$ or $`), because of s... |
Replace \$ with $, and don't do anything when backticks are involved:: | Replace \\$ with $, and don't do anything when backticks are involved:: | def process_dollars(s): r"""nodetex Replace dollar signs with backticks. More precisely, do a regular expression search. Replace a plain dollar sign ($) by a backtick (`). Replace an escaped dollar sign (\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (`$ or $`), because of s... |
This is not perfect: | This is not perfect:: | def process_dollars(s): r"""nodetex Replace dollar signs with backticks. More precisely, do a regular expression search. Replace a plain dollar sign ($) by a backtick (`). Replace an escaped dollar sign (\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (`$ or $`), because of s... |
Replace \mathtt{BLAH} with either \verb|BLAH| (in the notebook) or | Replace \\mathtt{BLAH} with either \\verb|BLAH| (in the notebook) or | def process_mathtt(s, embedded=False): r"""nodetex Replace \mathtt{BLAH} with either \verb|BLAH| (in the notebook) or BLAH (from the command line). INPUT: - ``s`` - string, in practice a docstring - ``embedded`` - boolean (optional, default False) This function is called by :func:`format`, and if in the notebook, it... |
.. rubric:: Migrating classes to :class:`UniqueRepresentation` and unpickling | .. rubric:: Migrating classes to ``UniqueRepresentation`` and unpickling | ... def __reduce__(self): |
Normalization of arguments; see :cls:`UniqueRepresentation`. | Normalization of arguments; see :class:`UniqueRepresentation`. | def __classcall_private__(cls, fam, facade=True, keepkey=False): # was *args, **options): """ Normalization of arguments; see :cls:`UniqueRepresentation`. |
Morphism from module over Integer Ring with invariants (2, 0, 0) to module with invariants (0, 0, 0) that sends the generators to [(0, 0, 0), (0, 0, 1), (0, 1, 0)] | Morphism from module over Integer Ring with invariants (2, 0, 0) to module with invariants (0, 0, 0) that sends the generators to [(0, 0, 0), (1, 0, 0), (0, 1, 0)] | def hom(self, im_gens, codomain=None, check=True): """ Homomorphism defined by giving the images of ``self.gens()`` in some fixed fg R-module. .. note :: We do not assume that the generators given by ``self.gens()`` are the same as the Smith form generators, since this may not be true for a general derived class. IN... |
(0, 0, 1) | (1, 0, 0) | def hom(self, im_gens, codomain=None, check=True): """ Homomorphism defined by giving the images of ``self.gens()`` in some fixed fg R-module. .. note :: We do not assume that the generators given by ``self.gens()`` are the same as the Smith form generators, since this may not be true for a general derived class. IN... |
Initializes base class Disk. | Initializes base class ``Disk``. | def __init__(self, point, r, angle, options): """ Initializes base class Disk. |
Return the allowed options for the Disk class. | Return the allowed options for the ``Disk`` class. | def _allowed_options(self): """ Return the allowed options for the Disk class. |
String representation of Disk primitive. | String representation of ``Disk`` primitive. | def _repr_(self): """ String representation of Disk primitive. |
EXAMPLES: | EXAMPLES:: | def plot3d(self, z=0, **kwds): """ Plots a 2D disk (actually a 52-gon) in 3D, with default height zero. |
sage: len(search_doc('tree', whole_word=True, interact=False).splitlines()) < 100 | sage: len(search_doc('tree', whole_word=True, interact=False).splitlines()) < 200 | def search_doc(string, extra1='', extra2='', extra3='', extra4='', extra5='', **kwds): """ Search Sage HTML documentation for lines containing ``string``. The search is case-sensitive. The file paths in the output are relative to ``$SAGE_ROOT/devel/sage/doc/output``. INPUT: same as for :func:`search_src`. OUTPUT: sa... |
the curve, then `|h(P) - \hat{h}(P)| \leq B`, where `h(P)` is | the curve, then `h(P) \le \hat{h}(P) + B`, where `h(P)` is | def CPS_height_bound(self): r""" Return the Cremona-Prickett-Siksek height bound. This is a floating point number B such that if P is a rational point on the curve, then `|h(P) - \hat{h}(P)| \leq B`, where `h(P)` is the naive logarithmic height of `P` and `\hat{h}(P)` is the canonical height. |
codmain. | codomain. | def iter_morphisms(self, arg=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain. |
Return the number type that contains both `self.field()` and `other`. | Return the common field for both ``self`` and ``other``. | def coerce_field(self, other): """ Return the number type that contains both `self.field()` and `other`. |
The argument `other` must be either * another `Polyhedron()` object * `QQ` or `RDF` * a constant that can be coerced to `QQ` or `RDF`. | The argument ``other`` must be either: * another ``Polyhedron`` object * `\QQ` or `RDF` * a constant that can be coerced to `\QQ` or `RDF` | def coerce_field(self, other): """ Return the number type that contains both `self.field()` and `other`. |
Either `QQ` or `RDF`. Raises `TypeError` if `other` is not a | Either `\QQ` or `RDF`. Raises ``TypeError`` if ``other`` is not a | def coerce_field(self, other): """ Return the number type that contains both `self.field()` and `other`. |
NOTE: "Real" numbers in sage are not necessarily elements of `RDF`. For example, the literal `1.0` is not. | .. NOTE:: "Real" numbers in sage are not necessarily elements of `RDF`. For example, the literal `1.0` is not. | def coerce_field(self, other): """ Return the number type that contains both `self.field()` and `other`. |
raise TypeError | raise TypeError("cannot determine field from %s!" % other) | def coerce_field(self, other): """ Return the number type that contains both `self.field()` and `other`. |
.. note:: Reference for the Sturm bound that we use in the definition of of this function: J. Sturm, On the congruence of modular forms, Number theory (New York, 1984-1985), Springer, Berlin, 1987, pp. 275-280. Useful Remark: | sage: CuspForms(Gamma1(144), 3).sturm_bound() 3457 sage: CuspForms(DirichletGroup(144).1^2, 3).sturm_bound() 73 sage: CuspForms(Gamma0(144), 3).sturm_bound() 73 REFERENCE: - [Sturm] J. Sturm, On the congruence of modular forms, Number theory (New York, 1984-1985), Springer, Berlin, 1987, pp. 275-280. NOTE:: | def sturm_bound(self, M=None): r""" For a space M of modular forms, this function returns an integer B such that two modular forms in either self or M are equal if and only if their q-expansions are equal to precision B (note that this is 1+ the usual Sturm bound, since `O(q^\mathrm{prec})` has precision prec). If M is... |
`s \geq` the sturm bound for `\Gamma_0` at | `s \geq` the Sturm bound for `\Gamma_0` at | def sturm_bound(self, M=None): r""" For a space M of modular forms, this function returns an integer B such that two modular forms in either self or M are equal if and only if their q-expansions are equal to precision B (note that this is 1+ the usual Sturm bound, since `O(q^\mathrm{prec})` has precision prec). If M is... |
self.__sturm_bound = self.group().sturm_bound(self.weight())+1 | self.__sturm_bound = G.sturm_bound(self.weight())+1 | def sturm_bound(self, M=None): r""" For a space M of modular forms, this function returns an integer B such that two modular forms in either self or M are equal if and only if their q-expansions are equal to precision B (note that this is 1+ the usual Sturm bound, since `O(q^\mathrm{prec})` has precision prec). If M is... |
raise ValueError, "n must be greater than lbound: %s"%(lbound) | raise ValueError, "n must be at least lbound: %s"%(lbound) | def random_prime(n, proof=None, lbound=2): """ Returns a random prime p between `lbound` and n (i.e. `lbound <= p <= n`). The returned prime is chosen uniformly at random from the set of prime numbers less than or equal to n. INPUT: - ``n`` - an integer >= 2. - ``proof`` - bool or None (default: None) If False, th... |
return ZZ(n) | return n lbound = max(2, lbound) if lbound > 2: if lbound == 3 or n <= 2*lbound - 2: if lbound < 25 or n <= 6*lbound/5: if lbound < 2010760 or n <= 16598*lbound/16597: if proof: smallest_prime = ZZ(lbound-1).next_prime() else: smallest_prime = ZZ(lbound-1).next_probable_prime() if smallest_prime > n: raise ValueErro... | def random_prime(n, proof=None, lbound=2): """ Returns a random prime p between `lbound` and n (i.e. `lbound <= p <= n`). The returned prime is chosen uniformly at random from the set of prime numbers less than or equal to n. INPUT: - ``n`` - an integer >= 2. - ``proof`` - bool or None (default: None) If False, th... |
if not proof: prime_test = is_pseudoprime else: prime_test = is_prime randint = current_randstate().python_random().randint while(1): p = randint(lbound,n) if prime_test(p): return ZZ(p) | prime_test = is_pseudoprime randint = current_randstate().python_random().randint while True: p = randint(lbound, n) if prime_test(p): return ZZ(p) | def random_prime(n, proof=None, lbound=2): """ Returns a random prime p between `lbound` and n (i.e. `lbound <= p <= n`). The returned prime is chosen uniformly at random from the set of prime numbers less than or equal to n. INPUT: - ``n`` - an integer >= 2. - ``proof`` - bool or None (default: None) If False, th... |
sage: c._ambient_space_point(c.lattice().dual()([1,1])) | sage: c._ambient_space_point(c.dual_lattice()([1,1])) | def _ambient_space_point(self, data): r""" Try to convert ``data`` to a point of the ambient space of ``self``. |
sage: c.contains(c.lattice().dual()(1,0)) | sage: c.contains(c.dual_lattice()(1,0)) | def contains(self, *args): r""" Check if a given point is contained in ``self``. |
self._dual = Cone(rays, lattice=self.lattice().dual(), check=False) | self._dual = Cone(rays, lattice=self.dual_lattice(), check=False) | def dual(self): r""" Return the dual cone of ``self``. OUTPUT: - :class:`cone <ConvexRationalPolyhedralCone>`. EXAMPLES:: sage: cone = Cone([(1,0), (-1,3)]) sage: cone.dual().rays() (M(3, 1), M(0, 1)) Now let's look at a more complicated case:: sage: cone = Cone([(-2,-1,2), (4,1,0), (-4,-1,-5), (4,1,5)]) sage: co... |
M = self.lattice().dual() | M = self.dual_lattice() | def facet_normals(self): r""" Return normals to facets of ``self``. |
self.lattice().dual().submodule_with_basis(basis) | self.dual_lattice().submodule_with_basis(basis) | def _split_ambient_lattice(self): r""" Compute a decomposition of the ``N``-lattice into `N_\sigma` and its complement `N(\sigma)`. |
Let `M=` ``self.lattice().dual()`` be the lattice dual to the | Let `M=` ``self.dual_lattice()`` be the lattice dual to the | def orthogonal_sublattice(self, *args, **kwds): r""" The sublattice (in the dual lattice) orthogonal to the sublattice spanned by the cone. Let `M=` ``self.lattice().dual()`` be the lattice dual to the ambient lattice of the given cone `\sigma`. Then, in the notation of [Fulton]_, this method returns the sublattice |
For example, :: | For example:: | def old_cremona_letter_code(n): r""" Returns the *old* Cremona letter code corresponding to an integer. integer. For example, :: 1 --> A 26 --> Z 27 --> AA 52 --> ZZ 53 --> AAA etc. INPUT: - ``n`` - int OUTPUT: str EXAMPLES:: sage: old_cremona_letter_code(1) 'A' sage: old_cremona_letter_code(26) 'Z' sage: ol... |
sage: it.next() Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field sage: it.next() Elliptic Curve defined by y^2 + y = x^3 - x^2 - 7820*x - 263580 over Rational Field """ return self.iter([11, self.largest_conductor()+1]) | sage: it.next().label() '11a1' sage: it.next().label() '11a2' sage: it.next().label() '11a3' sage: it.next().label() '14a1' sage: skip = [it.next() for _ in range(100)] sage: it.next().label() '45a3' """ return self.iter(xsrange(11,self.largest_conductor()+1)) | def __iter__(self): """ Returns an iterator through all EllipticCurve objects in the Cremona database. |
Returns an iterator through all curves with conductor between Nmin and Nmax-1, inclusive, in the database. | Return an iterator through all curves in the database with given conductors. | def iter(self, conductors): """ Returns an iterator through all curves with conductor between Nmin and Nmax-1, inclusive, in the database. INPUT: - ``conductors`` - list or generator of ints OUTPUT: generator that iterates over EllipticCurve objects. |
Returns an iterator through all optimal curves with conductor between Nmin and Nmax-1 in the database. | Return an iterator through all optimal curves in the database with given conductors. | def iter_optimal(self, conductors): """ Returns an iterator through all optimal curves with conductor between Nmin and Nmax-1 in the database. INPUT: |
Returns a list of all curves with conductor between Nmin and Nmax-1, inclusive, in the database. | Returns a list of all curves with given conductors. | def list(self, conductors): """ Returns a list of all curves with conductor between Nmin and Nmax-1, inclusive, in the database. INPUT: - ``conductors`` - list or generator of ints OUTPUT: - list of EllipticCurve objects. |
Returns a list of all optimal curves with conductor between Nmin and Nmax-1, inclusive, in the database. | Returns a list of all optimal curves with given conductors. | def list_optimal(self, conductors): """ Returns a list of all optimal curves with conductor between Nmin and Nmax-1, inclusive, in the database. INPUT: - ``conductors`` - list or generator of ints list of EllipticCurve objects. OUTPUT: list of EllipticCurve objects. |
The smallest conductor for which the database is complete. (Always 1.) | The smallest conductor for which the database is complete: always 1. | def smallest_conductor(self): """ The smallest conductor for which the database is complete. (Always 1.) OUTPUT: - ``int`` - smallest conductor EXAMPLES:: sage: CremonaDatabase().smallest_conductor() 1 """ return 1 |
OUTPUT: - ``int`` - smallest cond - ``int`` - largest conductor plus one | OUTPUT: tuple of ints (N1,N2+1) where N1 is the smallest and N2 the largest conductor for which the database is complete. | def conductor_range(self): """ Return the range of conductors that are covered by the database. OUTPUT: - ``int`` - smallest cond - ``int`` - largest conductor plus one EXAMPLES:: sage: from sage.databases.cremona import LargeCremonaDatabase # optional - database_cremona_ellcurve sage: c = LargeCremonaDatabas... |
TESTS:: | TESTS: | def _init_allgens(self, ftpdata, largest_conductor=0): """ Initialize the allgens table by reading the corresponding ftpdata files and importing them into the database. """ if self.read_only: raise RuntimeError, "The database must not be read_only." files = os.listdir(ftpdata) files.sort() name = "allgens" c = _map[nam... |
""" Returns the image `\{f(x) x in self\}` of this combinatorial | r""" Returns the image `\{f(x) | x \in \text{self}\}` of this combinatorial | def map(self, f, name=None): """ Returns the image `\{f(x) x in self\}` of this combinatorial class by `f`, as a combinatorial class. |
sage: K.<a> = NumberField(polygen(QQ)) sage: K._S_class_group_and_units( (K.ideal(5),) ) ([5, -1], []) | def _S_class_group_and_units(self, S, proof=True): """ Compute S class group and units. INPUT: - ``S`` - a tuple of primes of the base field - ``proof`` - if False, assume Pari's GRH++ in computing the class group OUTPUT: - ``units, clgp_gens``, where: - ``units`` - A list of generators of the unit group. - ``cl... | |
""" | r""" | def selmer_group(self, S, m, proof=True): """ Compute the Selmer group `K(S,m)`, which is defined to be the subgroup of `K^\times/(K^\times)^m` consisting of elements `a` such that `K(\sqrt[m]{a})/K` is unramified at all primes of `K` lying above a place outside of `S`. INPUT: - ``S`` - A set of primes of self. - ``... |
""" | TESTS:: sage: P = PolynomialRing(QQ, 0, '') sage: P(5).univariate_polynomial() 5 """ if self.parent().ngens() == 0: if R is None: return self.base_ring()(self) else: return R(self) | def univariate_polynomial(self, R=None): """ Returns a univariate polynomial associated to this multivariate polynomial. INPUT: - ``R`` - (default: None) PolynomialRing If this polynomial is not in at most one variable, then a ValueError exception is raised. This is checked using the is_univariate() method. The n... |
if self == 0: raise ArithmeticError, "Prime factorization of 0 not defined." if R.ngens() == 0: base_ring = self.base_ring() if base_ring.is_field(): return Factorization([],unit=self.base_ring()(self)) else: F = base_ring(self).factor() return Factorization([(R(f),m) for f,m in F], unit=F.unit()) | def factor(self, proof=True): r""" Compute the irreducible factorization of this polynomial. INPUT: - ``proof'' - insist on provably correct results (ignored, always ``True``) ALGORITHM: Use univariate factorization code. If a polynomial is univariate, the appropriate univariate factorization code is called. :: s... | |
sage: import operator | def derivative(self, ex, operator): """ EXAMPLES:: | |
sage: a = function('f', x).diff(x); a | sage: f = function('f') sage: a = f(x).diff(x); a | def derivative(self, ex, operator): """ EXAMPLES:: |
sage: b = function('f', x).diff(x).diff(x) | sage: b = f(x).diff(x, x) | def derivative(self, ex, operator): """ EXAMPLES:: |
args = ex.args() | args = ex.operands() | def derivative(self, ex, operator): """ EXAMPLES:: |
Check if a sage object belongs to self. This methods is a helper for | Check if a Sage object belongs to self. This methods is a helper for | def _is_a(self, x): """ Check if a sage object belongs to self. This methods is a helper for :meth:`__contains__` and the constructor :meth:`_element_constructor_`. |
self._error_re = re.compile('(Principal Value|debugmode|Incorrect syntax|Maxima encountered a Lisp error)') | self._error_re = re.compile('(Principal Value|debugmode|incorrect syntax|Maxima encountered a Lisp error)') | def __init__(self, script_subdirectory=None, logfile=None, server=None, init_code = None): """ Create an instance of the Maxima interpreter. |
sage: maxima.eval('sage0: x == x;') | sage: maxima._eval_line('sage0: x == x;') | def _eval_line(self, line, allow_use_file=False, wait_for_prompt=True, reformat=True, error_check=True): """ EXAMPLES: We check that errors are correctly checked:: sage: maxima._eval_line('1+1;') '2' sage: maxima.eval('sage0: x == x;') Traceback (most recent call last): ... TypeError: error evaluating "sage0: x == x;... |
TypeError: error evaluating "sage0: x == x;":... | TypeError: Error executing code in Maxima... | def _eval_line(self, line, allow_use_file=False, wait_for_prompt=True, reformat=True, error_check=True): """ EXAMPLES: We check that errors are correctly checked:: sage: maxima._eval_line('1+1;') '2' sage: maxima.eval('sage0: x == x;') Traceback (most recent call last): ... TypeError: error evaluating "sage0: x == x;... |
self._expect_expr(self._display_prompt) pre_out = self._before() self._expect_expr() out = self._before() | assert line_echo.strip() == line.strip() self._expect_expr(self._display_prompt) out = self._before() | def _eval_line(self, line, allow_use_file=False, wait_for_prompt=True, reformat=True, error_check=True): """ EXAMPLES: We check that errors are correctly checked:: sage: maxima._eval_line('1+1;') '2' sage: maxima.eval('sage0: x == x;') Traceback (most recent call last): ... TypeError: error evaluating "sage0: x == x;... |
self._error_check(line, pre_out) | def _eval_line(self, line, allow_use_file=False, wait_for_prompt=True, reformat=True, error_check=True): """ EXAMPLES: We check that errors are correctly checked:: sage: maxima._eval_line('1+1;') '2' sage: maxima.eval('sage0: x == x;') Traceback (most recent call last): ... TypeError: error evaluating "sage0: x == x;... | |
self._expect_expr() assert len(self._before())==0, 'Maxima expect interface is confused!' | def _eval_line(self, line, allow_use_file=False, wait_for_prompt=True, reformat=True, error_check=True): """ EXAMPLES: We check that errors are correctly checked:: sage: maxima._eval_line('1+1;') '2' sage: maxima.eval('sage0: x == x;') Traceback (most recent call last): ... TypeError: error evaluating "sage0: x == x;... | |
i = o.rfind('(%o') return o[:i] | def _eval_line(self, line, allow_use_file=False, wait_for_prompt=True, reformat=True, error_check=True): """ EXAMPLES: We check that errors are correctly checked:: sage: maxima._eval_line('1+1;') '2' sage: maxima.eval('sage0: x == x;') Traceback (most recent call last): ... TypeError: error evaluating "sage0: x == x;... | |
for _ in range(3): | for _ in range(5): | def _command_runner(self, command, s, redirect=True): """ Run ``command`` in a new Maxima session and return its output as an ``AsciiArtString``. If redirect is set to False, then the output of the command is not returned as a string. Instead, it behaves like os.system. This is used for interactive things like Maxima'... |
'5.20.1' | '5.22.1' | def version(self): """ Return the version of Maxima that Sage includes. EXAMPLES:: sage: maxima.version() '5.20.1' """ return maxima_version() |
def taylor(f, v, a, n): | def taylor(f, *args): | def taylor(f, v, a, n): """ Expands self in a truncated Taylor or Laurent series in the variable `v` around the point `a`, containing terms through `(x - a)^n`. INPUT: - ``v`` - variable - ``a`` - number - ``n`` - integer EXAMPLES:: sage: var('x,k,n') (x, k, n) sage: taylor (sqrt (1 - k^2*sin(x)^2), x, 0, 6)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.