rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
integer representing the index of the matching parenthesis. If no parenthesis matches nothing is returned | Integer representing the index of the matching parenthesis. If no parenthesis matches, return ``None``. | def associated_parenthesis(self, pos): r""" report the position for the parenthesis that matches the one at position ``pos`` |
Bijection of Biane from Dyck words to non crossing partitions | Bijection of Biane from Dyck words to non-crossing partitions. | def to_noncrossing_partition(self): r""" Bijection of Biane from Dyck words to non crossing partitions Thanks to Mathieu Dutour for describing the bijection. EXAMPLES:: sage: DyckWord([]).to_noncrossing_partition() [] sage: DyckWord([1, 0]).to_noncrossing_partition() [[1]] sage: DyckWord([1, 1, 0, 0]).to_noncrossing_... |
returns a standard tableau of length less than or equal to 2 with the size the same as the length of the list the standard tableau will be rectangular iff ``self`` is a complete Dyck word | Returns a standard tableau of length less than or equal to 2 with the size the same as the length of the list. The standard tableau will be rectangular iff ``self`` is a complete Dyck word. | def to_tableau(self): r""" returns a standard tableau of length less than or equal to 2 with the size the same as the length of the list the standard tableau will be rectangular iff ``self`` is a complete Dyck word |
TODO: better name? to_standard_tableau? and should *actually* return a Tableau object? | TODO: better name? ``to_standard_tableau``? and should *actually* return a Tableau object? | def to_tableau(self): r""" returns a standard tableau of length less than or equal to 2 with the size the same as the length of the list the standard tableau will be rectangular iff ``self`` is a complete Dyck word |
Returns the a-statistic for the Dyck word correspond to the area of the Dyck path. | Returns the a-statistic for the Dyck word corresponding to the area of the Dyck path. | def a_statistic(self): """ Returns the a-statistic for the Dyck word correspond to the area of the Dyck path. One can view a balanced Dyck word as a lattice path from `(0,0)` to `(n,n)` in the first quadrant by letting '1's represent steps in the direction `(1,0)` and '0's represent steps in the direction `(0,1)`. The... |
The bouncing ball will strike the diagonal at places $(0, 0), (j_1, j_1), (j_2, j_2), ... , (j_r-1, j_r-1), (j_r, j_r) = (n, n).$ | The bouncing ball will strike the diagonal at places .. MATH:: (0, 0), (j_1, j_1), (j_2, j_2), \dots , (j_r-1, j_r-1), (j_r, j_r) = (n, n). | def b_statistic(self): r""" Returns the b-statistic for the Dyck word corresponding to the bounce statistic of the Dyck word. One can view a balanced Dyck word as a lattice path from `(0,0)` to `(n,n)` in the first quadrant by letting '1's represent steps in the direction `(0,1)` and '0's represent steps in the direct... |
converts a non-crossing partition to a Dyck word | Converts a non-crossing partition to a Dyck word. | def from_noncrossing_partition(ncp): r""" converts a non-crossing partition to a Dyck word TESTS:: sage: DyckWord(noncrossing_partition=[[1,2]]) # indirect doctest [1, 1, 0, 0] sage: DyckWord(noncrossing_partition=[[1],[2]]) [1, 0, 1, 0] :: sage: dws = DyckWords(5).list() sage: ncps = map( lambda x: x.to_noncrossin... |
Mtrans = Matrix(k, 2, M2)*M1inv | Mtrans = Matrix(k, 2, M2)*Maux*M1inv assert Mtrans[1][0] in N | def is_Gamma0_equivalent(self, other, N, Transformation=False): r""" Checks if cusps ``self`` and ``other`` are `\Gamma_0(N)`- equivalent. |
and only if `p_2` dominates `p_1`. | and only if the conjugate of `p_2` dominates `p_1`. | def gale_ryser_theorem(p1, p2, algorithm="ryser"): r""" Returns the binary matrix given by the Gale-Ryser theorem. The Gale Ryser theorem asserts that if `p_1,p_2` are two partitions of `n` of respective lengths `k_1,k_2`, then there is a binary `k_1\times k_2` matrix `M` such that `p_1` is the vector of row sums and ... |
- ``p1`` -- the first partition of `n` (trailing 0's allowed) - ``p2`` -- the second partition of `n` (trailing 0's allowed) | - ``p1, p2``-- list of integers representing the vectors of row/column sums | def gale_ryser_theorem(p1, p2, algorithm="ryser"): r""" Returns the binary matrix given by the Gale-Ryser theorem. The Gale Ryser theorem asserts that if `p_1,p_2` are two partitions of `n` of respective lengths `k_1,k_2`, then there is a binary `k_1\times k_2` matrix `M` such that `p_1` is the vector of row sums and ... |
This equation can be solved within Maxima but not within Sage. It needs assumptions assume(x>0,y>0) and works in Maxima, but not in Sage:: sage: assume(x>0) sage: assume(y>0) sage: desolve(x*diff(y,x)-x*sqrt(y^2+x^2)-y,y,show_method=True) | def desolve(de, dvar, ics=None, ivar=None, show_method=False, contrib_ode=False): r""" Solves a 1st or 2nd order linear ODE via maxima. Including IVP and BVP. *Use* ``desolve? <tab>`` *if the output in truncated in notebook.* INPUT: - ``de`` - an expression or equation representing the ODE - ``dvar`` - the dependen... | |
""" c = [[x+1] for x in range(n)] c[n-1] = [] return LatticePoset(c) | TESTS: Check that sage: Posets.ChainPoset(0) Finite lattice containing 0 elements sage: C = Posets.ChainPoset(1); C Finite lattice containing 1 elements sage: C.cover_relations() [] sage: C = Posets.ChainPoset(2); C Finite lattice containing 2 elements sage: C.cover_relations() [[0, 1]] """ return LatticePoset((range... | def ChainPoset(self, n): """ Returns a chain (a totally ordered poset) containing ``n`` elements. |
""" c = [[] for x in range(n)] return Poset(c) | TESTS: Check that sage: Posets.AntichainPoset(0) Finite poset containing 0 elements sage: C = Posets.AntichainPoset(1); C Finite poset containing 1 elements sage: C.cover_relations() [] sage: C = Posets.AntichainPoset(2); C Finite poset containing 2 elements sage: C.cover_relations() [] """ return Poset((range(n), []... | def AntichainPoset(self, n): """ Returns an antichain (a poset with no comparable elements) containing ``n`` elements. |
self.__modulus = ntl_ZZ_pEContext(ntl_ZZ_pX(list(base_ring.polynomial()), p)) | self._modulus = ntl_ZZ_pEContext(ntl_ZZ_pX(list(base_ring.polynomial()), p)) | def __init__(self, base_ring, name="x", sparse=False, element_class=None, implementation=None): """ TESTS: sage: from sage.rings.polynomial.polynomial_ring import PolynomialRing_field as PRing sage: R = PRing(QQ, 'x'); R Univariate Polynomial Ring in x over Rational Field sage: type(R.gen()) <class 'sage.rings.polynomi... |
P1 = P[0]; P2 = P[1] | P1 = P[0] P2 = P[1] if is_Integer(P1) and is_Integer(P2): R = PolynomialRing(self.value_ring(), 'x') P1 = R(P1) P2 = R(P2) return JacobianMorphism_divisor_class_field(self, tuple([P1,P2])) if is_Integer(P1) and is_Polynomial(P2): R = PolynomialRing(self.value_ring(), 'x') P1 = R(P1) return JacobianMorphism_divisor_clas... | def __call__(self, P): r""" Returns a rational point P in the abstract Homset J(K), given: 0. A point P in J = Jac(C), returning P; 1. A point P on the curve C such that J = Jac(C), where C is an odd degree model, returning [P - oo]; 2. A pair of points (P, Q) on the curve C such that J = Jac(C), returning [P-Q]; 2. A... |
sgi = set(range(fan.nrays())) | sgi = set(range(fan.ngenerating_cones())) | def star_generator_indices(self): r""" Return indices of generating cones of the "ambient fan" containing ``self``. |
K = NumberField_quadratic(polynomial, name, check, embedding, latex_name=latex_name) | K = NumberField_quadratic(polynomial, name, latex_name, check, embedding) | def NumberField(polynomial, name=None, check=True, names=None, cache=True, embedding=None, latex_name=None): r""" Return *the* number field defined by the given irreducible polynomial and with variable with the given name. If check is True (the default), also verify that the defining polynomial is irreducible and over ... |
K = NumberField_absolute(polynomial, name, None, check, embedding, latex_name=latex_name) | K = NumberField_absolute(polynomial, name, latex_name, check, embedding) | def NumberField(polynomial, name=None, check=True, names=None, cache=True, embedding=None, latex_name=None): r""" Return *the* number field defined by the given irreducible polynomial and with variable with the given name. If check is True (the default), also verify that the defining polynomial is irreducible and over ... |
def __init__(self, polynomial, name=None, check=True, embedding=None, latex_name=None): | def __init__(self, polynomial, name=None, latex_name=None, check=True, embedding=None): | def __init__(self, polynomial, name=None, check=True, embedding=None, latex_name=None): """ Create a quadratic number field. EXAMPLES:: sage: k.<a> = QuadraticField(5, check=False); k Number Field in a with defining polynomial x^2 - 5 Don't do this:: sage: k.<a> = QuadraticField(4, check=False); k Number Field in a... |
Initializes base class Ellipse. | Initializes base class ``Ellipse``. | def __init__(self, x, y, r1, r2, angle, options): """ Initializes base class Ellipse. |
The bounding box is computed as minimal as possible. | The bounding box is computed to be as minimal as possible. | def get_minmax_data(self): """ Returns a dictionary with the bounding box data. |
An example without angle:: | An example without an angle:: | def get_minmax_data(self): """ Returns a dictionary with the bounding box data. |
The same example with a rotation of angle pi/2:: | The same example with a rotation of angle `\pi/2`:: | def get_minmax_data(self): """ Returns a dictionary with the bounding box data. |
Return the allowed options for the Ellipse class. | Return the allowed options for the ``Ellipse`` class. | def _allowed_options(self): """ Return the allowed options for the Ellipse class. |
String representation of Ellipse primitive. | String representation of ``Ellipse`` primitive. | def _repr_(self): """ String representation of Ellipse primitive. |
Plot 3d is not implemented. | Plotting in 3D is not implemented. | def plot3d(self): r""" Plot 3d is not implemented. |
""" return Vobj.evaluated_on(self) | If you pass a vector, it is assumed to be the coordinate vector of a point:: sage: ineq.eval( vector(ZZ, [3,2]) ) -4 """ try: return Vobj.evaluated_on(self) except AttributeError: return self.A() * Vobj + self.b() | def eval(self, Vobj): r""" Evaluates the left hand side `A\vec{x}+b` on the given vertex/ray/line. NOTES: * Evaluating on a vertex returns `A\vec{x}+b` * Evaluating on a ray returns `A\vec{r}`. Only the sign or whether it is zero is meaningful. * Evaluating on a line returns `A\vec{l}`. Only whether it is zero or not... |
is_inequality.__doc__ = Hrepresentation.is_inequality.__doc__ | def is_inequality(self): """ Returns True since this is, by construction, an inequality. | |
""" | If you pass a vector, it is assumed to be the coordinate vector of a point:: sage: P = Polyhedron(vertices=[[1,1],[1,-1],[-1,1],[-1,-1]]) sage: p = vector(ZZ, [1,0] ) sage: [ ieq.interior_contains(p) for ieq in P.inequality_generator() ] [True, True, True, False] """ try: if Vobj.is_vector(): return self.polyhedron().... | def interior_contains(self, Vobj): """ Tests whether the interior of the halfspace (excluding its boundary) defined by the inequality contains the given vertex/ray/line. |
is_equation.__doc__ = Hrepresentation.is_equation.__doc__ | def is_equation(self): """ Tests if this object is an equation. By construction, it must be. | |
is_vertex.__doc__ = Vrepresentation.is_vertex.__doc__ | def is_vertex(self): """ Tests if this object is a vertex. By construction it always is. | |
is_ray.__doc__ = Vrepresentation.is_ray.__doc__ | def is_ray(self): """ Tests if this object is a ray. Always True by construction. | |
is_line.__doc__ = Vrepresentation.is_line.__doc__ | def is_line(self): """ Tests if the object is a line. By construction it must be. | |
Returns the identity projection. | Returns the identity projection of the polyhedron. | def identity(self): """ Returns the identity projection. |
identity.__doc__ = projection_func_identity.__doc__ | def identity(self): """ Returns the identity projection. | |
(x(t),y(t)) such that y(t)^2 = f(x(t)) and t | (x(t),y(t)) such that y(t)^2 = f(x(t)), where t | def local_coord(self, P, prec = 20, name = 't'): """ If P is not infinity, calls the appropriate local_coordinates function. |
sage: browse_sage_doc(identity_matrix, 'rst')[-60:-5] 'MatrixSpace of 3 by 3 sparse matrices over Integer Ring' | sage: browse_sage_doc(identity_matrix, 'rst')[-107:-47] 'Full MatrixSpace of 3 by 3 sparse matrices over Integer Ring' | 'def identity_matrix' |
Computes the matching polynomial of the graph G. The algorithm used is a recursive one, based on the following observation: - If e is an edge of G, G' is the result of deleting the edge e, and G'' is the result of deleting each vertex in e, then the matching polynomial of G is equal to that of G' minus that of G''. | Computes the matching polynomial of the graph `G`. If `p(G, k)` denotes the number of `k`-matchings (matchings with `k` edges) in `G`, then the matching polynomial is defined as [Godsil93]_: .. MATH:: \mu(x)=\sum_{k \geq 0} (-1)^k p(G,k) x^{n-2k} | def matching_polynomial(self, complement=True, name=None): """ Computes the matching polynomial of the graph G. The algorithm used is a recursive one, based on the following observation: - If e is an edge of G, G' is the result of deleting the edge e, and G'' is the result of deleting each vertex in e, then the match... |
- ``complement`` - (default: True) whether to use a simple formula to compute the matching polynomial from that of the graphs complement | - ``complement`` - (default: ``True``) whether to use Godsil's duality theorem to compute the matching polynomial from that of the graphs complement (see ALGORITHM). | def matching_polynomial(self, complement=True, name=None): """ Computes the matching polynomial of the graph G. The algorithm used is a recursive one, based on the following observation: - If e is an edge of G, G' is the result of deleting the edge e, and G'' is the result of deleting each vertex in e, then the match... |
NOTE: The ``complement`` option uses matching polynomials of complete graphs, which are cached. So if you are crazy enough to try computing the matching polynomial on a graph with millions of vertices, you might not want to use this option, since it will end up caching millions of polynomials of degree in the millions... | def matching_polynomial(self, complement=True, name=None): """ Computes the matching polynomial of the graph G. The algorithm used is a recursive one, based on the following observation: - If e is an edge of G, G' is the result of deleting the edge e, and G'' is the result of deleting each vertex in e, then the match... | |
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:: |
For infinite periodic words (resp. for finite words of type `u^i u[0:j]`), the reduced Rauzy graph of order `n` (resp. for `n` smaller or equal to `(i-1)|u|+j`) is the directed graph whose unique vertex is the prefix `p` of length `n` of self and which has an only edge which is a loop on `p` labelled by `w[n+1:|w|] p` ... | For infinite periodic words (resp. for finite words of type `u^i u[0:j]`), the reduced Rauzy graph of order `n` (resp. for `n` smaller or equal to `(i-1)|u|+j`) is the directed graph whose unique vertex is the prefix `p` of length `n` of self and which has an only edge which is a loop on `p` labelled by `w[n+1:|w|] p` ... | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. |
:: For the Fibonacci word: :: | For the Fibonacci word:: | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. |
:: For periodic words: :: | For periodic words:: | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. |
:: For ultimataly periodic words: :: | For ultimately periodic words:: | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. |
return words," Advances in Applied Mathematics 42, no. 1 60-74 | return words," Advances in Applied Mathematics 42 (2009) 60-74. | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. |
155,(3-4) : 251-263, 2008. | 155 (2008) 251-263. | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. |
g.add_edge(i,o,g.edge_label(i,v)[0]+g.edge_label(v,o)[0]) | g.add_edge(i,o,g.edge_label(i,v)[0]*g.edge_label(v,o)[0]) | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. |
def order(self, *gens, **kwds): | def order(self, *args, **kwds): | def order(self, *gens, **kwds): r""" Return the order with given ring generators in the maximal order of this number field. INPUT: - ``gens`` - list of elements of self; if no generators are given, just returns the cardinality of this number field (oo) for consistency. - ``check_is_integral`` - bool (default: Tru... |
""" | sage: K.<a> = NumberField(x^3 - 2) sage: ZZ[a] Order in Number Field in a0 with defining polynomial x^3 - 2 TESTS: We verify that trac sage: K.<a> = NumberField(x^4 + 4*x^2 + 2) sage: B = K.integral_basis() sage: K.order(*B) Order in Number Field in a with defining polynomial x^4 + 4*x^2 + 2 sage: K.order(B) Order i... | def order(self, *gens, **kwds): r""" Return the order with given ring generators in the maximal order of this number field. INPUT: - ``gens`` - list of elements of self; if no generators are given, just returns the cardinality of this number field (oo) for consistency. - ``check_is_integral`` - bool (default: Tru... |
Computes lower and upper bounds on the rank of the Mordell-Weil group, and a list of independent points. | Computes lower and upper bounds on the rank of the Mordell-Weil group, and a list of independent points. Used internally by the :meth:`~rank`, :meth:`~rank_bounds` and :meth:`~gens` methods. | def simon_two_descent(self, verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Computes lower and upper bounds on the rank of the Mordell-Weil group, and a list of independent points. INPUT: |
Uses Denis Simon's GP/PARI scripts from \url{http://www.math.unicaen.fr/~simon/}. | Uses Denis Simon's GP/PARI scripts from http://www.math.unicaen.fr/~simon/. | def simon_two_descent(self, verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Computes lower and upper bounds on the rank of the Mordell-Weil group, and a list of independent points. INPUT: |
Returns the lower and upper bounds using simon_two_descent. The results of simon_two_descent are cached. | Returns the lower and upper bounds using :meth:`~simon_two_descent`. The results of :meth:`~simon_two_descent` are cached. | def rank_bounds(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Returns the lower and upper bounds using simon_two_descent. The results of simon_two_descent are cached. |
These optional parameters control the Simon two descent algorithm. | The optional parameters control the Simon two descent algorithm; see the documentation of :meth:`~simon_two_descent` for more details. | def rank_bounds(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Returns the lower and upper bounds using simon_two_descent. The results of simon_two_descent are cached. |
\url{http://www.math.unicaen.fr/~simon/}. | http://www.math.unicaen.fr/~simon/. | def rank_bounds(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Returns the lower and upper bounds using simon_two_descent. The results of simon_two_descent are cached. |
return this. Otherwise, we return the upper and lower bounds with a warning that these are not the same. | return this. Otherwise, we raise a ValueError with an error message specifying the upper and lower bounds. | def rank(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Return the rank of this elliptic curve, if it can be determined. |
Note: For non-quadratic number fields, this code does return, but it takes a long time. | For non-quadratic number fields, this code does return, but it takes a long time. | def rank(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Return the rank of this elliptic curve, if it can be determined. |
Here is a curve with two-torsion, so here the algorithm gives bounds on the rank:: | Here is a curve with two-torsion, so here the bounds given by the algorithm do not uniquely determine the rank:: | def rank(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Return the rank of this elliptic curve, if it can be determined. |
ValueError: There is insufficient data to determine the rank. | ValueError: There is insufficient data to determine the rank - 2-descent gave lower bound 1 and upper bound 2 | def rank(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Return the rank of this elliptic curve, if it can be determined. |
\url{http://www.math.unicaen.fr/~simon/}. | http://www.math.unicaen.fr/~simon/. | def rank(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Return the rank of this elliptic curve, if it can be determined. |
raise ValueError, 'There is insufficient data to determine the rank.' | raise ValueError, 'There is insufficient data to determine the rank - 2-descent gave lower bound %s and upper bound %s' % (lower, upper) | def rank(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Return the rank of this elliptic curve, if it can be determined. |
Returns some generators of this elliptic curve. Check rank or rank_bound to verify the number of generators. | Returns some generators of this elliptic curve. Check :meth:`~rank` or :meth:`~rank_bounds` to verify the number of generators. .. NOTE:: The optional parameters control the Simon two descent algorithm; see the documentation of :meth:`~simon_two_descent` for more details. | def gens(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Returns some generators of this elliptic curve. Check rank or rank_bound to verify the number of generators. |
Note: For non-quadratic number fields, this code does return, but it takes a long time. | For non-quadratic number fields, this code does return, but it takes a long time. | def gens(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Returns some generators of this elliptic curve. Check rank or rank_bound to verify the number of generators. |
Here is a curve with two-torsion, so here the algorithm gives bounds on the rank:: | Here is a curve with two-torsion, so here the algorithm does not uniquely determine the rank:: | def gens(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Returns some generators of this elliptic curve. Check rank or rank_bound to verify the number of generators. |
\url{http://www.math.unicaen.fr/~simon/}. | http://www.math.unicaen.fr/~simon/. | def gens(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Returns some generators of this elliptic curve. Check rank or rank_bound to verify the number of generators. |
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 ... |
"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... |
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... |
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... | |
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 |
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:... |
\log(n)` time (and in linear time if all weights are equal). On the other hand, if one is given a large (possibly | \log(n)` time (and in linear time if all weights are equal) where `n = V + E`. On the other hand, if one is given a large (possibly | def steiner_tree(self,vertices, weighted = False): r""" Returns a tree of minimum weight connecting the given set of vertices. |
sage: P, = E.gens() | sage: P = E([0,-1]) | sage: def naive_height(P): |
AUTHORS: - Robert Bradshaw (2007-10): numerical algorithm - Robert Bradshaw (2008-10): algebraic algorithm | def minpoly(ex, var='x', algorithm=None, bits=None, degree=None, epsilon=0): r""" Return the minimal polynomial of self, if possible. INPUT: - ``var`` - polynomial variable name (default 'x') - ``algorithm`` - 'algebraic' or 'numerical' (default both, but with numerical first) - ``bits`` - the number of bits to ... | |
AUTHORS: - Golam Mortuza Hossain (2009-06-15) | def _limit_latex_(self, f, x, a): r""" Return latex expression for limit of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _limit_latex_ sage: var('x,a') (x, a) sage: f = function('f',x) sage: _limit_latex_(0, f, x, a) '\\lim_{x \\to a}\\, f\\left(x\\right)' sage: latex(limit(f, x=oo)) \lim_... | |
AUTHORS: - Golam Mortuza Hossain (2009-06-22) | def _laplace_latex_(self, *args): r""" Return LaTeX expression for Laplace transform of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _laplace_latex_ sage: var('s,t') (s, t) sage: f = function('f',t) sage: _laplace_latex_(0,f,t,s) '\\mathcal{L}\\left(f\\left(t\\right), t, s\\right)' sage: l... | |
AUTHORS: - Golam Mortuza Hossain (2009-06-22) | def _inverse_laplace_latex_(self, *args): r""" Return LaTeX expression for inverse Laplace transform of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _inverse_laplace_latex_ sage: var('s,t') (s, t) sage: F = function('F',s) sage: _inverse_laplace_latex_(0,F,s,t) '\\mathcal{L}^{-1}\\left(F\\... | |
sage: c = c2 = 1 | sage: c == c2 calling __eq__ defined in Metaclass True | def metaclass(name, bases): """ Creates a new class in this metaclass INPUT:: - name: a string - bases: a tuple of classes EXAMPLES:: sage: from sage.misc.test_class_pickling import metaclass, bar sage: c = metaclass("foo2", (object, bar,)) constructing class sage: c <class 'sage.misc.test_class_pickling.foo2'> sage... |
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: |
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: |
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: |
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: |
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``. |
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``. |
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``. |
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``. |
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``. |
image = self(letter) | image = self.image(letter) | def fixed_point(self, letter): r""" Returns the fixed point of ``self`` beginning by the given ``letter``. |
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``. |
if os.uname()[0][:6] == 'CYGWIN': | if os.uname()[0][:6] == 'CYGWIN' and package is not None: | def install_package(package=None, force=False): """ Install a package or return a list of all packages that have been installed into this Sage install. You must have an internet connection. Also, you will have to restart Sage for the changes to take affect. It is not needed to provide the version number. INPUT: - ... |
return | def install_package(package=None, force=False): """ Install a package or return a list of all packages that have been installed into this Sage install. You must have an internet connection. Also, you will have to restart Sage for the changes to take affect. It is not needed to provide the version number. INPUT: - ... | |
return | return [] | def upgrade(): """ Download and build the latest version of Sage. You must have an internet connection. Also, you will have to restart Sage for the changes to take affect. This upgrades to the latest version of core packages (optional packages are not automatically upgraded). This will not work on systems that don't... |
return HeckeModuleElement.__mul__(self, other) | return element.HeckeModuleElement.__mul__(self, other) | def __mul__(self, other): r""" Calculate the product self * other. |
self._read_faces(self.poly_x("i")) | self._read_faces(self.poly_x("i", reduce_dimension=True)) | def _compute_faces(self): r""" Compute and cache faces of this polytope. If this polytope is reflexive and the polar polytope was already computed, computes faces of both in order to save time and preserve the one-to-one correspondence between the faces of this polytope of dimension d and the faces of the polar polyto... |
Return the sequence of faces of this polytope. | Return the sequence of proper faces of this polytope. | def faces(self, dim=None, codim=None): r""" Return the sequence of faces of this polytope. If ``dim`` or ``codim`` are specified, returns a sequence of faces of the corresponding dimension or codimension. Otherwise returns the sequence of such sequences for all dimensions. EXAMPLES: All faces of the 3-dimensional oct... |
self._points = self._embed(read_palp_matrix( self.poly_x("p", reduce_dimension=True))) self._points.set_immutable() | if self.dim() == 0: self._points = self._vertices else: self._points = self._embed(read_palp_matrix( self.poly_x("p", reduce_dimension=True))) self._points.set_immutable() | def points(self): r""" Return all lattice points of this polytope as columns of a matrix. EXAMPLES: The lattice points of the 3-dimensional octahedron and its polar cube:: sage: o = lattice_polytope.octahedron(3) sage: o.points() [ 1 0 0 -1 0 0 0] [ 0 1 0 0 -1 0 0] [ 0 0 1 0 0 -1 0] sage: cube = o.pola... |
""" | 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. |
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. |
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. |
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.