rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
(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.
9932a677a12413086a59217c4c0d425b0543b6eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/9932a677a12413086a59217c4c0d425b0543b6eb/interface.py
sage: latex(maxima(derivative(ceil(x*y*d), d,x,x,y))) d^3\,\left({{{\it \partial}^4}\over{{\it \partial}\,d^4}}\, {\it ceil}\left(d , x , y\right)\right)\,x^2\,y^3+5\,d^2\,\left({{ {\it \partial}^3}\over{{\it \partial}\,d^3}}\,{\it ceil}\left(d , x , y\right)\right)\,x\,y^2+4\,d\,\left({{{\it \partial}^2}\over{ {\...
sage: f = function('f') sage: latex(maxima(derivative(f(x*y*d), d,x,x,y))) Traceback (most recent call last): ... NotImplementedError: arguments must be distinct variables sage: latex(maxima(derivative(f(x,y,d), d,x,x,y))) {{{\it \partial}^4}\over{{\it \partial}\,d\,{\it \partial}\,x^2\, {\it \partial}\,y}}\,f\left(x ...
def _latex_(self): """ Return Latex representation of this Maxima object.
410199b0200806c2e676aa962b35ac96bb5d88f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/410199b0200806c2e676aa962b35ac96bb5d88f3/maxima.py
Construct a module with basis from the data in ``x``
Construct a module with basis from the data in ``x``.
def _call_(self, x): """ Construct a module with basis from the data in ``x``
5e77b431e0bbe5251f2f32e3a2fe9539007540b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/5e77b431e0bbe5251f2f32e3a2fe9539007540b3/modules_with_basis.py
Returns whether this category is abelian
Returns whether this category is abelian.
def is_abelian(self): """ Returns whether this category is abelian
5e77b431e0bbe5251f2f32e3a2fe9539007540b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/5e77b431e0bbe5251f2f32e3a2fe9539007540b3/modules_with_basis.py
With the ``zero`` argument, one can define affine morphisms:
With the ``zero`` argument, one can define affine morphisms::
def module_morphism(self, on_basis = None, diagonal = None, triangular = None, **keywords): r""" Constructs morphisms by linearity
5e77b431e0bbe5251f2f32e3a2fe9539007540b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/5e77b431e0bbe5251f2f32e3a2fe9539007540b3/modules_with_basis.py
Or more generaly any ring admitting a coercion map from the base ring:
Or more generaly any ring admitting a coercion map from the base ring::
def module_morphism(self, on_basis = None, diagonal = None, triangular = None, **keywords): r""" Constructs morphisms by linearity
5e77b431e0bbe5251f2f32e3a2fe9539007540b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/5e77b431e0bbe5251f2f32e3a2fe9539007540b3/modules_with_basis.py
We can also create spaces corresponding to the groups `\GammaH(N)` intermediate
We can also create spaces corresponding to the groups `\Gamma_H(N)` intermediate
def ModularForms(group = 1, weight = 2, base_ring = None, use_cache = True, prec = defaults.DEFAULT_PRECISION): r""" Create an ambient space of modular forms. INPUT: - ``group`` - A congruence subgroup or a Dirichlet character eps. - ``weight`` - int, the weight, which must be an integer = 1. - ``base_ring`` - ...
6eb3e644186e44f7fb98ea0dcfe24aeebce503c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/6eb3e644186e44f7fb98ea0dcfe24aeebce503c5/constructor.py
def rational_points(self, algorithm="enum", sort=True):
def rational_points_iterator(self):
def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration.
05c8eef04e5f3195edea5753cb5866da744515e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/05c8eef04e5f3195edea5753cb5866da744515e5/projective_curve.py
Return the rational points on this curve computed via enumeration.
Return a generator object for the rational points on this curve.
def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration.
05c8eef04e5f3195edea5753cb5866da744515e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/05c8eef04e5f3195edea5753cb5866da744515e5/projective_curve.py
- ``algorithm`` (string, default: 'enum') -- the algorithm to use. Currently this is ignored. - ``sort`` (boolean, default ``True``) -- whether the output points should be sorted. If False, the order of the output is non-deterministic.
- ``self`` -- a projective curve
def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration.
05c8eef04e5f3195edea5753cb5866da744515e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/05c8eef04e5f3195edea5753cb5866da744515e5/projective_curve.py
A list of all the rational points on the curve defined over its base field, possibly sorted. .. note:: This is a slow Python-level implementation. EXAMPLES:: sage: F = GF(5)
A generator of all the rational points on the curve defined over its base field. EXAMPLE:: sage: F = GF(37)
def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration.
05c8eef04e5f3195edea5753cb5866da744515e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/05c8eef04e5f3195edea5753cb5866da744515e5/projective_curve.py
sage: C = Curve(X^3+Y^3-Z^3) sage: C.rational_points() [(0 : 1 : 1), (1 : 0 : 1), (2 : 2 : 1), (3 : 4 : 1), (4 : 1 : 0), (4 : 3 : 1)] sage: C.rational_points(sort=False) [(4 : 1 : 0), (1 : 0 : 1), (0 : 1 : 1), (2 : 2 : 1), (4 : 3 : 1), (3 : 4 : 1)]
sage: C = Curve(X^7+Y*X*Z^5*55+Y^7*12) sage: len(list(C.rational_points_iterator())) 37
def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration.
05c8eef04e5f3195edea5753cb5866da744515e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/05c8eef04e5f3195edea5753cb5866da744515e5/projective_curve.py
sage: F = GF(1009)
sage: F = GF(2)
def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration.
05c8eef04e5f3195edea5753cb5866da744515e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/05c8eef04e5f3195edea5753cb5866da744515e5/projective_curve.py
sage: C = Curve(X^5+12*X*Y*Z^3 + X^2*Y^3 - 13*Y^2*Z^3) sage: len(C.rational_points()) 1043
sage: C = Curve(X*Y*Z) sage: a = C.rational_points_iterator() sage: a.next() (1 : 0 : 0) sage: a.next() (0 : 1 : 0) sage: a.next() (1 : 1 : 0) sage: a.next() (0 : 0 : 1) sage: a.next() (1 : 0 : 1) sage: a.next() (0 : 1 : 1) sage: a.next() Traceback (most recent call last): ... StopIteration
def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration.
05c8eef04e5f3195edea5753cb5866da744515e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/05c8eef04e5f3195edea5753cb5866da744515e5/projective_curve.py
sage: F = GF(2^6,'a')
sage: F = GF(3^2,'a')
def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration.
05c8eef04e5f3195edea5753cb5866da744515e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/05c8eef04e5f3195edea5753cb5866da744515e5/projective_curve.py
sage: C = Curve(X^5+11*X*Y*Z^3 + X^2*Y^3 - 13*Y^2*Z^3) sage: len(C.rational_points()) 104 :: sage: R.<x,y,z> = GF(2)[] sage: f = x^3*y + y^3*z + x*z^3 sage: C = Curve(f); pts = C.rational_points() sage: pts [(0 : 0 : 1), (0 : 1 : 0), (1 : 0 : 0)]
sage: C = Curve(X^3+5*Y^2*Z-33*X*Y*X) sage: b = C.rational_points_iterator() sage: b.next() (0 : 1 : 0) sage: b.next() (0 : 0 : 1) sage: b.next() (2*a + 2 : 2*a : 1) sage: b.next() (2 : a + 1 : 1) sage: b.next() (a + 1 : a + 2 : 1) sage: b.next() (1 : 2 : 1) sage: b.next() (2*a + 2 : a : 1) sage: b.next() (2 : 2*a + 2 ...
def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration.
05c8eef04e5f3195edea5753cb5866da744515e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/05c8eef04e5f3195edea5753cb5866da744515e5/projective_curve.py
points = []
def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration.
05c8eef04e5f3195edea5753cb5866da744515e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/05c8eef04e5f3195edea5753cb5866da744515e5/projective_curve.py
points.append(self.point([one,zero,zero]))
t = self.point([one,zero,zero]) yield(t)
def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration.
05c8eef04e5f3195edea5753cb5866da744515e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/05c8eef04e5f3195edea5753cb5866da744515e5/projective_curve.py
for x in R(g((X,one,zero))).roots(multiplicities=False): points.append(self.point([x,one,zero]))
g10 = R(g(X,one,zero)) if g10.is_zero(): for x in K: yield(self.point([x,one,zero])) else: for x in g10.roots(multiplicities=False): yield(self.point([x,one,zero]))
def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration.
05c8eef04e5f3195edea5753cb5866da744515e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/05c8eef04e5f3195edea5753cb5866da744515e5/projective_curve.py
for x in R(g((X,y,one))).roots(multiplicities=False): points.append(self.point([x,y,one]))
gy1 = R(g(X,y,one)) if gy1.is_zero(): for x in K: yield(self.point([x,y,one])) else: for x in gy1.roots(multiplicities=False): yield(self.point([x,y,one])) def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration. INPUT: - ``algorithm`` (string, d...
def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration.
05c8eef04e5f3195edea5753cb5866da744515e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/05c8eef04e5f3195edea5753cb5866da744515e5/projective_curve.py
summing the sizes of the enumerated sets:
summing the sizes of the enumerated sets::
def cardinality(self): """ Returns the cardinality of this disjoint union.
84bb818f9eb80986f707ee05f4a8c9cee703c55e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/84bb818f9eb80986f707ee05f4a8c9cee703c55e/disjoint_union_enumerated_sets.py
'How big the point is.'
'How big the point is (i.e., area in points^2=(1/72 inch)^2).'
def _allowed_options(self): """ Return the allowed options for the Point class.
cf6eff7e0130e9212149458ca56db0aeed58d5d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/cf6eff7e0130e9212149458ca56db0aeed58d5d4/point.py
'size': 'How big the point is.',
'size': 'How big the point is (i.e., area in points^2=(1/72 inch)^2).',
def _allowed_options(self): """ Return the allowed options for the Point class.
cf6eff7e0130e9212149458ca56db0aeed58d5d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/cf6eff7e0130e9212149458ca56db0aeed58d5d4/point.py
return []
return
def upgrade(): """ Download and build the latest version of Sage. You must have an internet connection. Also, you will have to restart Sage for the changes to take affect. This upgrades to the latest version of core packages (optional packages are not automatically upgraded). This will not work on systems that don't...
8a37bc0c19467908de299f9f25078a11e077fc54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/8a37bc0c19467908de299f9f25078a11e077fc54/package.py
This equation can be solved within Maxima but not within Sage. It needs assumptions assume(x>0,y>0) and works in Maxima, but not in Sage:: sage: assume(x>0) sage: assume(y>0) sage: desolve(x*diff(y,x)-x*sqrt(y^2+x^2)-y,y,show_method=True)
def desolve(de, dvar, ics=None, ivar=None, show_method=False, contrib_ode=False): r""" Solves a 1st or 2nd order linear ODE via maxima. Including IVP and BVP. *Use* ``desolve? <tab>`` *if the output in truncated in notebook.* INPUT: - ``de`` - an expression or equation representing the ODE - ``dvar`` - the dependen...
e4366b45405e2291636c4e78ad37fb6df072b317 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/e4366b45405e2291636c4e78ad37fb6df072b317/desolvers.py
Return a list of primary ideals (and their associated primes) such that their intersection is `I` = ``self``.
Return a list of the associated primes of primary ideals of which the intersection is `I` = ``self``.
def associated_primes(self, algorithm='sy'): r""" Return a list of primary ideals (and their associated primes) such that their intersection is `I` = ``self``.
909ce5c943b9a9979f373d3a4e76baccb4d24a6e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/909ce5c943b9a9979f373d3a4e76baccb4d24a6e/multi_polynomial_ideal.py
- ``list`` - a list of primary ideals and their associated primes [(primary ideal, associated prime), ...]
- ``list`` - a list of associated primes
def associated_primes(self, algorithm='sy'): r""" Return a list of primary ideals (and their associated primes) such that their intersection is `I` = ``self``.
909ce5c943b9a9979f373d3a4e76baccb4d24a6e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/909ce5c943b9a9979f373d3a4e76baccb4d24a6e/multi_polynomial_ideal.py
def iter_morphisms(self, l=None, codomain=None, min_length=1):
@rename_keyword(deprecated='Sage version 4.6.1', l='arg') def iter_morphisms(self, arg=None, codomain=None, min_length=1):
def iter_morphisms(self, l=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain.
564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3/words.py
- ``l`` - (optional, default: None) It can be one of the following :
- ``arg`` - (optional, default: None) It can be one of the following :
def iter_morphisms(self, l=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain.
564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3/words.py
- list of nonnegative integers - The length of the list must be the number of letters in the alphabet, and the `i`-th integer of ``l`` determines the length of the word mapped to by the `i`-th letter of the (ordered) alphabet.
def iter_morphisms(self, l=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain.
564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3/words.py
- ``min_length`` - (default: 1) nonnegative integer. If ``l`` is
- ``min_length`` - (default: 1) nonnegative integer. If ``arg`` is
def iter_morphisms(self, l=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain.
564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3/words.py
``min_length``. This is ignored if ``l`` is a list.
``min_length``. This is ignored if ``arg`` is a list.
def iter_morphisms(self, l=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain.
564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3/words.py
TypeError: l (=[0, 1, 2]) must be an iterable of 2 integers
TypeError: arg (=[0, 1, 2]) must be an iterable of 2 integers
def iter_morphisms(self, l=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain.
564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3/words.py
TypeError: l (=[0, 'a']) must be an iterable of 2 integers
TypeError: arg (=[0, 'a']) must be an iterable of 2 integers
def iter_morphisms(self, l=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain.
564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3/words.py
if l is None:
if arg is None:
def iter_morphisms(self, l=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain.
564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3/words.py
elif isinstance(l, tuple): if not len(l) == 2 or not all(isinstance(a, (int,Integer)) for a in l): raise TypeError("l (=%s) must be a tuple of 2 integers" %l)
elif isinstance(arg, tuple): if not len(arg) == 2 or not all(isinstance(a, (int,Integer)) for a in arg): raise TypeError("arg (=%s) must be a tuple of 2 integers" %arg)
def iter_morphisms(self, l=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain.
564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3/words.py
compositions = IntegerListsLex(range(*l),
compositions = IntegerListsLex(range(*arg),
def iter_morphisms(self, l=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain.
564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3/words.py
l = list(l) if (not len(l) == n or not all(isinstance(a, (int,Integer)) for a in l)):
arg = list(arg) if (not len(arg) == n or not all(isinstance(a, (int,Integer)) for a in arg)):
def iter_morphisms(self, l=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain.
564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3/words.py
"l (=%s) must be an iterable of %s integers" %(l, n)) compositions = [l]
"arg (=%s) must be an iterable of %s integers" %(arg, n)) compositions = [arg]
def iter_morphisms(self, l=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain.
564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/564ffdb70e6edfcbc0b0fa7b79a0926d1d565df3/words.py
"""
r"""
def cospectral_graphs(self, vertices, matrix_function=lambda g: g.adjacency_matrix(), graphs=None): """ Find all sets of graphs on ``vertices`` vertices (with possible restrictions) which are cospectral with respect to a constructed matrix.
7fb9685cca7c6df4ae0cab0c8237d0a0834f0892 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7fb9685cca7c6df4ae0cab0c8237d0a0834f0892/graph_generators.py
cospectral graphs.
cospectral graphs (lists of cadinality 1 being omitted).
def cospectral_graphs(self, vertices, matrix_function=lambda g: g.adjacency_matrix(), graphs=None): """ Find all sets of graphs on ``vertices`` vertices (with possible restrictions) which are cospectral with respect to a constructed matrix.
7fb9685cca7c6df4ae0cab0c8237d0a0834f0892 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7fb9685cca7c6df4ae0cab0c8237d0a0834f0892/graph_generators.py
is enough to check the spectrum of the matrix `D^{-1}A`, where D
is enough to check the spectrum of the matrix `D^{-1}A`, where `D`
def cospectral_graphs(self, vertices, matrix_function=lambda g: g.adjacency_matrix(), graphs=None): """ Find all sets of graphs on ``vertices`` vertices (with possible restrictions) which are cospectral with respect to a constructed matrix.
7fb9685cca7c6df4ae0cab0c8237d0a0834f0892 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7fb9685cca7c6df4ae0cab0c8237d0a0834f0892/graph_generators.py
sage: browse_sage_doc(identity_matrix, 'rst')[:9] '**File:**' sage: browse_sage_doc(identity_matrix, 'rst')[-60:] 'MatrixSpace of 3 by 3 sparse matrices over Integer Ring\n ' sage: browse_sage_doc(identity_matrix, 'html', False)[:59] '<div class="docstring">\n \n <p><strong>File:</strong> /v'
sage: browse_sage_doc(identity_matrix, 'rst') "...**File:**...**Type:**...**Definition:** identity_matrix..." sage: identity_matrix.__doc__.replace('\\','\\\\') in browse_sage_doc(identity_matrix, 'rst') True sage: browse_sage_doc(identity_matrix, 'html', False) '...div...File:...Type:...Definition:...identity_matrix.....
def __call__(self, obj, output='html', view=True): r""" Return the documentation for ``obj``.
6a7a8d2dcf4f778c061b1f6c8f4d142c873499cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/6a7a8d2dcf4f778c061b1f6c8f4d142c873499cd/sagedoc.py
sage: W = Words('123') sage: W('1212').is_square() True sage: W('1213').is_square() False sage: W('12123').is_square() False sage: W().is_square()
sage: Word('1212').is_square() True sage: Word('1213').is_square() False sage: Word('12123').is_square() False sage: Word().is_square()
def is_square(self): r""" Returns True if self is a square, and False otherwise.
65e004c0d1f96d960ea72ba590c71bc975cf9627 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/65e004c0d1f96d960ea72ba590c71bc975cf9627/finite_word.py
sage: W = Words('123') sage: W('12312').is_square_free() True sage: W('31212').is_square_free() False sage: W().is_square_free() True TESTS:: sage: W = Words('123') sage: W('11').is_square_free() False sage: W('211').is_square_free() False sage: W('3211').is_square_free() False """ l = self.length() if l < 2:
sage: Word('12312').is_square_free() True sage: Word('31212').is_square_free() False sage: Word().is_square_free() True TESTS: We make sure that sage: Word('11').is_square_free() False sage: Word('211').is_square_free() False sage: Word('3211').is_square_free() False """ L = self.length() if L < 2:
def is_square_free(self): r""" Returns True if self does not contain squares, and False otherwise.
65e004c0d1f96d960ea72ba590c71bc975cf9627 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/65e004c0d1f96d960ea72ba590c71bc975cf9627/finite_word.py
suff = self for i in xrange(0, l-1): for ll in xrange(2, l-i+1, 2): if suff[:ll].is_square():
for start in xrange(0, L-1): for end in xrange(start+2, L+1, 2): if self[start:end].is_square():
def is_square_free(self): r""" Returns True if self does not contain squares, and False otherwise.
65e004c0d1f96d960ea72ba590c71bc975cf9627 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/65e004c0d1f96d960ea72ba590c71bc975cf9627/finite_word.py
suff = suff[1:]
def is_square_free(self): r""" Returns True if self does not contain squares, and False otherwise.
65e004c0d1f96d960ea72ba590c71bc975cf9627 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/65e004c0d1f96d960ea72ba590c71bc975cf9627/finite_word.py
sage: W = Words('012') sage: W('012012012').is_cube() True sage: W('01010101').is_cube() False sage: W().is_cube() True sage: W('012012').is_cube()
sage: Word('012012012').is_cube() True sage: Word('01010101').is_cube() False sage: Word().is_cube() True sage: Word('012012').is_cube()
def is_cube(self): r""" Returns True if self is a cube, and False otherwise.
65e004c0d1f96d960ea72ba590c71bc975cf9627 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/65e004c0d1f96d960ea72ba590c71bc975cf9627/finite_word.py
sage: W = Words('123') sage: W('12312').is_cube_free() True sage: W('32221').is_cube_free() False sage: W().is_cube_free() True """ l = self.length() if l < 3:
sage: Word('12312').is_cube_free() True sage: Word('32221').is_cube_free() False sage: Word().is_cube_free() True TESTS: We make sure that sage: Word('111').is_cube_free() False sage: Word('2111').is_cube_free() False sage: Word('32111').is_cube_free() False """ L = self.length() if L < 3:
def is_cube_free(self): r""" Returns True if self does not contain cubes, and False otherwise.
65e004c0d1f96d960ea72ba590c71bc975cf9627 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/65e004c0d1f96d960ea72ba590c71bc975cf9627/finite_word.py
suff = self for i in xrange(0, l - 3): for ll in xrange(3, l-i+1, 3): if suff[:ll].is_cube():
for start in xrange(0, L - 2): for end in xrange(start+3, L+1, 3): if self[start:end].is_cube():
def is_cube_free(self): r""" Returns True if self does not contain cubes, and False otherwise.
65e004c0d1f96d960ea72ba590c71bc975cf9627 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/65e004c0d1f96d960ea72ba590c71bc975cf9627/finite_word.py
suff = suff[1:]
def is_cube_free(self): r""" Returns True if self does not contain cubes, and False otherwise.
65e004c0d1f96d960ea72ba590c71bc975cf9627 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/65e004c0d1f96d960ea72ba590c71bc975cf9627/finite_word.py
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: old_...
3c1b27bc91a3712f6058f9620a30ed25509047e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/3c1b27bc91a3712f6058f9620a30ed25509047e2/cremona.py
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.
3c1b27bc91a3712f6058f9620a30ed25509047e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/3c1b27bc91a3712f6058f9620a30ed25509047e2/cremona.py
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.
3c1b27bc91a3712f6058f9620a30ed25509047e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/3c1b27bc91a3712f6058f9620a30ed25509047e2/cremona.py
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.
3c1b27bc91a3712f6058f9620a30ed25509047e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/3c1b27bc91a3712f6058f9620a30ed25509047e2/cremona.py
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.
3c1b27bc91a3712f6058f9620a30ed25509047e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/3c1b27bc91a3712f6058f9620a30ed25509047e2/cremona.py
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.
3c1b27bc91a3712f6058f9620a30ed25509047e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/3c1b27bc91a3712f6058f9620a30ed25509047e2/cremona.py
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.)
3c1b27bc91a3712f6058f9620a30ed25509047e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/3c1b27bc91a3712f6058f9620a30ed25509047e2/cremona.py
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.
3c1b27bc91a3712f6058f9620a30ed25509047e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/3c1b27bc91a3712f6058f9620a30ed25509047e2/cremona.py
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...
3c1b27bc91a3712f6058f9620a30ed25509047e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/3c1b27bc91a3712f6058f9620a30ed25509047e2/cremona.py
sage: for lset in polytopes.cross_polytope(2).face_lattice().level_sets(): print lset[0] (None, (0, 1, 2, 3)) ((1,), (2, 3)) ((1, 2), (3,)) ((0, 1, 2, 3), None)
sage: level_sets = polytopes.cross_polytope(2).face_lattice().level_sets() sage: print level_sets[0], level_sets[-1] [(None, (0, 1, 2, 3))] [((0, 1, 2, 3), None)]
def face_lattice(self): """ Computes the face-lattice poset. Elements are tuples of (vertices, facets) - i.e. this keeps track of both the vertices in each face, and all the facets containing them.
5b19bc41e9ed7f05434df1ef214d5e2da019260c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/5b19bc41e9ed7f05434df1ef214d5e2da019260c/polyhedra.py
sage: @interacts.decorator.library_interact
sage: @interacts.library.library_interact
def library_interact(f): """ This is a decorator for using interacts in the Sage library. EXAMPLES:: sage: @interacts.decorator.library_interact ... def f(n=5): print n ... sage: f() # an interact appears <html>...</html> """ @sage_wraps(f) def library_wrapper(): # Maybe program around bug (?) in the notebook: html(...
8c25e9ca470abe52dc3ac0c498cdff091b20a257 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/8c25e9ca470abe52dc3ac0c498cdff091b20a257/library.py
sage: interacts.decorator.demo()
sage: interacts.library.demo()
def demo(n=tuple(range(10)), m=tuple(range(10))): """ This is a demo interact that sums two numbers. INPUT: - `n` -- integer slider - `m` -- integer slider EXAMPLES:: sage: interacts.decorator.demo() <html>...</html> """ print n+m
8c25e9ca470abe52dc3ac0c498cdff091b20a257 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/8c25e9ca470abe52dc3ac0c498cdff091b20a257/library.py
The performance issue from
The performance issue from
... def variance(self, bias = False):
d868e3d99c0565bfa6cb057a2325bd9a9e7b1625 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/d868e3d99c0565bfa6cb057a2325bd9a9e7b1625/basic_stats.py
sage: homchain(C2, generators=True, base_ring=GF(2))[2]
sage: homchain(C2, generators=True, base_ring=GF(2))[2]
def homchain(complex=None, **kwds): r""" Compute the homology of a chain complex using the CHomP program ``homchain``. :param complex: a chain complex :param generators: if True, also return list of generators :type generators: boolean; optional, default False :param verbose: if True, print helpful messages as the com...
10fd085a77bef57fa7361816e347209fc768b29a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/10fd085a77bef57fa7361816e347209fc768b29a/chomp.py
sage: cmp(P1xP1, 1)
sage: cmp(P1xP1, 1) * cmp(1, P1xP1)
def __cmp__(self, right): r""" Compare ``self`` and ``right``.
1312749ae504505c480e693c47b6d47f6e4a0bf0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/1312749ae504505c480e693c47b6d47f6e4a0bf0/toric_variety.py
THEOREM (Kato): Suppose `p \geq 5` is a prime so the `p`-adic representation `\rho_{E,p}` is surjective and `L(E,1) \neq 0`. Then `{ord}_p(\
THEOREM (Kato): Suppose `L(E,1) \neq 0` and `p \neq 2, 3` is a prime such that - `E` does not have additive reduction at `p`, - the mod-`p` representation is surjective. Then `{ord}_p(\
def bound_kato(self): r""" Returns a list `p` of primes such that the theorems of Kato's [Ka] and others (e.g., as explained in a paper/thesis of Grigor Grigorov [Gri]) imply that if `p` divides the order of Sha(E) then `p` is in the list.
a65589b424a4f170a5aece0d1b80690d7bdd7d29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a65589b424a4f170a5aece0d1b80690d7bdd7d29/sha_tate.py
[2, 3, 5]
[2, 3, 5, 23]
def bound_kato(self): r""" Returns a list `p` of primes such that the theorems of Kato's [Ka] and others (e.g., as explained in a paper/thesis of Grigor Grigorov [Gri]) imply that if `p` divides the order of Sha(E) then `p` is in the list.
a65589b424a4f170a5aece0d1b80690d7bdd7d29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a65589b424a4f170a5aece0d1b80690d7bdd7d29/sha_tate.py
[2, 3, 7]
[2, 3, 7, 29]
def bound_kato(self): r""" Returns a list `p` of primes such that the theorems of Kato's [Ka] and others (e.g., as explained in a paper/thesis of Grigor Grigorov [Gri]) imply that if `p` divides the order of Sha(E) then `p` is in the list.
a65589b424a4f170a5aece0d1b80690d7bdd7d29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a65589b424a4f170a5aece0d1b80690d7bdd7d29/sha_tate.py
B = [2,3] for p in self.E.galois_representation().non_surjective():
B = [2, 3] for p in self.E.galois_representation().non_surjective():
def bound_kato(self): r""" Returns a list `p` of primes such that the theorems of Kato's [Ka] and others (e.g., as explained in a paper/thesis of Grigor Grigorov [Gri]) imply that if `p` divides the order of Sha(E) then `p` is in the list.
a65589b424a4f170a5aece0d1b80690d7bdd7d29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a65589b424a4f170a5aece0d1b80690d7bdd7d29/sha_tate.py
``obj``, return a list of those names. If
``obj``, return a sorted list of those names. If
def sage_getvariablename(obj, omit_underscore_names=True): """ Attempt to get the name of a Sage object. INPUT: - ``obj`` - an object - ``omit_underscore_names`` (optional, default True) If the user has assigned an object ``obj`` to a variable name, then return that variable name. If several variables point to ``ob...
125f8a6e4b9ecacb479405e4c6d70b9a85d59547 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/125f8a6e4b9ecacb479405e4c6d70b9a85d59547/sageinspect.py
return result
return sorted(result)
def sage_getvariablename(obj, omit_underscore_names=True): """ Attempt to get the name of a Sage object. INPUT: - ``obj`` - an object - ``omit_underscore_names`` (optional, default True) If the user has assigned an object ``obj`` to a variable name, then return that variable name. If several variables point to ``ob...
125f8a6e4b9ecacb479405e4c6d70b9a85d59547 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/125f8a6e4b9ecacb479405e4c6d70b9a85d59547/sageinspect.py
approximately satisfied by the number `z`. Note that the returned polynomial need not be irreducible, and indeed usually won't be if `z` is a good approximation to an algebraic number of degree less than `degree`. You can specify the number of known bits or digits with ``known_bits=k`` or ``known_digits=k``; Pari is t...
approximately satisfied by the number `z`. Note that the returned polynomial need not be irreducible, and indeed usually won't be if `z` is a good approximation to an algebraic number of degree less than `degree`. You can specify the number of known bits or digits of `z` with ``known_bits=k`` or ``known_digits=k``. PA...
def algdep(z, degree, known_bits=None, use_bits=None, known_digits=None, use_digits=None, height_bound=None, proof=False): """ Returns a polynomial of degree at most `degree` which is approximately satisfied by the number `z`. Note that the returned polynomial need not be irreducible, and indeed usually won't be if `z`...
2a5f9f192675580f8a03d5205bd9793259ee204a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2a5f9f192675580f8a03d5205bd9793259ee204a/arith.py
- ``height_bound`` - an integer (default ``None``) specifying the maximum
- ``height_bound`` - an integer (default: ``None``) specifying the maximum
def algdep(z, degree, known_bits=None, use_bits=None, known_digits=None, use_digits=None, height_bound=None, proof=False): """ Returns a polynomial of degree at most `degree` which is approximately satisfied by the number `z`. Note that the returned polynomial need not be irreducible, and indeed usually won't be if `z`...
2a5f9f192675580f8a03d5205bd9793259ee204a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2a5f9f192675580f8a03d5205bd9793259ee204a/arith.py
- ``proof`` - a boolean (default ``False``), requres height_bound to be set
- ``proof`` - a boolean (default: ``False``), requires height_bound to be set
def algdep(z, degree, known_bits=None, use_bits=None, known_digits=None, use_digits=None, height_bound=None, proof=False): """ Returns a polynomial of degree at most `degree` which is approximately satisfied by the number `z`. Note that the returned polynomial need not be irreducible, and indeed usually won't be if `z`...
2a5f9f192675580f8a03d5205bd9793259ee204a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2a5f9f192675580f8a03d5205bd9793259ee204a/arith.py
This example involves a complex number. ::
This example involves a complex number::
def algdep(z, degree, known_bits=None, use_bits=None, known_digits=None, use_digits=None, height_bound=None, proof=False): """ Returns a polynomial of degree at most `degree` which is approximately satisfied by the number `z`. Note that the returned polynomial need not be irreducible, and indeed usually won't be if `z`...
2a5f9f192675580f8a03d5205bd9793259ee204a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2a5f9f192675580f8a03d5205bd9793259ee204a/arith.py
This example involves a `p`-adic number. ::
This example involves a `p`-adic number::
def algdep(z, degree, known_bits=None, use_bits=None, known_digits=None, use_digits=None, height_bound=None, proof=False): """ Returns a polynomial of degree at most `degree` which is approximately satisfied by the number `z`. Note that the returned polynomial need not be irreducible, and indeed usually won't be if `z`...
2a5f9f192675580f8a03d5205bd9793259ee204a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2a5f9f192675580f8a03d5205bd9793259ee204a/arith.py
compute a 200-bit approximation to sqrt(2) which is wrong in the 33'rd bit. ::
compute a 200-bit approximation to `sqrt(2)` which is wrong in the 33'rd bit::
def algdep(z, degree, known_bits=None, use_bits=None, known_digits=None, use_digits=None, height_bound=None, proof=False): """ Returns a polynomial of degree at most `degree` which is approximately satisfied by the number `z`. Note that the returned polynomial need not be irreducible, and indeed usually won't be if `z`...
2a5f9f192675580f8a03d5205bd9793259ee204a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2a5f9f192675580f8a03d5205bd9793259ee204a/arith.py
and coefficients bounded above by 10. ::
and coefficients bounded above by 10::
def algdep(z, degree, known_bits=None, use_bits=None, known_digits=None, use_digits=None, height_bound=None, proof=False): """ Returns a polynomial of degree at most `degree` which is approximately satisfied by the number `z`. Note that the returned polynomial need not be irreducible, and indeed usually won't be if `z`...
2a5f9f192675580f8a03d5205bd9793259ee204a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2a5f9f192675580f8a03d5205bd9793259ee204a/arith.py
For stronger results, we need more precicion. ::
For stronger results, we need more precicion::
def algdep(z, degree, known_bits=None, use_bits=None, known_digits=None, use_digits=None, height_bound=None, proof=False): """ Returns a polynomial of degree at most `degree` which is approximately satisfied by the number `z`. Note that the returned polynomial need not be irreducible, and indeed usually won't be if `z`...
2a5f9f192675580f8a03d5205bd9793259ee204a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2a5f9f192675580f8a03d5205bd9793259ee204a/arith.py
We can also use ``proof=True`` to get positive results. ::
We can also use ``proof=True`` to get positive results::
def algdep(z, degree, known_bits=None, use_bits=None, known_digits=None, use_digits=None, height_bound=None, proof=False): """ Returns a polynomial of degree at most `degree` which is approximately satisfied by the number `z`. Note that the returned polynomial need not be irreducible, and indeed usually won't be if `z`...
2a5f9f192675580f8a03d5205bd9793259ee204a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2a5f9f192675580f8a03d5205bd9793259ee204a/arith.py
- ``bound (default 1024)`` - int: highest power to test.
- ``bound (default: 1024)`` - int: highest power to test.
def is_pseudoprime_small_power(n, bound=1024, get_data=False): r""" Return True if `n` is a small power of a pseudoprime, and False otherwise. The result is *NOT* proven correct - *this IS a pseudo-primality test!*. If `get_data` is set to true and `n = p^d`, for a pseudoprime `p` and power `d`, return [(p, d)]. INP...
2a5f9f192675580f8a03d5205bd9793259ee204a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2a5f9f192675580f8a03d5205bd9793259ee204a/arith.py
- ``verbose`` - integer (default 0); pari's debug
- ``verbose`` - integer (default: 0); PARI's debug
def factor(n, proof=None, int_=False, algorithm='pari', verbose=0, **kwds): """ Returns the factorization of n. The result depends on the type of n. If n is an integer, factor returns the factorization of the integer n as an object of type Factorization. If n is not an integer, ``n.factor(proof=proof, **kwds)`` gets ...
2a5f9f192675580f8a03d5205bd9793259ee204a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2a5f9f192675580f8a03d5205bd9793259ee204a/arith.py
solution is not SymbolisEquation (as happens for example for
solution is not SymbolicEquation (as happens for example for
def desolve(de, dvar, ics=None, ivar=None, show_method=False, contrib_ode=False): """ Solves a 1st or 2nd order linear ODE via maxima. Including IVP and BVP. *Use* ``desolve? <tab>`` *if the output in truncated in notebook.* INPUT: - ``de`` - an expression or equation representing the ODE - ``dvar`` - the dependent...
7f133a6744923b72b06980a1787657382d80133b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7f133a6744923b72b06980a1787657382d80133b/desolvers.py
- ``ivar`` - (optional) the independent variable (hereafter called x), which must be specified if there is more than one independent variable in the equation.
- ``ivar`` - (optional) the independent variable (hereafter called x), which must be specified if there is more than one independent variable in the equation.
def desolve(de, dvar, ics=None, ivar=None, show_method=False, contrib_ode=False): """ Solves a 1st or 2nd order linear ODE via maxima. Including IVP and BVP. *Use* ``desolve? <tab>`` *if the output in truncated in notebook.* INPUT: - ``de`` - an expression or equation representing the ODE - ``dvar`` - the dependent...
7f133a6744923b72b06980a1787657382d80133b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7f133a6744923b72b06980a1787657382d80133b/desolvers.py
"""
r"""
def desolve_system_strings(des,vars,ics=None): """ Solves any size system of 1st order ODE's. Initials conditions are optional. INPUT: de -- a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") vars -- a list of strings representing the variables (eg, vars = ["...
7f133a6744923b72b06980a1787657382d80133b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7f133a6744923b72b06980a1787657382d80133b/desolvers.py
de -- a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") vars -- a list of strings representing the variables (eg, vars = ["s","x","y"], where s is the independent variable and x,y the dependent variables) ics -- a list of numbers representing initial condit...
- ``de`` - a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") - ``vars`` - a list of strings representing the variables (eg, vars = ["s","x","y"], where s is the independent variable and x,y the dependent variables) - ``ics`` - a list of numbers representing in...
def desolve_system_strings(des,vars,ics=None): """ Solves any size system of 1st order ODE's. Initials conditions are optional. INPUT: de -- a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") vars -- a list of strings representing the variables (eg, vars = ["...
7f133a6744923b72b06980a1787657382d80133b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7f133a6744923b72b06980a1787657382d80133b/desolvers.py
The given ics sets the initial values of the dependent vars in maxima, so subsequent ODEs involving these variables will have these initial conditions automatically imposed. EXAMPLES:
The given ics sets the initial values of the dependent vars in maxima, so subsequent ODEs involving these variables will have these initial conditions automatically imposed. EXAMPLES::
def desolve_system_strings(des,vars,ics=None): """ Solves any size system of 1st order ODE's. Initials conditions are optional. INPUT: de -- a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") vars -- a list of strings representing the variables (eg, vars = ["...
7f133a6744923b72b06980a1787657382d80133b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7f133a6744923b72b06980a1787657382d80133b/desolvers.py
Now type show(P1), show(P2) to view these. AUTHORS: David Joyner (3-2006, 8-2007)
Now type show(P1), show(P2) to view these. AUTHORS: - David Joyner (3-2006, 8-2007)
def desolve_system_strings(des,vars,ics=None): """ Solves any size system of 1st order ODE's. Initials conditions are optional. INPUT: de -- a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") vars -- a list of strings representing the variables (eg, vars = ["...
7f133a6744923b72b06980a1787657382d80133b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7f133a6744923b72b06980a1787657382d80133b/desolvers.py
"""
r"""
def eulers_method(f,x0,y0,h,x1,method="table"): """ This implements Euler's method for finding numerically the solution of the 1st order ODE ``y' = f(x,y)``, ``y(a)=c``. The "x" column of the table increments from ``x0`` to ``x1`` by ``h`` (so ``(x1-x0)/h`` must be an integer). In the "y" column, the new y-value equals...
7f133a6744923b72b06980a1787657382d80133b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7f133a6744923b72b06980a1787657382d80133b/desolvers.py
"""
r"""
def eulers_method_2x2(f,g, t0, x0, y0, h, t1,method="table"): """ This implements Euler's method for finding numerically the solution of the 1st order system of two ODEs ``x' = f(t, x, y), x(t0)=x0.`` ``y' = g(t, x, y), y(t0)=y0.`` The "t" column of the table increments from `t_0` to `t_1` by `h` (so `\\frac{t_1-t_0...
7f133a6744923b72b06980a1787657382d80133b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7f133a6744923b72b06980a1787657382d80133b/desolvers.py
"""
r""" Plots solution of ODE
def eulers_method_2x2_plot(f,g, t0, x0, y0, h, t1): """ This plots the soln in the rectangle ``(xrange[0],xrange[1]) x (yrange[0],yrange[1])`` and plots using Euler's method the numerical solution of the 1st order ODEs `x' = f(t,x,y)`, `x(a)=x_0`, `y' = g(t,x,y)`, `y(a) = y_0`. *For pedagogical purposes only.* EXAMPL...
7f133a6744923b72b06980a1787657382d80133b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7f133a6744923b72b06980a1787657382d80133b/desolvers.py
`\\theta''+\\sin(\\theta)=0`, `\\theta(0)=\\frac 34`, `\\theta'(0) =
`\theta''+\sin(\theta)=0`, `\theta(0)=\frac 34`, `\theta'(0) =
def eulers_method_2x2_plot(f,g, t0, x0, y0, h, t1): """ This plots the soln in the rectangle ``(xrange[0],xrange[1]) x (yrange[0],yrange[1])`` and plots using Euler's method the numerical solution of the 1st order ODEs `x' = f(t,x,y)`, `x(a)=x_0`, `y' = g(t,x,y)`, `y(a) = y_0`. *For pedagogical purposes only.* EXAMPL...
7f133a6744923b72b06980a1787657382d80133b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7f133a6744923b72b06980a1787657382d80133b/desolvers.py
``(P[0]+P[1]).show()`` to plot `(t,\\theta(t))` and `(t,\\theta'(t))`:: sage: from sage.calculus.desolvers import eulers_method_2x2_plot
``(P[0]+P[1]).show()`` to plot `(t,\theta(t))` and `(t,\theta'(t))`::
def eulers_method_2x2_plot(f,g, t0, x0, y0, h, t1): """ This plots the soln in the rectangle ``(xrange[0],xrange[1]) x (yrange[0],yrange[1])`` and plots using Euler's method the numerical solution of the 1st order ODEs `x' = f(t,x,y)`, `x(a)=x_0`, `y' = g(t,x,y)`, `y(a) = y_0`. *For pedagogical purposes only.* EXAMPL...
7f133a6744923b72b06980a1787657382d80133b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7f133a6744923b72b06980a1787657382d80133b/desolvers.py
self._read_faces(self.poly_x("i"))
self._read_faces(self.poly_x("i", reduce_dimension=True))
def _compute_faces(self): r""" Compute and cache faces of this polytope.
0c437a9fd38c44ead21aca785cc5469bac656ae2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/0c437a9fd38c44ead21aca785cc5469bac656ae2/lattice_polytope.py
Return the sequence of faces of this polytope.
Return the sequence of proper faces of this polytope.
def faces(self, dim=None, codim=None): r""" Return the sequence of faces of this polytope.
0c437a9fd38c44ead21aca785cc5469bac656ae2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/0c437a9fd38c44ead21aca785cc5469bac656ae2/lattice_polytope.py
self._points = self._embed(read_palp_matrix( self.poly_x("p", reduce_dimension=True))) self._points.set_immutable()
if self.dim() == 0: self._points = self._vertices else: self._points = self._embed(read_palp_matrix( self.poly_x("p", reduce_dimension=True))) self._points.set_immutable()
def points(self): r""" Return all lattice points of this polytope as columns of a matrix.
0c437a9fd38c44ead21aca785cc5469bac656ae2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/0c437a9fd38c44ead21aca785cc5469bac656ae2/lattice_polytope.py
sage: f1(x) = 1 sage: f2(x) = 1-x sage: f = Piecewise([[(0,1),f1],[(1,2),f2]])
sage: f1(x) = 1-x sage: f = Piecewise([[(0,1),1],[(1,2),f1]])
def integral(self, x=None, a=None, b=None, definite=False): r""" By default, returns the indefinite integral of the function. If definite=True is given, returns the definite integral.
e8ef019171ad607aab4ce833d63168ff9b0ef837 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/e8ef019171ad607aab4ce833d63168ff9b0ef837/piecewise.py
Return a new Weierstrass model of self under the standard transformation `(u,r,s,,t)`
Return a new Weierstrass model of self under the standard transformation `(u,r,s,t)`
def change_weierstrass_model(self, *urst): r""" Return a new Weierstrass model of self under the standard transformation `(u,r,s,,t)`
60581bf6d640bfa4b7f71a19999bd0feb09d2c88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/60581bf6d640bfa4b7f71a19999bd0feb09d2c88/ell_generic.py
(x,y) \mapsto (x',y') = (u^2xr , u^3y + su^2x' + t).
(x,y) \mapsto (x',y') = (u^2x + r , u^3y + su^2x + t).
def change_weierstrass_model(self, *urst): r""" Return a new Weierstrass model of self under the standard transformation `(u,r,s,,t)`
60581bf6d640bfa4b7f71a19999bd0feb09d2c88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/60581bf6d640bfa4b7f71a19999bd0feb09d2c88/ell_generic.py