rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
sage: rho, phi, z = var('rho phi z') sage: T.gen_transform(rho=rho, phi=phi, z=z) (rho*cos(phi), rho*sin(phi), z) Use with plot3d on a made-up function:: sage: plot3d(phi * z, (phi, 0, 1), (z, 0, 1), transformation=T) To graph a function ``z`` in terms of ``phi`` and ``rho`` you would use:: sage: Cylindrical('z', [...
sage: r, theta, z = var('r theta z') sage: T.transform(radius=r, azimuth=theta, height=z) (r*cos(theta), r*sin(theta), z) We can plot with this transform. Remember that the independent variable is the height, and the dependent variables are the radius and the azimuth (in that order):: sage: plot3d(9-r^2, (r, 0, 3), ...
def gen_transform(self, r=None, theta=None, phi=None): """ EXAMPLE:: sage: T = Spherical('r', ['theta', 'phi']) sage: T.gen_transform(r=var('r'), theta=var('theta'), phi=var('phi')) (r*sin(theta)*cos(phi), r*sin(phi)*sin(theta), r*cos(theta)) """ return (r * sin(theta) * cos(phi), r * sin(theta) * sin(phi), r * cos(th...
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
_name = 'Cylindrical coordinate system' all_vars = ['rho', 'phi', 'z'] def gen_transform(self, rho=None, phi=None, z=None): """
def transform(self, radius=None, azimuth=None, height=None): """ A cylindrical coordinates transform.
def gen_transform(self, r=None, theta=None, phi=None): """ EXAMPLE:: sage: T = Spherical('r', ['theta', 'phi']) sage: T.gen_transform(r=var('r'), theta=var('theta'), phi=var('phi')) (r*sin(theta)*cos(phi), r*sin(phi)*sin(theta), r*cos(theta)) """ return (r * sin(theta) * cos(phi), r * sin(theta) * sin(phi), r * cos(th...
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
sage: T = Cylindrical('z', ['phi', 'rho']) sage: T.gen_transform(rho=var('rho'), phi=var('phi'), z=var('z')) (rho*cos(phi), rho*sin(phi), z) """ return (rho * cos(phi), rho * sin(phi), z)
sage: T = Cylindrical('height', ['azimuth', 'radius']) sage: T.transform(radius=var('r'), azimuth=var('theta'), height=var('z')) (r*cos(theta), r*sin(theta), z) """ return (radius * cos(azimuth), radius * sin(azimuth), height)
def gen_transform(self, rho=None, phi=None, z=None): """ EXAMPLE::
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
- ``transformation`` - (default: None) a transformation to apply. May be a 4-tuple (x_func, y_func, z_func, fvar) where the first 3 items indicate a transformation to cartesian coordinates (from your coordinate system) in terms of u, v, and the function variable fvar (for which the value of f will be substituted). May ...
- ``transformation`` - (default: None) a transformation to apply. May be a 3 or 4-tuple (x_func, y_func, z_func, independent_vars) where the first 3 items indicate a transformation to cartesian coordinates (from your coordinate system) in terms of u, v, and the function variable fvar (for which the value of f will be s...
def plot3d(f, urange, vrange, adaptive=False, transformation=None, **kwds): """ INPUT: - ``f`` - a symbolic expression or function of 2 variables - ``urange`` - a 2-tuple (u_min, u_max) or a 3-tuple (u, u_min, u_max) - ``vrange`` - a 2-tuple (v_min, v_max) or a 3-tuple (v, v_min, v_max) - ``adaptive`` - (defau...
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
sage: trans=(r*cos(phi),r*sin(phi),z,z)
sage: trans=(r*cos(phi),r*sin(phi),z)
def plot3d(f, urange, vrange, adaptive=False, transformation=None, **kwds): """ INPUT: - ``f`` - a symbolic expression or function of 2 variables - ``urange`` - a 2-tuple (u_min, u_max) or a 3-tuple (u, u_min, u_max) - ``vrange`` - a 2-tuple (v_min, v_max) or a 3-tuple (v, v_min, v_max) - ``adaptive`` - (defau...
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
sage: rectangular=(u,v,w,w) sage: spherical=(w*cos(u)*sin(v),w*sin(u)*sin(v),w*cos(v),w) sage: cylindric_radial=(w*cos(u),w*sin(u),v,w) sage: cylindric_axial=(v*cos(u),v*sin(u),w,w) sage: parabolic_cylindrical=(w*v,(v^2-w^2)/2,u,w)
sage: rectangular=(u,v,w) sage: spherical=(w*cos(u)*sin(v),w*sin(u)*sin(v),w*cos(v)) sage: cylindric_radial=(w*cos(u),w*sin(u),v) sage: cylindric_axial=(v*cos(u),v*sin(u),w) sage: parabolic_cylindrical=(w*v,(v^2-w^2)/2,u)
def plot3d(f, urange, vrange, adaptive=False, transformation=None, **kwds): """ INPUT: - ``f`` - a symbolic expression or function of 2 variables - ``urange`` - a 2-tuple (u_min, u_max) or a 3-tuple (u, u_min, u_max) - ``vrange`` - a 2-tuple (v_min, v_max) or a 3-tuple (v, v_min, v_max) - ``adaptive`` - (defau...
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
sage: def _(which_plot=[A,B,C,D,E]):
... def _(which_plot=[A,B,C,D,E]):
sage: def _(which_plot=[A,B,C,D,E]):
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
sage: def _(which_plot=[F, G, H, I, J]):
... def _(which_plot=[F, G, H, I, J]):
sage: def _(which_plot=[F, G, H, I, J]):
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
else: raise ValueError, 'expected 3-tuple for urange and vrange'
sage: def _(which_plot=[F, G, H, I, J]):
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
transformation = _ArbCoordTrans(transformation[0:3], transformation[3]) if isinstance(transformation, _CoordTrans):
if len(transformation)==3: if params is None: raise ValueError, "must specify independent variable names in the ranges when using generic transformation" indep_vars = params elif len(transformation)==4: indep_vars = transformation[3] transformation = transformation[0:3] else: raise ValueError, "unknown transformation t...
sage: def _(which_plot=[F, G, H, I, J]):
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
Takes a function and plots it in spherical coordinates in the domain specified by urange and vrange. This function is equivalent to:: sage: var('r,u,u') sage: T = (r*cos(u)*sin(v), r*sin(u)*sin(v), r*cos(v), r)
Plots a function in spherical coordinates. This function is equivalent to:: sage: r,u,v=var('r,u,v') sage: f=u*v; urange=(u,0,pi); vrange=(v,0,pi) sage: T = (r*cos(u)*sin(v), r*sin(u)*sin(v), r*cos(v), [u,v])
def spherical_plot3d(f, urange, vrange, **kwds): """ Takes a function and plots it in spherical coordinates in the domain specified by urange and vrange. This function is equivalent to:: sage: var('r,u,u') sage: T = (r*cos(u)*sin(v), r*sin(u)*sin(v), r*cos(v), r) sage: plot3d(f, urange, vrange, transformation=T) INPU...
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
return plot3d(f, urange, vrange, transformation=Spherical('r', ['phi', 'theta']), **kwds)
return plot3d(f, urange, vrange, transformation=Spherical('radius', ['azimuth', 'inclination']), **kwds)
def spherical_plot3d(f, urange, vrange, **kwds): """ Takes a function and plots it in spherical coordinates in the domain specified by urange and vrange. This function is equivalent to:: sage: var('r,u,u') sage: T = (r*cos(u)*sin(v), r*sin(u)*sin(v), r*cos(v), r) sage: plot3d(f, urange, vrange, transformation=T) INPU...
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
Takes a function and plots it in cylindrical coordinates in the domain specified by urange and vrange. This command is equivalent to:: sage: var('r,u,v') sage: T = (r*cos(u), r*sin(u), v, r)
Plots a function in cylindrical coordinates. This function is equivalent to:: sage: r,u,v=var('r,u,v') sage: f=u*v; urange=(u,0,pi); vrange=(v,0,pi) sage: T = (r*cos(u), r*sin(u), v, [u,v])
def cylindrical_plot3d(f, urange, vrange, **kwds): """ Takes a function and plots it in cylindrical coordinates in the domain specified by urange and vrange. This command is equivalent to:: sage: var('r,u,v') sage: T = (r*cos(u), r*sin(u), v, r) sage: plot3d(f, urange, vrange, transformation=T) INPUT: - ``f`` - a sy...
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
- ``f`` - a symbolic expression or function of two variables. - ``urange`` - a 3-tuple (u, u_min, u_max), the domain of the azimuth variable. - ``vrange`` - a 3-tuple (v, v_min, v_max), the domain of the elevation (z) variable.
- ``f`` - a symbolic expression or function of two variables, representing the radius from the `z`-axis. - ``urange`` - a 3-tuple (u, u_min, u_max), the domain of the azimuth variable. - ``vrange`` - a 3-tuple (v, v_min, v_max), the domain of the elevation (`z`) variable.
def cylindrical_plot3d(f, urange, vrange, **kwds): """ Takes a function and plots it in cylindrical coordinates in the domain specified by urange and vrange. This command is equivalent to:: sage: var('r,u,v') sage: T = (r*cos(u), r*sin(u), v, r) sage: plot3d(f, urange, vrange, transformation=T) INPUT: - ``f`` - a sy...
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
sage: var('fi,z') sage: cylindrical_plot3d(2,(fi,0,3*pi/2),(z,-2,2))
sage: theta,z=var('theta,z') sage: cylindrical_plot3d(2,(theta,0,3*pi/2),(z,-2,2))
def cylindrical_plot3d(f, urange, vrange, **kwds): """ Takes a function and plots it in cylindrical coordinates in the domain specified by urange and vrange. This command is equivalent to:: sage: var('r,u,v') sage: T = (r*cos(u), r*sin(u), v, r) sage: plot3d(f, urange, vrange, transformation=T) INPUT: - ``f`` - a sy...
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
sage: cylindrical_plot3d(cosh(z),(fi,0,2*pi),(z,-2,2))
sage: cylindrical_plot3d(cosh(z),(theta,0,2*pi),(z,-2,2))
def cylindrical_plot3d(f, urange, vrange, **kwds): """ Takes a function and plots it in cylindrical coordinates in the domain specified by urange and vrange. This command is equivalent to:: sage: var('r,u,v') sage: T = (r*cos(u), r*sin(u), v, r) sage: plot3d(f, urange, vrange, transformation=T) INPUT: - ``f`` - a sy...
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
sage: cylindrical_plot3d(e^(-z^2)*(cos(4*fi)+2)+1,(fi,0,2*pi),(z,-2,2),plot_points=[80,80]).show(aspect_ratio=(1,1,1)) """ return plot3d(f, urange, vrange, transformation=Cylindrical('rho', ['phi', 'z']), **kwds)
sage: cylindrical_plot3d(e^(-z^2)*(cos(4*theta)+2)+1,(theta,0,2*pi),(z,-2,2),plot_points=[80,80]).show(aspect_ratio=(1,1,1)) """ return plot3d(f, urange, vrange, transformation=Cylindrical('radius', ['azimuth', 'height']), **kwds)
def cylindrical_plot3d(f, urange, vrange, **kwds): """ Takes a function and plots it in cylindrical coordinates in the domain specified by urange and vrange. This command is equivalent to:: sage: var('r,u,v') sage: T = (r*cos(u), r*sin(u), v, r) sage: plot3d(f, urange, vrange, transformation=T) INPUT: - ``f`` - a sy...
6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py
assert z.denominator() == 1, "bug in global_integral_model: %s" % ai
assert z.is_integral(), "bug in global_integral_model: %s" % list(ai)
def global_integral_model(self): r""" Return a model of self which is integral at all primes. EXAMPLES::
1e1b84dfb562091e50358476d5081739bd059460 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1e1b84dfb562091e50358476d5081739bd059460/ell_number_field.py
SL(n); you also some information about representations of E6
SL(n); you also lose some information about representations of E6
def WeylCharacterRing(ct, base_ring=ZZ, prefix=None, cache=False, style="lattice"): r""" A class for rings of Weyl characters. The Weyl character is a character of a semisimple (or reductive) Lie group or algebra. They form a ring, in which the addition and multiplication correspond to direct sum and tensor product of ...
b52994188bcd78a4f611d59c6a1849a3a6aff83e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b52994188bcd78a4f611d59c6a1849a3a6aff83e/weyl_characters.py
"automorphic", "symmetric", "extended", "triality" or "miscellaneous". The use of these rules will be explained next. After the examples we will explain how to write your own branching rules for cases that we have omitted.
"automorphic", "symmetric", "extended", "orthogonal_sum", "tensor", "triality" or "miscellaneous". The use of these rules will be explained next. After the examples we will explain how to write your own branching rules for cases that we have omitted.
def branch_weyl_character(chi, R, S, rule="default"): r""" A Branching rule describes the restriction of representations from a Lie group or algebra G to a smaller one. See for example, R. C. King, Branching rules for classical Lie groups using tensor and spinor methods. J. Phys. A 8 (1975), 429-449, Howe, Tan and Will...
b52994188bcd78a4f611d59c6a1849a3a6aff83e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b52994188bcd78a4f611d59c6a1849a3a6aff83e/weyl_characters.py
SYMMETRIC TYPE. Related to the automorphic type, when either the Dynkin diagram or the extended diagram has a symmetry there is a branching rule to the subalgebra (or subgroup) of invariants under the automorphism. Use rule="symmetric".
SYMMETRIC TYPE. Related to the automorphic type, when G admits an outer automorphism (usually of degree 2) we may consider the branching rule to the isotropy subgroup H. In many cases the Dynkin diagram of H can be obtained by folding the Dynkin diagram of G. For such isotropy subgroups use rule="symmetric".
def branch_weyl_character(chi, R, S, rule="default"): r""" A Branching rule describes the restriction of representations from a Lie group or algebra G to a smaller one. See for example, R. C. King, Branching rules for classical Lie groups using tensor and spinor methods. J. Phys. A 8 (1975), 429-449, Howe, Tan and Will...
b52994188bcd78a4f611d59c6a1849a3a6aff83e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b52994188bcd78a4f611d59c6a1849a3a6aff83e/weyl_characters.py
Using rule="extended" you can get any branching rule SO(n) => SO(a) x SO(b) x SO(c) x ... where n = a+b+c+ ... Sp(2n) => Sp(2a) x Sp(2b) x Sp(2c) x ... where n = a+b+c+ ... where O(a) = ['D',r] (a=2r) or ['B',r] (a=2r+1) and Sp(2r)=['C',r].
def branch_weyl_character(chi, R, S, rule="default"): r""" A Branching rule describes the restriction of representations from a Lie group or algebra G to a smaller one. See for example, R. C. King, Branching rules for classical Lie groups using tensor and spinor methods. J. Phys. A 8 (1975), 429-449, Howe, Tan and Will...
b52994188bcd78a4f611d59c6a1849a3a6aff83e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b52994188bcd78a4f611d59c6a1849a3a6aff83e/weyl_characters.py
elif rule == "extended": if not s == r:
elif rule == "extended" or rule == "orthogonal_sum": if rule == "extended" and not s == r:
def rule(x) : x[len(x)-1] = -x[len(x)-1]; return x
b52994188bcd78a4f611d59c6a1849a3a6aff83e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b52994188bcd78a4f611d59c6a1849a3a6aff83e/weyl_characters.py
if x == 0:
if x == 0 and not x in self._space:
def __call__(self, *args): """ Coerces the element into the ring. INPUT: - ``x`` - a ring element EXAMPLES:: sage: a2 = WeightRing(WeylCharacterRing(['A',2])) sage: a2(-1) -a2(0,0,0) """ if len(args) == 1: x = args[0] else: x = args if x == 0: return WeightRingElement(self, {}) if x in ZZ: mdict = {self._origin:...
b52994188bcd78a4f611d59c6a1849a3a6aff83e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b52994188bcd78a4f611d59c6a1849a3a6aff83e/weyl_characters.py
sage: G = matrix(GF(2),[[1,0,0],[1,1,0]]) sage: C = LinearCode(G) sage: C.dimension() 2
sage: G = matrix(GF(2),[[1,0,0],[1,1,0]]) sage: C = LinearCode(G) sage: C.dimension() 2
def dimension(self): r""" Returns the dimension of this code. EXAMPLES:: sage: G = matrix(GF(2),[[1,0,0],[1,1,0]]) sage: C = LinearCode(G) sage: C.dimension() 2 """ return self.__dim
f1481b520156da7cdd4d6adefe31299a038fab0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f1481b520156da7cdd4d6adefe31299a038fab0a/linear_code.py
Returns the Duursama data `v` and `m` of this formally s.d. code `C`
Returns the Duursma data `v` and `m` of this formally s.d. code `C`
def sd_duursma_data(C, i): r""" Returns the Duursama data `v` and `m` of this formally s.d. code `C` and the type number `i` in (1,2,3,4). Does *not* check if this code is actually sd. INPUT: - ``i`` - Type number OUTPUT: - Pair ``(v, m)`` as in Duursama [D]_ REFERENCES: - [D] - I. Duursma, "Extremal weight enum...
f1481b520156da7cdd4d6adefe31299a038fab0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f1481b520156da7cdd4d6adefe31299a038fab0a/linear_code.py
- Pair ``(v, m)`` as in Duursama [D]_
- Pair ``(v, m)`` as in Duursma [D]_
def sd_duursma_data(C, i): r""" Returns the Duursama data `v` and `m` of this formally s.d. code `C` and the type number `i` in (1,2,3,4). Does *not* check if this code is actually sd. INPUT: - ``i`` - Type number OUTPUT: - Pair ``(v, m)`` as in Duursama [D]_ REFERENCES: - [D] - I. Duursma, "Extremal weight enum...
f1481b520156da7cdd4d6adefe31299a038fab0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f1481b520156da7cdd4d6adefe31299a038fab0a/linear_code.py
- [D] - I. Duursma, "Extremal weight enumerators and ultraspherical polynomials"
.. [D] I. Duursma, "Extremal weight enumerators and ultraspherical polynomials"
def sd_duursma_data(C, i): r""" Returns the Duursama data `v` and `m` of this formally s.d. code `C` and the type number `i` in (1,2,3,4). Does *not* check if this code is actually sd. INPUT: - ``i`` - Type number OUTPUT: - Pair ``(v, m)`` as in Duursama [D]_ REFERENCES: - [D] - I. Duursma, "Extremal weight enum...
f1481b520156da7cdd4d6adefe31299a038fab0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f1481b520156da7cdd4d6adefe31299a038fab0a/linear_code.py
- Coefficients `q_0, q_1, ...` of `q(T)` as in Duursama [D]_
- Coefficients `q_0, q_1, ...` of `q(T)` as in Duursma [D]_
def sd_duursma_q(C,i,d0): r""" INPUT: - ``C`` - sd code; does *not* check if `C` is actually an sd code - ``i`` - Type number, one of 1,2,3,4 - ``d0`` - Divisor, the smallest integer such that each `A_i > 0` iff `i` is divisible by `d0` OUTPUT: - Coefficients `q_0, q_1, ...` of `q(T)` as in Duursama [D]_ REFEREN...
f1481b520156da7cdd4d6adefe31299a038fab0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f1481b520156da7cdd4d6adefe31299a038fab0a/linear_code.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.
8f9c28d814253042e193c64fe9c63ee15b32aacb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8f9c28d814253042e193c64fe9c63ee15b32aacb/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.
8f9c28d814253042e193c64fe9c63ee15b32aacb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8f9c28d814253042e193c64fe9c63ee15b32aacb/point.py
def point(points, **kwds): """ Returns either a 2-dimensional or 3-dimensional point or sum of points. INPUT: - ``points`` - either a single point (as a tuple) or a list of points. For information regarding additional arguments, see either point2d? or point3d?. EXAMPLES:: sage: point((1,2)) sage: point((1,2,3)) s...
8f9c28d814253042e193c64fe9c63ee15b32aacb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8f9c28d814253042e193c64fe9c63ee15b32aacb/point.py
img = self(letter)
img = self.image(letter)
def is_identity(self): r""" Returns ``True`` if ``self`` is the identity morphism. EXAMPLES::
1680aa30535c96273945f9221b43e9446ab94d05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1680aa30535c96273945f9221b43e9446ab94d05/morphism.py
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...
833988df1fc989b4d40636261251b29552777642 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/833988df1fc989b4d40636261251b29552777642/number_field.py
"""
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. - ``...
833988df1fc989b4d40636261251b29552777642 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/833988df1fc989b4d40636261251b29552777642/number_field.py
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...
f8af711701bc089bc1b8de230c2f1e8220eef67e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f8af711701bc089bc1b8de230c2f1e8220eef67e/arith.py
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...
f8af711701bc089bc1b8de230c2f1e8220eef67e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f8af711701bc089bc1b8de230c2f1e8220eef67e/arith.py
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...
f8af711701bc089bc1b8de230c2f1e8220eef67e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f8af711701bc089bc1b8de230c2f1e8220eef67e/arith.py
"""
r"""
def eigenvalues(self,extend=True): """ Returns a list with the eigenvalues of the endomorphism of vector spaces. If the option extend is set to True (default), then eigenvalues in extensions of the base field are considered. EXAMPLES: We compute the eigenvalues of an endomorphism of QQ^3:: sage: V=QQ^3 sage: H=V.en...
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
If the option extend is set to True (default), then eigenvalues in extensions of the base field are considered.
INPUT: - ``extend`` -- boolean (default: True) decides if base field extensions should be considered or not.
def eigenvalues(self,extend=True): """ Returns a list with the eigenvalues of the endomorphism of vector spaces. If the option extend is set to True (default), then eigenvalues in extensions of the base field are considered. EXAMPLES: We compute the eigenvalues of an endomorphism of QQ^3:: sage: V=QQ^3 sage: H=V.en...
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
We compute the eigenvalues of an endomorphism of QQ^3::
We compute the eigenvalues of an endomorphism of `\QQ^3`::
def eigenvalues(self,extend=True): """ Returns a list with the eigenvalues of the endomorphism of vector spaces. If the option extend is set to True (default), then eigenvalues in extensions of the base field are considered. EXAMPLES: We compute the eigenvalues of an endomorphism of QQ^3:: sage: V=QQ^3 sage: H=V.en...
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
Note the effect of the extend option::
Note the effect of the ``extend`` option::
def eigenvalues(self,extend=True): """ Returns a list with the eigenvalues of the endomorphism of vector spaces. If the option extend is set to True (default), then eigenvalues in extensions of the base field are considered. EXAMPLES: We compute the eigenvalues of an endomorphism of QQ^3:: sage: V=QQ^3 sage: H=V.en...
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
def eigenvalues(self,extend=True): """ Returns a list with the eigenvalues of the endomorphism of vector spaces. If the option extend is set to True (default), then eigenvalues in extensions of the base field are considered. EXAMPLES: We compute the eigenvalues of an endomorphism of QQ^3:: sage: V=QQ^3 sage: H=V.en...
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
- extend (True) decides if base field extensions should be considered or not.
- ``extend`` -- boolean (default: True) decides if base field extensions should be considered or not.
def eigenvectors(self,extend=True): """ Computes the subspace of eigenvectors of a given eigenvalue. INPUT: - extend (True) decides if base field extensions should be considered or not. OUTPUT: A sequence of tuples. Each tuple contains an eigenvalue, a list with a basis of the corresponding subspace of eigenvectors...
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
A sequence of tuples. Each tuple contains an eigenvalue, a list with a basis of the corresponding subspace of eigenvectors, and the algebraic multiplicity of the eigenvalue.
A sequence of tuples. Each tuple contains an eigenvalue, a sequence with a basis of the corresponding subspace of eigenvectors, and the algebraic multiplicity of the eigenvalue.
def eigenvectors(self,extend=True): """ Computes the subspace of eigenvectors of a given eigenvalue. INPUT: - extend (True) decides if base field extensions should be considered or not. OUTPUT: A sequence of tuples. Each tuple contains an eigenvalue, a list with a basis of the corresponding subspace of eigenvectors...
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
[(3, [(0, 0, 1, -6/7)], 1), (-1*I, [(1, 1*I, 0, -0.571428571428572? + 2.428571428571429?*I)], 1), (1*I, [(1, -1*I, 0, -0.571428571428572? - 2.428571428571429?*I)], 1)]
[(3, [ (0, 0, 1, -6/7) ], 1), (-1*I, [ (1, 1*I, 0, -0.571428571428572? + 2.428571428571429?*I) ], 1), (1*I, [ (1, -1*I, 0, -0.571428571428572? - 2.428571428571429?*I) ], 1)]
def eigenvectors(self,extend=True): """ Computes the subspace of eigenvectors of a given eigenvalue. INPUT: - extend (True) decides if base field extensions should be considered or not. OUTPUT: A sequence of tuples. Each tuple contains an eigenvalue, a list with a basis of the corresponding subspace of eigenvectors...
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
[(3, [(0, 0, 1, -6/7)], 1)]
[(3, [ (0, 0, 1, -6/7) ], 1)]
def eigenvectors(self,extend=True): """ Computes the subspace of eigenvectors of a given eigenvalue. INPUT: - extend (True) decides if base field extensions should be considered or not. OUTPUT: A sequence of tuples. Each tuple contains an eigenvalue, a list with a basis of the corresponding subspace of eigenvectors...
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
[(3, [(0, 0, 1, -6/7)], 1), (2, [(0, 1, 0, 17/7)], 2)]
[(3, [ (0, 0, 1, -6/7) ], 1), (2, [ (0, 1, 0, 17/7) ], 2)]
def eigenvectors(self,extend=True): """ Computes the subspace of eigenvectors of a given eigenvalue. INPUT: - extend (True) decides if base field extensions should be considered or not. OUTPUT: A sequence of tuples. Each tuple contains an eigenvalue, a list with a basis of the corresponding subspace of eigenvectors...
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
[(3, [(0, 0, 1, -6/7)], 1), (2, [(0, 1, 0, 17/7)], 2)]
[(3, [ (0, 0, 1, -6/7) ], 1), (2, [ (0, 1, 0, 17/7) ], 2)]
def eigenvectors(self,extend=True): """ Computes the subspace of eigenvectors of a given eigenvalue. INPUT: - extend (True) decides if base field extensions should be considered or not. OUTPUT: A sequence of tuples. Each tuple contains an eigenvalue, a list with a basis of the corresponding subspace of eigenvectors...
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
svectors=map(lambda j: V(j * V.basis_matrix()),i[1]) resu.append(tuple([i[0],svectors,i[2]]))
svectors=Sequence(map(lambda j: V(j * V.basis_matrix()),i[1]), cr=True) resu.append((i[0],svectors,i[2]))
def eigenvectors(self,extend=True): """ Computes the subspace of eigenvectors of a given eigenvalue. INPUT: - extend (True) decides if base field extensions should be considered or not. OUTPUT: A sequence of tuples. Each tuple contains an eigenvalue, a list with a basis of the corresponding subspace of eigenvectors...
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
- ``var`` - string (default: 'x') a variable
- ``var`` - string (default: 'x') a variable name
def minpoly(self,var='x'): """ Computes the minimal polynomial. INPUT: - ``var`` - string (default: 'x') a variable OUTPUT: polynomial in var - the minimal polynomial of the endomorphism. EXAMPLES: Compute the minimal polynomial, and check it :: sage: V=GF(7)^3 sage: H=V.Hom(V)([[0,1,2],[-1,0,3],[2,4,1]]) sage:...
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
raise TypeError, "not an endomorphism"
raise TypeError, "not an endomorphism"
def minpoly(self,var='x'): """ Computes the minimal polynomial. INPUT: - ``var`` - string (default: 'x') a variable OUTPUT: polynomial in var - the minimal polynomial of the endomorphism. EXAMPLES: Compute the minimal polynomial, and check it :: sage: V=GF(7)^3 sage: H=V.Hom(V)([[0,1,2],[-1,0,3],[2,4,1]]) sage:...
9bb09580aa7e219d556bbf2e0ec6c8440ac569f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9bb09580aa7e219d556bbf2e0ec6c8440ac569f7/free_module_morphism.py
def CharacteristicSturmianWord(self, cf, alphabet=(0, 1), bits=None): r""" Returns the characteristic Sturmian word of the given slope ``cf``. The `n`-th term of the characteristic Sturmian word of an irrational slope `\alpha` is `\lfloor\alpha(n+1)\rfloor - \lfloor\alpha n\rfloor + \lfloor\alpha\rfloor`. [1]
def CharacteristicSturmianWord(self, slope, alphabet=(0, 1), bits=None): r""" Returns the characteristic Sturmian word (also called standard Sturmian word) of given slope. Over a binary alphabet `\{a,b\}`, the characteristic Sturmian word `c_\alpha` of slope `\alpha` is the infinite word satisfying `s_{\alpha,0} = ac_...
def CharacteristicSturmianWord(self, cf, alphabet=(0, 1), bits=None): r""" Returns the characteristic Sturmian word of the given slope ``cf``.
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
- ``cf`` - the slope of the word. It can be one of the following :
- ``slope`` - the slope of the word. It can be one of the following :
def CharacteristicSturmianWord(self, cf, alphabet=(0, 1), bits=None): r""" Returns the characteristic Sturmian word of the given slope ``cf``.
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
- ``bits`` - integer (optional and considered only if ``cf`` is a real number) the number of bits to consider when computing the
- ``bits`` - integer (optional and considered only if ``slope`` is a real number) the number of bits to consider when computing the
def CharacteristicSturmianWord(self, cf, alphabet=(0, 1), bits=None): r""" Returns the characteristic Sturmian word of the given slope ``cf``.
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
slope `\alpha` is the limit of the sequence: `s_0 = 1`, `s_1 = 0`
slope `\alpha` is the limit of the sequence: `s_0 = b`, `s_1 = a`
def CharacteristicSturmianWord(self, cf, alphabet=(0, 1), bits=None): r""" Returns the characteristic Sturmian word of the given slope ``cf``.
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
The characteristic sturmian word of slope `(\sqrt(3)-1)/2`::
The characteristic sturmian word of slope `(\sqrt{3}-1)/2`::
sage: def cf():
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
`(\sqrt(3)-1)/2`::
`(\sqrt{3}-1)/2`::
sage: def cf():
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
sturmian word of slope `(\sqrt(3)-1)/2`::
sturmian word of slope `(\sqrt{3}-1)/2`::
sage: def cf():
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
NotImplementedError: The argument cf (=5/4) must be in ]0,1[.
ValueError: The argument slope (=5/4) must be in ]0,1[.
sage: def cf():
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
if cf in RR: if not 0 < cf < 1: msg = "The argument cf (=%s) must be in ]0,1[."%cf raise NotImplementedError, msg
if slope in RR: if not 0 < slope < 1: msg = "The argument slope (=%s) must be in ]0,1[."%slope raise ValueError, msg
sage: def cf():
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
cf = iter(CFF(cf, bits=bits))
cf = iter(CFF(slope, bits=bits))
sage: def cf():
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
elif hasattr(cf, '__iter__'): cf = iter(cf)
elif hasattr(slope, '__iter__'): cf = iter(slope)
sage: def cf():
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
raise TypeError("cf (=%s) must be a real number"%cf +
raise TypeError("slope (=%s) must be a real number"%slope +
sage: def cf():
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
Returns the lower mechanical word. The word `s_{\alpha,\rho}` is the *lower mechanical word* with slope `\alpha` and intercept `\rho` defined by
Returns the lower mechanical word with slope `\alpha` and intercept `\rho` The lower mechanical word `s_{\alpha,\rho}` with slope `\alpha` and intercept `\rho` is defined by
def LowerMechanicalWord(self, alpha, rho=0, alphabet=None): r""" Returns the lower mechanical word.
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
\lfloor\alpha n + \rho\rfloor`. [1]
\lfloor\alpha n + \rho\rfloor` [1].
def LowerMechanicalWord(self, alpha, rho=0, alphabet=None): r""" Returns the lower mechanical word.
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
raise NotImplementedError, msg
raise ValueError, msg
def LowerMechanicalWord(self, alpha, rho=0, alphabet=None): r""" Returns the lower mechanical word.
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
Returns the upper mechanical word. The word `s'_{\alpha,\rho}` is the *upper mechanical word* with slope `\alpha` and intercept `\rho` defined by
Returns the upper mechanical word with slope `\alpha` and intercept `\rho` The upper mechanical word `s'_{\alpha,\rho}` with slope `\alpha` and intercept `\rho` is defined by
def UpperMechanicalWord(self, alpha, rho=0, alphabet=None): r""" Returns the upper mechanical word.
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
raise NotImplementedError, msg
raise ValueError, msg
def UpperMechanicalWord(self, alpha, rho=0, alphabet=None): r""" Returns the upper mechanical word.
a5b928a04b88cb182372bb9a126740cba8c57ec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a5b928a04b88cb182372bb9a126740cba8c57ec9/word_generators.py
occured. Please put there the version of sageq at the time of deprecation.
occurred. Please put there the version of sage at the time of deprecation.
def deprecation(message, version=None): r""" Issue a deprecation warning. INPUT: - ``message`` - an explanation why things are deprecated and by what it should be replaced. - ``version`` - (optional) on which version and when the deprecation occured. Please put there the version of sageq at the time of deprecation. ...
b71f787ebeb60368a6fd10dd72fd720b8414ea3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b71f787ebeb60368a6fd10dd72fd720b8414ea3c/misc.py
A wrapper around methods or functions wich automatically print the correct
A wrapper around methods or functions which automatically print the correct
sage: def bar():
b71f787ebeb60368a6fd10dd72fd720b8414ea3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b71f787ebeb60368a6fd10dd72fd720b8414ea3c/misc.py
sage: def is_4regular(G): ... D = G.degree_sequence() ... return all(d == 4 for d in D) sage: is_4regular(G)
sage: G.is_regular(4)
sage: def is_4regular(G):
d0b299777a1d933e2d50ac19e0a3ed2fea5c664c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/d0b299777a1d933e2d50ac19e0a3ed2fea5c664c/graph_generators.py
xy_data_arrays = map(lambda g: [[g(x, y) for x in xsrange(*ranges[0], include_endpoint=True)] for y in xsrange(*ranges[1], include_endpoint=True)], g) xy_data_array = map(lambda *rows: map(lambda *vals: mangle_neg(vals), *rows), *xy_data_arrays)
xy_data_arrays = numpy.asarray([[[func(x, y) for x in xsrange(*ranges[0], include_endpoint=True)] for y in xsrange(*ranges[1], include_endpoint=True)] for func in g],dtype=float) xy_data_array=numpy.abs(xy_data_arrays.prod(axis=0)) neg_indices = (xy_data_arrays<0).all(axis=0) xy_data_array[neg_indices]=-xy_data_array...
def region_plot(f, xrange, yrange, plot_points, incol, outcol, bordercol, borderstyle, borderwidth): r""" ``region_plot`` takes a boolean function of two variables, `f(x,y)` and plots the region where f is True over the specified ``xrange`` and ``yrange`` as demonstrated below. ``region_plot(f, (xmin, xmax), (ymin, ym...
98d332aa4388605d75a37f824a43a7ac50c110c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/98d332aa4388605d75a37f824a43a7ac50c110c0/contour_plot.py
def mangle_neg(vals): """ Returns the product of all values in vals, with the result nonnegative if any of the values is nonnegative. EXAMPLES:: sage: from sage.plot.contour_plot import mangle_neg sage: mangle_neg([-1.2, -0.74, -2.56, -1.01]) -2.29601280000000 sage: mangle_neg([-1.2, 0.0, -2.56]) 0.000000000000000 s...
def equify(f): """ Returns the equation rewritten as a symbolic function to give negative values when True, positive when False. EXAMPLES:: sage: from sage.plot.contour_plot import equify sage: var('x, y') (x, y) sage: equify(x^2 < 2) x^2 - 2 sage: equify(x^2 > 2) -x^2 + 2 sage: equify(x*y > 1) -x*y + 1 sage: equify(...
98d332aa4388605d75a37f824a43a7ac50c110c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/98d332aa4388605d75a37f824a43a7ac50c110c0/contour_plot.py
if P.eval("%s %s %s"%(self.name(), P._equality_symbol(), other.name())) == P._true_symbol(): return 0 elif P.eval("%s %s %s"%(self.name(), P._lessthan_symbol(), other.name())) == P._true_symbol(): return -1 elif P.eval("%s %s %s"%(self.name(), P._greaterthan_symbol(), other.name())) == P._true_symbol(): return 1
try: if P.eval("%s %s %s"%(self.name(), P._equality_symbol(), other.name())) == P._true_symbol(): return 0 except RuntimeError: pass try: if P.eval("%s %s %s"%(self.name(), P._lessthan_symbol(), other.name())) == P._true_symbol(): return -1 except RuntimeError: pass try: if P.eval("%s %s %s"%(self.name(), P._greatertha...
def __cmp__(self, other): P = self.parent() if P.eval("%s %s %s"%(self.name(), P._equality_symbol(), other.name())) == P._true_symbol(): return 0 elif P.eval("%s %s %s"%(self.name(), P._lessthan_symbol(), other.name())) == P._true_symbol(): return -1 elif P.eval("%s %s %s"%(self.name(), P._greaterthan_symbol(), other.n...
f6bba5b7c5e29901f4bdb654837918cf9694bc98 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f6bba5b7c5e29901f4bdb654837918cf9694bc98/expect.py
sage: P4 = simplicial_complexes.RealProjectiveSpace(4) sage: P4.f_vector()
sage: P4 = simplicial_complexes.RealProjectiveSpace(4) sage: P4.f_vector()
def RealProjectiveSpace(self, n): r""" A triangulation of `\Bold{R}P^n` for any `n \geq 0`.
48bcc4068d651cff86f439b3ba106c1b2aa53157 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/48bcc4068d651cff86f439b3ba106c1b2aa53157/examples.py
sage: P4.homology()
sage: P4.homology()
def RealProjectiveSpace(self, n): r""" A triangulation of `\Bold{R}P^n` for any `n \geq 0`.
48bcc4068d651cff86f439b3ba106c1b2aa53157 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/48bcc4068d651cff86f439b3ba106c1b2aa53157/examples.py
sage: P5.homology()
The following computation can take a long time -- over half an hour -- with Sage's default computation of homology groups, but if you have CHomP installed, Sage will use that and the computation should only take a second or two. (You can download CHomP from http://chomp.rutgers.edu/, or you can install it as a Sage p...
def RealProjectiveSpace(self, n): r""" A triangulation of `\Bold{R}P^n` for any `n \geq 0`.
48bcc4068d651cff86f439b3ba106c1b2aa53157 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/48bcc4068d651cff86f439b3ba106c1b2aa53157/examples.py
sage: P4.dimension()
sage: P4.dimension()
def RealProjectiveSpace(self, n): r""" A triangulation of `\Bold{R}P^n` for any `n \geq 0`.
48bcc4068d651cff86f439b3ba106c1b2aa53157 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/48bcc4068d651cff86f439b3ba106c1b2aa53157/examples.py
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.
18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18/maxima.py
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;...
18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18/maxima.py
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;...
18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18/maxima.py
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;...
18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18/maxima.py
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;...
18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18/maxima.py
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;...
18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18/maxima.py
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;...
18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18/maxima.py
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;...
18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18/maxima.py
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'...
18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18/maxima.py
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'...
18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18/maxima.py
'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()
18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/18bea2c8fdd74c7656bf4d7e11ecb828a4ecfd18/maxima.py
def parse_deps(self, filename, verify=True):
def parse_deps(self, filename, ext_module, verify=True):
def parse_deps(self, filename, verify=True): """ Open a Cython file and extract all of its dependencies. INPUT: filename -- the file to parse verify -- only return existing files (default True) OUTPUT: list of dependency files """ # only parse cython files if filename[-4:] not in ('.pyx', '.pxd', '.pxi'): return []...
578b3dc4ae6572d8955745050879ff3bb3e0334a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/578b3dc4ae6572d8955745050879ff3bb3e0334a/setup.py
if filename[-4:] not in ('.pyx', '.pxd', '.pxi'):
if not is_cython_file(filename):
def parse_deps(self, filename, verify=True): """ Open a Cython file and extract all of its dependencies. INPUT: filename -- the file to parse verify -- only return existing files (default True) OUTPUT: list of dependency files """ # only parse cython files if filename[-4:] not in ('.pyx', '.pxd', '.pxi'): return []...
578b3dc4ae6572d8955745050879ff3bb3e0334a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/578b3dc4ae6572d8955745050879ff3bb3e0334a/setup.py
for idir in CYTHON_INCLUDE_DIRS: new_path = os.path.normpath(idir + base_dependency_name)
for idir in ext_module.include_dirs + CYTHON_INCLUDE_DIRS + include_dirs + extra_include_dirs: new_path = os.path.normpath(idir + '/' + base_dependency_name)
def parse_deps(self, filename, verify=True): """ Open a Cython file and extract all of its dependencies. INPUT: filename -- the file to parse verify -- only return existing files (default True) OUTPUT: list of dependency files """ # only parse cython files if filename[-4:] not in ('.pyx', '.pxd', '.pxi'): return []...
578b3dc4ae6572d8955745050879ff3bb3e0334a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/578b3dc4ae6572d8955745050879ff3bb3e0334a/setup.py
if path[-2:] != '.h': raise IOError, "could not find dependency %s included in %s."%(path, filename)
msg = 'could not find dependency %s included in %s.'%(path, filename) if is_cython_file(filename): raise IOError, msg else: warnings.warn(msg+' I will assume it is a system C/C++ header.')
def parse_deps(self, filename, verify=True): """ Open a Cython file and extract all of its dependencies. INPUT: filename -- the file to parse verify -- only return existing files (default True) OUTPUT: list of dependency files """ # only parse cython files if filename[-4:] not in ('.pyx', '.pxd', '.pxi'): return []...
578b3dc4ae6572d8955745050879ff3bb3e0334a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/578b3dc4ae6572d8955745050879ff3bb3e0334a/setup.py
def immediate_deps(self, filename):
def immediate_deps(self, filename, ext_module):
def immediate_deps(self, filename): """ Returns a list of files directly referenced by this file. """ if (filename not in self._deps or self.timestamp(filename) < self._last_parse[filename]): self._deps[filename] = self.parse_deps(filename) self._last_parse[filename] = self.timestamp(filename) return self._deps[filenam...
578b3dc4ae6572d8955745050879ff3bb3e0334a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/578b3dc4ae6572d8955745050879ff3bb3e0334a/setup.py
self._deps[filename] = self.parse_deps(filename)
self._deps[filename] = self.parse_deps(filename, ext_module)
def immediate_deps(self, filename): """ Returns a list of files directly referenced by this file. """ if (filename not in self._deps or self.timestamp(filename) < self._last_parse[filename]): self._deps[filename] = self.parse_deps(filename) self._last_parse[filename] = self.timestamp(filename) return self._deps[filenam...
578b3dc4ae6572d8955745050879ff3bb3e0334a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/578b3dc4ae6572d8955745050879ff3bb3e0334a/setup.py
def all_deps(self, filename, path=None):
def all_deps(self, filename, ext_module, path=None):
def all_deps(self, filename, path=None): """ Returns all files directly or indirectly referenced by this file. A recursive algorithm is used here to maximize caching, but it is still robust for circular cimports (via the path parameter). """ if filename not in self._deps_all: circular = False deps = set([filename]) if...
578b3dc4ae6572d8955745050879ff3bb3e0334a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/578b3dc4ae6572d8955745050879ff3bb3e0334a/setup.py
for f in self.immediate_deps(filename):
for f in self.immediate_deps(filename, ext_module):
def all_deps(self, filename, path=None): """ Returns all files directly or indirectly referenced by this file. A recursive algorithm is used here to maximize caching, but it is still robust for circular cimports (via the path parameter). """ if filename not in self._deps_all: circular = False deps = set([filename]) if...
578b3dc4ae6572d8955745050879ff3bb3e0334a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/578b3dc4ae6572d8955745050879ff3bb3e0334a/setup.py
deps.update(self.all_deps(f, path))
deps.update(self.all_deps(f, ext_module, path))
def all_deps(self, filename, path=None): """ Returns all files directly or indirectly referenced by this file. A recursive algorithm is used here to maximize caching, but it is still robust for circular cimports (via the path parameter). """ if filename not in self._deps_all: circular = False deps = set([filename]) if...
578b3dc4ae6572d8955745050879ff3bb3e0334a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/578b3dc4ae6572d8955745050879ff3bb3e0334a/setup.py
def newest_dep(self, filename):
def newest_dep(self, filename, ext_module):
def newest_dep(self, filename): """ Returns the most recently modified file that filename depends on, along with its timestamp. """ nfile = filename ntime = self.timestamp(filename) for f in self.all_deps(filename): if self.timestamp(f) > ntime: nfile = f ntime = self.timestamp(f) return nfile, ntime
578b3dc4ae6572d8955745050879ff3bb3e0334a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/578b3dc4ae6572d8955745050879ff3bb3e0334a/setup.py