rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
[(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... | 894cddf7d59c87fdda637de94cd68aea251b5e24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/894cddf7d59c87fdda637de94cd68aea251b5e24/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... | 894cddf7d59c87fdda637de94cd68aea251b5e24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/894cddf7d59c87fdda637de94cd68aea251b5e24/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... | 894cddf7d59c87fdda637de94cd68aea251b5e24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/894cddf7d59c87fdda637de94cd68aea251b5e24/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:... | 894cddf7d59c87fdda637de94cd68aea251b5e24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/894cddf7d59c87fdda637de94cd68aea251b5e24/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:... | 894cddf7d59c87fdda637de94cd68aea251b5e24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/894cddf7d59c87fdda637de94cd68aea251b5e24/free_module_morphism.py |
if n == 1: return 1 for p in [2, 3, 5]: if n%p == 0: return p if bound == None: bound = n dif = [6, 4, 2, 4, 2, 4, 6, 2] m = 7; i = 1 while m <= bound and m*m <= n: if n%m == 0: return m m += dif[i%8] i += 1 return n | if bound is None: return ZZ(n).trial_division() else: return ZZ(n).trial_division(bound) | def trial_division(n, bound=None): """ Return the smallest prime divisor <= bound of the positive integer n, or n if there is no such prime. If the optional argument bound is omitted, then bound <= n. INPUT: - ``n`` - a positive integer - ``bound`` - (optional) a positive integer OUTPUT: - ``int`` - a prime p=bo... | 6d18586f182fd8270b711dd4b86b9f01eea68e1f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6d18586f182fd8270b711dd4b86b9f01eea68e1f/arith.py |
if n < 10000000000000: return factorization.Factorization(__factor_using_trial_division(n), unit) | 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 ... | 6d18586f182fd8270b711dd4b86b9f01eea68e1f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6d18586f182fd8270b711dd4b86b9f01eea68e1f/arith.py | |
sage: cmp(N3, 3) -1 | sage: abs( cmp(N3, 3) ) 1 | def __cmp__(self, right): r""" Compare ``self`` and ``right``. | 7504e26f6e7fb5dbffc2ab23331a5ef6dd63a901 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/7504e26f6e7fb5dbffc2ab23331a5ef6dd63a901/toric_lattice.py |
for i in xrange(0, l - 2): | for i in xrange(0, l-1): | def is_square_free(self): r""" Returns True if self does not contain squares, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_square_free() True sage: W('31212').is_square_free() False sage: W().is_square_free() True """ l = self.length() if l < 2: return True suff = self for i in xrange(0,... | 592952f61d90a039597099b7a4ed5f9f63b31e5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/592952f61d90a039597099b7a4ed5f9f63b31e5b/finite_word.py |
""" | TESTS:: sage: P = PolynomialRing(QQ, 0, '') sage: P(5).univariate_polynomial() 5 """ if self.parent().ngens() == 0: if R is None: return self.base_ring()(self) else: return R(self) | def univariate_polynomial(self, R=None): """ Returns a univariate polynomial associated to this multivariate polynomial. INPUT: - ``R`` - (default: None) PolynomialRing If this polynomial is not in at most one variable, then a ValueError exception is raised. This is checked using the is_univariate() method. The n... | 4aecbfb06ccdb1970331cfdfe27ba345af6da368 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4aecbfb06ccdb1970331cfdfe27ba345af6da368/multi_polynomial_element.py |
if self == 0: raise ArithmeticError, "Prime factorization of 0 not defined." if R.ngens() == 0: base_ring = self.base_ring() if base_ring.is_field(): return Factorization([],unit=self.base_ring()(self)) else: F = base_ring(self).factor() return Factorization([(R(f),m) for f,m in F], unit=F.unit()) | def factor(self, proof=True): r""" Compute the irreducible factorization of this polynomial. INPUT: - ``proof'' - insist on provably correct results (ignored, always ``True``) ALGORITHM: Use univariate factorization code. If a polynomial is univariate, the appropriate univariate factorization code is called. :: s... | 4aecbfb06ccdb1970331cfdfe27ba345af6da368 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4aecbfb06ccdb1970331cfdfe27ba345af6da368/multi_polynomial_element.py | |
if polynomial not in self.coordinate_ring(): | S = self.coordinate_ring() try: polynomial = S(polynomial) except TypeError: | def is_homogeneous(self, polynomial): r""" Check if ``polynomial`` is homogeneous. | 389698548ce8914fc06d6a594d8338e80e0121e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/389698548ce8914fc06d6a594d8338e80e0121e0/toric_variety.py |
polynomial = polynomial.lift() | polynomial = S(polynomial.lift()) | def is_homogeneous(self, polynomial): r""" Check if ``polynomial`` is homogeneous. | 389698548ce8914fc06d6a594d8338e80e0121e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/389698548ce8914fc06d6a594d8338e80e0121e0/toric_variety.py |
if order is Infinity: | if order == 1: if isinstance(w, (tuple,str,list)): length = 'finite' elif isinstance(w, FiniteWord_class): length = sum(self._morph[a].length() * b for (a,b) in w.evaluation_dict().iteritems()) elif hasattr(w, '__iter__'): length = Infinity datatype = 'iter' elif w in self._domain.alphabet(): return self._morph[w] els... | def __call__(self, w, order=1, datatype='iter'): r""" Returns the image of ``w`` under self to the given order. INPUT: | 179f0c90d24e3a38a542c9e7fda0195c3d7abb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/179f0c90d24e3a38a542c9e7fda0195c3d7abb42/morphism.py |
if not isinstance(order, (int,Integer)) or order < 0 : raise TypeError, "order (%s) must be a positive integer or plus Infinity" % order | elif isinstance(order, (int,Integer)) and order > 1: return self(self(w, order-1),datatype=datatype) | def __call__(self, w, order=1, datatype='iter'): r""" Returns the image of ``w`` under self to the given order. INPUT: | 179f0c90d24e3a38a542c9e7fda0195c3d7abb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/179f0c90d24e3a38a542c9e7fda0195c3d7abb42/morphism.py |
elif order == 1: if isinstance(w, (tuple,str,list)): length = 'finite' elif isinstance(w, FiniteWord_class): length = sum(self._morph[a].length() * b for (a,b) in w.evaluation_dict().iteritems()) elif hasattr(w, '__iter__'): length = Infinity datatype = 'iter' elif w in self._domain.alphabet(): w = [w] length = 'finit... | else: raise TypeError, "order (%s) must be a positive integer or plus Infinity" % order | def __call__(self, w, order=1, datatype='iter'): r""" Returns the image of ``w`` under self to the given order. INPUT: | 179f0c90d24e3a38a542c9e7fda0195c3d7abb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/179f0c90d24e3a38a542c9e7fda0195c3d7abb42/morphism.py |
if not isinstance(self.codomain(),Words_all): | if not isinstance(self.codomain(), Words_all): | def is_prolongable(self, letter): r""" Returns ``True`` if ``self`` is prolongable on ``letter``. A morphism `\varphi` is prolongable on a letter `a` if `a` is a prefix of `\varphi(a)`. INPUT: | 179f0c90d24e3a38a542c9e7fda0195c3d7abb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/179f0c90d24e3a38a542c9e7fda0195c3d7abb42/morphism.py |
def is_prolongable(self, letter): r""" Returns ``True`` if ``self`` is prolongable on ``letter``. A morphism `\varphi` is prolongable on a letter `a` if `a` is a prefix of `\varphi(a)`. INPUT: | 179f0c90d24e3a38a542c9e7fda0195c3d7abb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/179f0c90d24e3a38a542c9e7fda0195c3d7abb42/morphism.py | ||
image = self(letter) | image = self.image(letter) | def is_prolongable(self, letter): r""" Returns ``True`` if ``self`` is prolongable on ``letter``. A morphism `\varphi` is prolongable on a letter `a` if `a` is a prefix of `\varphi(a)`. INPUT: | 179f0c90d24e3a38a542c9e7fda0195c3d7abb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/179f0c90d24e3a38a542c9e7fda0195c3d7abb42/morphism.py |
def letter_iterator(self, letter): | def _fixed_point_iterator(self, letter): | def letter_iterator(self, letter): r""" Returns an iterator of the letters of the fixed point of ``self`` starting with ``letter``. | 179f0c90d24e3a38a542c9e7fda0195c3d7abb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/179f0c90d24e3a38a542c9e7fda0195c3d7abb42/morphism.py |
sage: list(m.letter_iterator('b')) Traceback (most recent call last): ... TypeError: self must be prolongable on b sage: list(m.letter_iterator('a')) | sage: list(m._fixed_point_iterator('a')) | def letter_iterator(self, letter): r""" Returns an iterator of the letters of the fixed point of ``self`` starting with ``letter``. | 179f0c90d24e3a38a542c9e7fda0195c3d7abb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/179f0c90d24e3a38a542c9e7fda0195c3d7abb42/morphism.py |
sage: m = WordMorphism('a->aa,b->aac') sage: list(m.letter_iterator('a')) Traceback (most recent call last): ... TypeError: self (=WordMorphism: a->aa, b->aac) is not a endomorphism """ if not self.is_endomorphism(): raise TypeError, "self (=%s) is not a endomorphism"%self if not self.is_prolongable(letter=letter): ra... | The morphism must be prolongable on the letter:: sage: list(m._fixed_point_iterator('b')) Traceback (most recent call last): ... IndexError: pop from empty list The morphism must be an endomorphism:: sage: m = WordMorphism('a->ac,b->aac') sage: list(m._fixed_point_iterator('a')) Traceback (most recent call last): .... | def letter_iterator(self, letter): r""" Returns an iterator of the letters of the fixed point of ``self`` starting with ``letter``. | 179f0c90d24e3a38a542c9e7fda0195c3d7abb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/179f0c90d24e3a38a542c9e7fda0195c3d7abb42/morphism.py |
for a in self(w.pop(0)): | for a in self.image(w.pop(0)): | def letter_iterator(self, letter): r""" Returns an iterator of the letters of the fixed point of ``self`` starting with ``letter``. | 179f0c90d24e3a38a542c9e7fda0195c3d7abb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/179f0c90d24e3a38a542c9e7fda0195c3d7abb42/morphism.py |
w.extend(self(w[0])) | w.extend(self.image(w[0])) | def letter_iterator(self, letter): r""" Returns an iterator of the letters of the fixed point of ``self`` starting with ``letter``. | 179f0c90d24e3a38a542c9e7fda0195c3d7abb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/179f0c90d24e3a38a542c9e7fda0195c3d7abb42/morphism.py |
image = self(letter) | image = self.image(letter) | def fixed_point(self, letter): r""" Returns the fixed point of ``self`` beginning by the given ``letter``. | 179f0c90d24e3a38a542c9e7fda0195c3d7abb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/179f0c90d24e3a38a542c9e7fda0195c3d7abb42/morphism.py |
w = self.codomain()(self.letter_iterator(letter), datatype='iter') | w = self.codomain()(self._fixed_point_iterator(letter), datatype='iter') | def fixed_point(self, letter): r""" Returns the fixed point of ``self`` beginning by the given ``letter``. | 179f0c90d24e3a38a542c9e7fda0195c3d7abb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/179f0c90d24e3a38a542c9e7fda0195c3d7abb42/morphism.py |
.. [CB07] Nicolas T\. Courtois, Gregory V\. Bard *Algebraic Cryptanalysis of the Data Encryption Standard*; Cryptography and Coding -- 11th IMA International Conference; 2007; available at http://eprint.iacr.org/2006/402 | .. [CBJ07] Gregory V\. Bard, and Nicolas T\. Courtois, and Chris Jefferson. *Efficient Methods for Conversion and Solution of Sparse Systems of Low-Degree Multivariate Polynomials over GF(2) via SAT-Solvers*. Cryptology ePrint Archive: Report 2007/024. available at http://eprint.iacr.org/2007/024 | def eliminate_linear_variables(self, maxlength=3, skip=lambda lm,tail: False): """ Return a new system where "linear variables" are eliminated. | 3765e5b534fd10295275331ed86c1a8a5547c69b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3765e5b534fd10295275331ed86c1a8a5547c69b/mpolynomialsystem.py |
Returns the Hasse invariant of an elliptic curve over a field of positive characteristic, which is an element of the field. | Returns the Hasse invariant of this elliptic curve. OUTPUT: The Hasse invariant of this elliptic curve, as an element of the base field. This is only defined over fields of positive characteristic, and is an element of the field which is zero if and only if the curve is supersingular. Over a field of characteristic... | def hasse_invariant(self): r""" Returns the Hasse invariant of an elliptic curve over a field of positive characteristic, which is an element of the field. | 5157b64a9f7e5d7de0fe87ba2c67b64a7014ab7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5157b64a9f7e5d7de0fe87ba2c67b64a7014ab7d/ell_field.py |
return self.a2()+self.a1()**2 | return self.b2() elif p == 5: return self.c4() elif p == 7: return -self.c6() | def hasse_invariant(self): r""" Returns the Hasse invariant of an elliptic curve over a field of positive characteristic, which is an element of the field. | 5157b64a9f7e5d7de0fe87ba2c67b64a7014ab7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5157b64a9f7e5d7de0fe87ba2c67b64a7014ab7d/ell_field.py |
codmain. | codomain. | def iter_morphisms(self, arg=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain. | 3dd4e685d47d0b93683cb7f6b8f19d67bf28c8e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3dd4e685d47d0b93683cb7f6b8f19d67bf28c8e2/words.py |
iterator | iterator | def iter_morphisms(self, arg=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain. | 3dd4e685d47d0b93683cb7f6b8f19d67bf28c8e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3dd4e685d47d0b93683cb7f6b8f19d67bf28c8e2/words.py |
sage: phi,theta=var('phi theta') sage: Y=spherical_harmonic(2,1,theta,phi) sage: rea=spherical_plot3d(abs(real(Y)),(phi,0,2*pi),(theta,0,pi),color='blue',opacity=0.6) sage: ima=spherical_plot3d(abs(imag(Y)),(phi,0,2*pi),(theta,0,pi),color='red' ,opacity=0.6) sage: (rea+ima).show(aspect_ratio=1) | sage: phi, theta = var('phi, theta') sage: Y = spherical_harmonic(2, 1, theta, phi) sage: rea = spherical_plot3d(abs(real(Y)), (phi,0,2*pi), (theta,0,pi), color='blue', opacity=0.6) sage: ima = spherical_plot3d(abs(imag(Y)), (phi,0,2*pi), (theta,0,pi), color='red', opacity=0.6) sage: (rea + ima).show(aspect_ratio=1) | def spherical_plot3d(f, urange, vrange, **kwds): """ 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]) sage: plot3d(f, urange, vrange, transformation=T) or eq... | 742d05ea84125e9e5943320581a4d8c29f5dad43 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/742d05ea84125e9e5943320581a4d8c29f5dad43/plot3d.py |
""" Theta_Precision = bound | sage: Q = QuadraticForm(ZZ, 4, [1,1,1,1, 1,0,0, 1,0, 1]) sage: map(len, Q.vectors_by_length(2)) [1, 12, 12] """ eps = RDF(1e-6) bound = ZZ(floor(bound)) Theta_Precision = bound + eps | def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all v... | cd72f985222473f0b2a5f9d711066eda3c558c8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cd72f985222473f0b2a5f9d711066eda3c558c8e/quadratic_form__split_local_covering.py |
empty_vec_list = [[] for i in range(Theta_Precision + 1)] theta_vec = [[] for i in range(Theta_Precision + 1)] | theta_vec = [[] for i in range(bound + 1)] | def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all v... | cd72f985222473f0b2a5f9d711066eda3c558c8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cd72f985222473f0b2a5f9d711066eda3c558c8e/quadratic_form__split_local_covering.py |
Z = sqrt(T[i] / Q[i][i]) L[i] = ZZ(floor(Z - U[i])) x[i] = ZZ(ceil(-Z - U[i]) - 0) | Z = (T[i] / Q[i][i]).sqrt(extend=False) L[i] = ( Z - U[i]).floor() x[i] = (-Z - U[i]).ceil() | def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all v... | cd72f985222473f0b2a5f9d711066eda3c558c8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cd72f985222473f0b2a5f9d711066eda3c558c8e/quadratic_form__split_local_covering.py |
Z = sqrt(T[i] / Q[i][i]) L[i] = ZZ(floor(Z - U[i])) x[i] = ZZ(ceil(-Z - U[i]) - 0) | Z = (T[i] / Q[i][i]).sqrt(extend=False) L[i] = ( Z - U[i]).floor() x[i] = (-Z - U[i]).ceil() | def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all v... | cd72f985222473f0b2a5f9d711066eda3c558c8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cd72f985222473f0b2a5f9d711066eda3c558c8e/quadratic_form__split_local_covering.py |
Q_val = ZZ(floor(round(Q_val_double))) | Q_val = Q_val_double.round() | def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all v... | cd72f985222473f0b2a5f9d711066eda3c558c8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cd72f985222473f0b2a5f9d711066eda3c558c8e/quadratic_form__split_local_covering.py |
if (Q_val <= Theta_Precision): | if (Q_val <= bound): | def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all v... | cd72f985222473f0b2a5f9d711066eda3c558c8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cd72f985222473f0b2a5f9d711066eda3c558c8e/quadratic_form__split_local_covering.py |
- ``category`` - a category; reserved for future use - ``skip`` - a string or list (or iterable) of strings | - ``category`` - a category; reserved for future use - ``skip`` - a string or list (or iterable) of strings | def run(self, category = None, skip = [], catch = True, raise_on_failure = False, **options): """ Run all the tests from this test suite: | f352e55c88f898cee027b605b2b53b241f2ce8a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f352e55c88f898cee027b605b2b53b241f2ce8a6/sage_unittest.py |
- ``catch` - a boolean (default: True) | - ``catch`` - a boolean (default: True) | def run(self, category = None, skip = [], catch = True, raise_on_failure = False, **options): """ Run all the tests from this test suite: | f352e55c88f898cee027b605b2b53b241f2ce8a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f352e55c88f898cee027b605b2b53b241f2ce8a6/sage_unittest.py |
sage: ZZ._tester() Testing utilities for Integer Ring | sage: QQ._tester() Testing utilities for Rational Field | def instance_tester(instance, tester = None, **options): """ Returns a gadget attached to ``instance`` providing testing utilities. EXAMPLES:: sage: from sage.misc.sage_unittest import instance_tester sage: tester = instance_tester(ZZ) sage: tester.assert_(1 == 1) sage: tester.assert_(1 == 0) Traceback (most recent ... | f352e55c88f898cee027b605b2b53b241f2ce8a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f352e55c88f898cee027b605b2b53b241f2ce8a6/sage_unittest.py |
sage: ZZ._tester() Testing utilities for Integer Ring | sage: QQ._tester() Testing utilities for Rational Field | def __init__(self, instance, elements = None, verbose = False, prefix = "", **options): """ A gadget attached to an instance providing it with testing utilities. | f352e55c88f898cee027b605b2b53b241f2ce8a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f352e55c88f898cee027b605b2b53b241f2ce8a6/sage_unittest.py |
The log function also works in finite fields as long as the base is generator of the multiplicative group:: | The log function also works in finite fields as long as the argument lies in the multiplicative group generated by the base:: | def log(x, base=None): """ Return the logarithm of x to the given base. Calls the ``log`` method of the object x when computing the logarithm, thus allowing use of logarithm on any object containing a ``log`` method. In other words, log works on more than just real numbers. EXAMPLES:: sage: log(e^2) 2 sage: log(1024... | dbbc839cdcadde0b2dc29f25f682d92bbdbf8281 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/dbbc839cdcadde0b2dc29f25f682d92bbdbf8281/log.py |
ValueError: base (=3) for discrete log must generate multiplicative group | ValueError: No discrete log of 8 found to base 3 sage: log(F(9), 3) 2 | def log(x, base=None): """ Return the logarithm of x to the given base. Calls the ``log`` method of the object x when computing the logarithm, thus allowing use of logarithm on any object containing a ``log`` method. In other words, log works on more than just real numbers. EXAMPLES:: sage: log(e^2) 2 sage: log(1024... | dbbc839cdcadde0b2dc29f25f682d92bbdbf8281 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/dbbc839cdcadde0b2dc29f25f682d92bbdbf8281/log.py |
return 0 | return ZZ(0) | def _eval_(self, x): """ EXAMPLES:: | c00c3043aa2809aab554d4d4c65303203c1a277b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/c00c3043aa2809aab554d4d4c65303203c1a277b/generalized.py |
return 1 | return ZZ(1) | def _eval_(self, x): """ EXAMPLES:: | c00c3043aa2809aab554d4d4c65303203c1a277b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/c00c3043aa2809aab554d4d4c65303203c1a277b/generalized.py |
return -1 | return ZZ(-1) | def _eval_(self, x): """ EXAMPLES:: | c00c3043aa2809aab554d4d4c65303203c1a277b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/c00c3043aa2809aab554d4d4c65303203c1a277b/generalized.py |
Returns the rim of ``self`` | Returns the rim of ``self``. | def rim(self): r""" Returns the rim of ``self`` | 51f56d3cf09714ec116e12377fb73f8de4d6ae00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/51f56d3cf09714ec116e12377fb73f8de4d6ae00/partition.py |
For example if `p=(5,5,2,1)`, the rim is composed from the dashed cells below:: | The rim of the partition `[5,5,2,1]` consists of the cells marked with `` | def rim(self): r""" Returns the rim of ``self`` | 51f56d3cf09714ec116e12377fb73f8de4d6ae00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/51f56d3cf09714ec116e12377fb73f8de4d6ae00/partition.py |
Returns the outer rim of ``self`` | Returns the outer rim of ``self``. | def outer_rim(self): """ Returns the outer rim of ``self`` | 51f56d3cf09714ec116e12377fb73f8de4d6ae00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/51f56d3cf09714ec116e12377fb73f8de4d6ae00/partition.py |
For example, the dashed cell below is the outer_rim of the partitions `(4,1)`:: | The outer rim of the partition `[4,1]` consists of the cells marked with `` | def outer_rim(self): """ Returns the outer rim of ``self`` | 51f56d3cf09714ec116e12377fb73f8de4d6ae00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/51f56d3cf09714ec116e12377fb73f8de4d6ae00/partition.py |
This is called "massaging" in [CB07]_. | This is called "massaging" in [CBJ07]_. | def eliminate_linear_variables(self, maxlength=3, skip=lambda lm,tail: False): """ Return a new system where "linear variables" are eliminated. | 1161f799ebbca2c38f97e2e6d00371553fa92556 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1161f799ebbca2c38f97e2e6d00371553fa92556/mpolynomialsystem.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``. An ideal `Q` is called primary if it is a proper ideal of the ring `R` and if whenever `ab \in Q` and `a \not\in Q` then `b^n \in Q` for some `n \in \ZZ`. If ... | 8dca0477d80ad31ebb14fc473522752432f54809 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8dca0477d80ad31ebb14fc473522752432f54809/multi_polynomial_ideal.py |
def associated_primes(self, algorithm='sy'): r""" Return a list of primary ideals (and their associated primes) such that their intersection is `I` = ``self``. An ideal `Q` is called primary if it is a proper ideal of the ring `R` and if whenever `ab \in Q` and `a \not\in Q` then `b^n \in Q` for some `n \in \ZZ`. If ... | 8dca0477d80ad31ebb14fc473522752432f54809 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8dca0477d80ad31ebb14fc473522752432f54809/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``. An ideal `Q` is called primary if it is a proper ideal of the ring `R` and if whenever `ab \in Q` and `a \not\in Q` then `b^n \in Q` for some `n \in \ZZ`. If ... | 8dca0477d80ad31ebb14fc473522752432f54809 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8dca0477d80ad31ebb14fc473522752432f54809/multi_polynomial_ideal.py |
f_l_dict = {(None,None):[(tuple([x]),tuple(self._vertex_face_indexset([x]))) | f_l_dict = {(None,tuple(range(self.n_Hrepresentation()))):[(tuple([x]),tuple(self._vertex_face_indexset([x]))) | 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. | 622daa79aeaf0089718b03ba696d3335735098f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/622daa79aeaf0089718b03ba696d3335735098f3/polyhedra.py |
tuple(range(self.n_Hrepresentation())))) | 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. | 622daa79aeaf0089718b03ba696d3335735098f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/622daa79aeaf0089718b03ba696d3335735098f3/polyhedra.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. | 88546e9cc29663fc88d6d6854e69efff5af6ec95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/88546e9cc29663fc88d6d6854e69efff5af6ec95/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. | 88546e9cc29663fc88d6d6854e69efff5af6ec95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/88546e9cc29663fc88d6d6854e69efff5af6ec95/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. | 88546e9cc29663fc88d6d6854e69efff5af6ec95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/88546e9cc29663fc88d6d6854e69efff5af6ec95/graph_generators.py |
except: | except MIPSolverException: | def edge_coloring(g, value_only=False, vizing=False, hex_colors=False, log=0): r""" Properly colors the edges of a graph. See the URL http://en.wikipedia.org/wiki/Edge_coloring for further details on edge coloring. INPUT: - ``g`` -- a graph. - ``value_only`` -- (default: ``False``): - When set to ``True``, only the... | d7fc2c3e81e90f2878d6fd0d6533272249dc35dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/d7fc2c3e81e90f2878d6fd0d6533272249dc35dd/graph_coloring.py |
.. warning:: This function calls a Singular function that appears to be very buggy and should not be trusted. | def riemann_roch_basis(self, D): r""" Return a basis for the Riemann-Roch space corresponding to `D`. .. warning:: | cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e/projective_curve.py | |
- ``sort`` - bool (default: True), if True return the point list sorted. If False, returns the points in the order computed by Singular. | - ``D`` - a divisor OUTPUT: A list of function field elements that form a basis of the Riemann-Roch space | def riemann_roch_basis(self, D): r""" Return a basis for the Riemann-Roch space corresponding to `D`. .. warning:: | cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e/projective_curve.py |
sage: D = C.divisor([ (4, pts[0]), (0,pts[1]), (4, pts[2]) ]) | sage: D = C.divisor([ (4, pts[0]), (4, pts[2]) ]) | def riemann_roch_basis(self, D): r""" Return a basis for the Riemann-Roch space corresponding to `D`. .. warning:: | cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e/projective_curve.py |
The following example illustrates that the Riemann-Roch space function in Singular doesn't *not* work correctly. | def riemann_roch_basis(self, D): r""" Return a basis for the Riemann-Roch space corresponding to `D`. .. warning:: | cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e/projective_curve.py | |
sage: C.riemann_roch_basis(D) [x/(y + x), (z + y)/(y + x)] The answer has dimension 2 (confirmed via Magma). But it varies between 1 and quite large with Singular. | sage: C.riemann_roch_basis(D) [(-2*x + y)/(x + y), (-x + z)/(x + y)] .. NOTE:: Currently this only works over prime field and divisors supported on rational points. | def riemann_roch_basis(self, D): r""" Return a basis for the Riemann-Roch space corresponding to `D`. .. warning:: | cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e/projective_curve.py |
def riemann_roch_basis(self, D): r""" Return a basis for the Riemann-Roch space corresponding to `D`. .. warning:: | cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e/projective_curve.py | ||
X3 = singular.extcurve(1, X2) R = X3[1][5] | v = X2[3].sage_flattened_str_list() v = [ v[i].partition(',') for i in range(len(v)) ] pnts = [ ( int(v[i][0]), int(v[i][2])-1 ) for i in range(len(v))] R = X2[5][1][1] | def riemann_roch_basis(self, D): r""" Return a basis for the Riemann-Roch space corresponding to `D`. .. warning:: | cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e/projective_curve.py |
def riemann_roch_basis(self, D): r""" Return a basis for the Riemann-Roch space corresponding to `D`. .. warning:: | cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e/projective_curve.py | ||
pnts = [self(int(v[3*i]), int(v[3*i+1]), int(v[3*i+2])) for i in range(len(v)/3)] | coords = [self(int(v[3*i]), int(v[3*i+1]), int(v[3*i+2])) for i in range(len(v)/3)] | def riemann_roch_basis(self, D): r""" Return a basis for the Riemann-Roch space corresponding to `D`. .. warning:: | cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e/projective_curve.py |
Dcoeffs.append(D.coefficient(x)) | if x[0] == 1: Dcoeffs.append(D.coefficient(coords[x[1]])) else: Dcoeffs.append(0) | def riemann_roch_basis(self, D): r""" Return a basis for the Riemann-Roch space corresponding to `D`. .. warning:: | cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cfd0c5535db92e52e7b8ddd12fd21dd75dd1821e/projective_curve.py |
if len(xi) != n: | if len(yi) != n: | def cnf(self, xi=None, yi=None, format=None): """ Return a representation of this S-Box in conjunctive normal form. | 028b1dfc54561cf58a6177aabf3c612f642bd4af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/028b1dfc54561cf58a6177aabf3c612f642bd4af/sbox.py |
x = self.to_bits(e) | x = self.to_bits(e, m) | def cnf(self, xi=None, yi=None, format=None): """ Return a representation of this S-Box in conjunctive normal form. | 028b1dfc54561cf58a6177aabf3c612f642bd4af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/028b1dfc54561cf58a6177aabf3c612f642bd4af/sbox.py |
'ton_force':'Defined to be the magnitude of the force exerted on one ton of mass (2000 pounds) by a 9.80665 meter/second^2 gravitational field.\nApproximately equal to 8896.4432 newtons.'}, | 'ton_force':'Defined to be 2000 pounds of force.\nApproximately equal to 8896.4432 newtons.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalun... | afa182b98d85f0d6cf77cba8b29bc55e8d9d841a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/afa182b98d85f0d6cf77cba8b29bc55e8d9d841a/units.py |
{'candela':'SI base unit of luminous intensity.\nDefined to be the luminous intensity, in a given direction, of a source that emits monochromatic radiation of frequency 540*10^12 hertz and that has a radiant intensity in that direction of 1\xe2\x81\x84683 watt per steradian.', | {'candela':'SI base unit of luminous intensity.\nDefined to be the luminous intensity, in a given direction, of a source that emits monochromatic radiation of frequency 540*10^12 hertz and that has a radiant intensity in that direction of 1/683 watt per steradian.', | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalun... | afa182b98d85f0d6cf77cba8b29bc55e8d9d841a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/afa182b98d85f0d6cf77cba8b29bc55e8d9d841a/units.py |
'solar_mass':'Defined to be the mass of the Sun.\nAbout 332,950 times the size of the Earth or 1,048 times the mass of Jupiter.\nApproximately equal to 1.98892*10^30 kilograms.', | 'solar_mass':'Defined to be the mass of the Sun.\nAbout 332,950 times the mass of the Earth or 1,048 times the mass of Jupiter.\nApproximately equal to 1.98892*10^30 kilograms.', | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalun... | afa182b98d85f0d6cf77cba8b29bc55e8d9d841a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/afa182b98d85f0d6cf77cba8b29bc55e8d9d841a/units.py |
Collection power of units: cheval_vapeur horsepower watt | Collection of units of power: cheval_vapeur horsepower watt | def str_to_unit(name): """ Create the symbolic unit with given name. A symbolic unit is a class that derives from symbolic expression, and has a specialized docstring. INPUT: - ``name`` -- string OUTPUT: - UnitExpression EXAMPLES:: sage: sage.symbolic.units.str_to_unit('acre') acre sage: type(sage.symbolic.unit... | afa182b98d85f0d6cf77cba8b29bc55e8d9d841a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/afa182b98d85f0d6cf77cba8b29bc55e8d9d841a/units.py |
Collection all units of units: acceleration ... volume | Collection of units of all units: acceleration ... volume | def __init__(self, data, name=''): """ EXAMPLES:: | afa182b98d85f0d6cf77cba8b29bc55e8d9d841a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/afa182b98d85f0d6cf77cba8b29bc55e8d9d841a/units.py |
Collection area of units: acre are barn hectare rood section square_chain square_meter township | Collection of units of area: acre are barn hectare rood section square_chain square_meter township | def __getattr__(self, name): """ Return the unit with the given name. | afa182b98d85f0d6cf77cba8b29bc55e8d9d841a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/afa182b98d85f0d6cf77cba8b29bc55e8d9d841a/units.py |
'Collection area of units: acre are barn hectare rood section square_chain square_meter township' """ name = self.__name + ' ' if self.__name else '' return "Collection %sof units: %s"%(name, ' '.join(sorted([str(x) for x in self.__data]))) | 'Collection of units of area: acre are barn hectare rood section square_chain square_meter township' """ name = ' of ' + self.__name if self.__name else '' return "Collection of units{0}: {1}".format(name, ' '.join(sorted([str(x) for x in self.__data]))) | def __repr__(self): """ Return string representation of this collection of units. | afa182b98d85f0d6cf77cba8b29bc55e8d9d841a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/afa182b98d85f0d6cf77cba8b29bc55e8d9d841a/units.py |
pass | def cycle_index(self, parent = None): r""" INPUT: - ``self`` - a permutation group `G` - ``parent`` -- a free module with basis indexed by partitions, or behave as such, with a ``term`` and ``sum`` method (default: the symmetric functions over the rational field in the p basis) Returns the *cycle index* of `G`, w... | def example(self): """ Returns an example of finite permutation group, as per :meth:`Category.example`. | 7f73ed5e7117a08e2d152a1a156e80aa5908ccfa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/7f73ed5e7117a08e2d152a1a156e80aa5908ccfa/finite_permutation_groups.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... | cd9d7c463f8a8ab4997abebb4301aa7f1769d062 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cd9d7c463f8a8ab4997abebb4301aa7f1769d062/chomp.py |
n = x.parent()(1) | n = parent(x)(1) | def squarefree_part(x): """ Returns the square free part of `x`, i.e., a divisor `z` such that `x = z y^2`, for a perfect square `y^2`. EXAMPLES:: sage: squarefree_part(100) 1 sage: squarefree_part(12) 3 sage: squarefree_part(10) 10 :: sage: x = QQ['x'].0 sage: S = squarefree_part(-9*x*(x-6)^7*(x-3)^2); S -9*x^2 + ... | db1626a987d7859a534ed97c5691a7918921e0b0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/db1626a987d7859a534ed97c5691a7918921e0b0/functional.py |
- ``scope`` -- namespace (default: global); | - ``scope`` -- namespace (default: global, not just the scope from which this function was called); | def inject_coefficients(self, scope=None, verbose=True): r""" Inject generators of the base field of ``self`` into ``scope``. | 1a7daee257e1f0e820a014f936d82147a7129b44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1a7daee257e1f0e820a014f936d82147a7129b44/toric_variety.py |
sage: P1xP1 = ToricVariety(fan) sage: P1xP1.inject_coefficients() The last command does nothing, since ``P1xP1`` is defined over `\QQ`. Let's construct a toric variety over a more complicated field:: | def inject_coefficients(self, scope=None, verbose=True): r""" Inject generators of the base field of ``self`` into ``scope``. | 1a7daee257e1f0e820a014f936d82147a7129b44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1a7daee257e1f0e820a014f936d82147a7129b44/toric_variety.py | |
""" if is_FractionField(self.base_ring()): | We check that we can use names ``a`` and ``b``, Trac sage: a + b a + b sage: a + b in P1xP1.coordinate_ring() True """ if scope is None: depth = 0 while True: scope = sys._getframe(depth).f_globals if (scope["__name__"] == "__main__" and scope["__package__"] is None): break depth += 1 try: | def inject_coefficients(self, scope=None, verbose=True): r""" Inject generators of the base field of ``self`` into ``scope``. | 1a7daee257e1f0e820a014f936d82147a7129b44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1a7daee257e1f0e820a014f936d82147a7129b44/toric_variety.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. | 6e4c1260cef96dbf9007cca619fb07674310decc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6e4c1260cef96dbf9007cca619fb07674310decc/polyhedra.py |
def is_integral_domain(self, proof = True): r""" If this function returns ``True`` then self is definitely an integral domain. If it returns ``False``, then either self is definitely not an integral domain or this function was unable to determine whether or not self is an integral domain. Use ``self.defining_ideal().i... | def is_integral_domain(self, proof=True): r""" With ``proof`` equal to ``True`` (the default), this function may raise a ``NotImplementedError``. When ``proof`` is ``False``, if ``True`` is returned, then self is definitely an integral domain. If the function returns ``False``, then either self is not an integral do... | def is_integral_domain(self, proof = True): r""" If this function returns ``True`` then self is definitely an integral domain. If it returns ``False``, then either self is definitely not an integral domain or this function was unable to determine whether or not self is an integral domain. Use ``self.defining_ideal().i... | 33576b49e017cb98d2f1f1fc210c63d196b80b3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/33576b49e017cb98d2f1f1fc210c63d196b80b3b/quotient_ring.py |
sage: R.<a,b,c> = ZZ['a','b','c'] sage: I = R.ideal(a,b) sage: Q = R.quotient_ring(I) | sage: R.quo(x^2 - y^2).is_integral_domain(proof=False) False sage: R.<a,b,c> = ZZ[] sage: Q = R.quotient_ring([a, b]) | def is_integral_domain(self, proof = True): r""" If this function returns ``True`` then self is definitely an integral domain. If it returns ``False``, then either self is definitely not an integral domain or this function was unable to determine whether or not self is an integral domain. Use ``self.defining_ideal().i... | 33576b49e017cb98d2f1f1fc210c63d196b80b3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/33576b49e017cb98d2f1f1fc210c63d196b80b3b/quotient_ring.py |
return self.defining_ideal.is_prime() except AttributeError: return False | return self.defining_ideal().is_prime() | def is_integral_domain(self, proof = True): r""" If this function returns ``True`` then self is definitely an integral domain. If it returns ``False``, then either self is definitely not an integral domain or this function was unable to determine whether or not self is an integral domain. Use ``self.defining_ideal().i... | 33576b49e017cb98d2f1f1fc210c63d196b80b3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/33576b49e017cb98d2f1f1fc210c63d196b80b3b/quotient_ring.py |
def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | 3495ceab0e02c75313a92b9ead9001643cee42f5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3495ceab0e02c75313a92b9ead9001643cee42f5/sbox.py | ||
def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | 3495ceab0e02c75313a92b9ead9001643cee42f5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3495ceab0e02c75313a92b9ead9001643cee42f5/sbox.py | ||
TypeError, "No lookup table provided." | raise TypeError("No lookup table provided.") | def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | 3495ceab0e02c75313a92b9ead9001643cee42f5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3495ceab0e02c75313a92b9ead9001643cee42f5/sbox.py |
if not ZZ(len(S)).is_power_of(2): raise TypeError("Lookup table length is not a power of 2.") | def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | 3495ceab0e02c75313a92b9ead9001643cee42f5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3495ceab0e02c75313a92b9ead9001643cee42f5/sbox.py | |
length = ZZ(len(S)).exact_log(2) if length != int(length): TypeError, "lookup table length is not a power of 2." self.m = int(length) | self.m = ZZ(len(S)).exact_log(2) | def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | 3495ceab0e02c75313a92b9ead9001643cee42f5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3495ceab0e02c75313a92b9ead9001643cee42f5/sbox.py |
sage: sage.symbolic.units.evalunitdict() | sage: sage.symbolic.units.evalunitdict() | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalun... | 36d2f28c044694ad73a4a70a9d869366d0e39ec4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/36d2f28c044694ad73a4a70a9d869366d0e39ec4/units.py |
unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) | unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalun... | 36d2f28c044694ad73a4a70a9d869366d0e39ec4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/36d2f28c044694ad73a4a70a9d869366d0e39ec4/units.py |
def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalun... | 36d2f28c044694ad73a4a70a9d869366d0e39ec4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/36d2f28c044694ad73a4a70a9d869366d0e39ec4/units.py | ||
for a in v: unit_to_type[a] = k | for a in v: unit_to_type[a] = k | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalun... | 36d2f28c044694ad73a4a70a9d869366d0e39ec4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/36d2f28c044694ad73a4a70a9d869366d0e39ec4/units.py |
for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalun... | 36d2f28c044694ad73a4a70a9d869366d0e39ec4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/36d2f28c044694ad73a4a70a9d869366d0e39ec4/units.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.