Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
fixing some invalid escape sequences in algebras and rings
Browse files Browse the repository at this point in the history
  • Loading branch information
Frédéric Chapoton committed Jun 24, 2018
1 parent 010ba97 commit 5b40968
Show file tree
Hide file tree
Showing 20 changed files with 39 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/sage/algebras/commutative_dga.py
@@ -1,4 +1,4 @@
"""
r"""
Commutative Differential Graded Algebras
An algebra is said to be *graded commutative* if it is endowed with a
Expand Down
Expand Up @@ -32,7 +32,7 @@


class FiniteDimensionalAlgebra(UniqueRepresentation, Algebra):
"""
r"""
Create a finite-dimensional `k`-algebra from a multiplication table.
INPUT:
Expand Down
3 changes: 2 additions & 1 deletion src/sage/algebras/group_algebra.py
Expand Up @@ -43,8 +43,9 @@
from sage.categories.morphism import SetMorphism
from sage.combinat.free_module import CombinatorialFreeModule


def GroupAlgebra(G, R=IntegerRing()):
"""
r"""
Return the group algebra of `G` over `R`.
INPUT:
Expand Down
4 changes: 2 additions & 2 deletions src/sage/algebras/iwahori_hecke_algebra.py
@@ -1,4 +1,4 @@
"""
r"""
Iwahori-Hecke Algebras
AUTHORS:
Expand Down Expand Up @@ -911,7 +911,7 @@ def hash_involution_on_basis(self, w):

class ElementMethods:
def bar(self):
"""
r"""
Return the bar involution of ``self``.
The bar involution `\overline{\phantom{x}}` is an antilinear
Expand Down
3 changes: 2 additions & 1 deletion src/sage/algebras/lie_algebras/examples.py
Expand Up @@ -96,8 +96,9 @@ def cross_product(R, names=['X', 'Y', 'Z']):
L.rename("Lie algebra of RR^3 under cross product over {}".format(R))
return L


def three_dimensional_by_rank(R, n, a=None, names=['X', 'Y', 'Z']):
"""
r"""
Return a 3-dimensional Lie algebra of rank ``n``, where `0 \leq n \leq 3`.
Here, the *rank* of a Lie algebra `L` is defined as the dimension
Expand Down
3 changes: 2 additions & 1 deletion src/sage/algebras/lie_algebras/heisenberg.py
Expand Up @@ -294,9 +294,10 @@ def _coerce_map_from_(self, H):
return None # Otherwise no coercion
return super(HeisenbergAlgebra_fd, self)._coerce_map_from_(H)


class HeisenbergAlgebra(HeisenbergAlgebra_fd, HeisenbergAlgebra_abstract,
LieAlgebraWithGenerators):
"""
r"""
A Heisenberg algebra defined using structure coefficients.
The `n`-th Heisenberg algebra (where `n` is a nonnegative
Expand Down
3 changes: 2 additions & 1 deletion src/sage/algebras/lie_algebras/verma_module.py
Expand Up @@ -1278,8 +1278,9 @@ def basis(self):

Element = VermaModuleMorphism


def _convert_wt_to_root(wt):
"""
r"""
Helper function to express ``wt`` as a linear combination
of simple roots.
Expand Down
3 changes: 2 additions & 1 deletion src/sage/algebras/lie_algebras/virasoro.py
Expand Up @@ -686,8 +686,9 @@ def _acted_upon_(self, scalar, self_on_left=False):

_rmul_ = _lmul_ = _acted_upon_


class VermaModule(CombinatorialFreeModule):
"""
r"""
A Verma module of the Virasoro algebra.
The Virasoro algebra admits a triangular decomposition
Expand Down
4 changes: 2 additions & 2 deletions src/sage/algebras/orlik_solomon.py
Expand Up @@ -193,7 +193,7 @@ def one_basis(self):

@cached_method
def algebra_generators(self):
"""
r"""
Return the algebra generators of ``self``.
These form a family indexed by the ground set `X` of `M`. For
Expand Down Expand Up @@ -221,7 +221,7 @@ def algebra_generators(self):

@cached_method
def product_on_basis(self, a, b):
"""
r"""
Return the product in ``self`` of the basis elements
indexed by ``a`` and ``b``.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/q_system.py
Expand Up @@ -404,7 +404,7 @@ def gens(self):
return tuple(self.algebra_generators())

def dimension(self):
"""
r"""
Return the dimension of ``self``, which is `\infty`.
EXAMPLES::
Expand Down
5 changes: 3 additions & 2 deletions src/sage/algebras/quatalg/quaternion_algebra.py
Expand Up @@ -75,8 +75,9 @@
# Constructor
########################################################


class QuaternionAlgebraFactory(UniqueFactory):
"""
r"""
There are three input formats:
- ``QuaternionAlgebra(a, b)``: quaternion algebra generated by ``i``, ``j``
Expand Down Expand Up @@ -1691,7 +1692,7 @@ def quadratic_form(self):
return self.unit_ideal().quadratic_form()

def ternary_quadratic_form(self, include_basis=False):
"""
r"""
Return the ternary quadratic form associated to this order.
INPUT:
Expand Down
4 changes: 2 additions & 2 deletions src/sage/algebras/rational_cherednik_algebra.py
Expand Up @@ -139,7 +139,7 @@ def __init__(self, ct, c, t, base_ring, prefix):
sorting_key=self._genkey)

def _genkey(self, t):
"""
r"""
Construct a key for comparison for a term indexed by ``t``.
The key we create is the tuple in the following order:
Expand Down Expand Up @@ -447,7 +447,7 @@ def degree_on_basis(self, m):

@cached_method
def trivial_idempotent(self):
"""
r"""
Return the trivial idempotent of ``self``.
Let `e = |W|^{-1} \sum_{w \in W} w` is the trivial idempotent.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/schur_algebra.py
Expand Up @@ -148,7 +148,7 @@ def schur_representative_indices(n, r):


def schur_representative_from_index(i0, i1):
"""
r"""
Simultaneously reorder a pair of tuples to obtain the equivalent
element of the distinguished basis of the Schur algebra.
Expand Down
6 changes: 4 additions & 2 deletions src/sage/algebras/steenrod/steenrod_algebra_misc.py
Expand Up @@ -183,8 +183,9 @@ def get_basis_name(basis, p, generic=None):
######################################################
# profile functions


def is_valid_profile(profile, truncation_type, p=2, generic=None):
"""
r"""
True if ``profile``, together with ``truncation_type``, is a valid
profile at the prime `p`.
Expand Down Expand Up @@ -294,8 +295,9 @@ def is_valid_profile(profile, truncation_type, p=2, generic=None):
return False
return True


def normalize_profile(profile, precision=None, truncation_type='auto', p=2, generic=None):
"""
r"""
Given a profile function and related data, return it in a standard form,
suitable for hashing and caching as data defining a sub-Hopf
algebra of the Steenrod algebra.
Expand Down
8 changes: 4 additions & 4 deletions src/sage/algebras/yangian.py
Expand Up @@ -617,7 +617,7 @@ def graded_algebra(self):
return GradedYangianLoop(self)

def dimension(self):
"""
r"""
Return the dimension of ``self``, which is `\infty`.
EXAMPLES::
Expand Down Expand Up @@ -732,7 +732,7 @@ def product_on_gens(self, a, b):
for x in range(2, b[0]+1))

def coproduct_on_basis(self, m):
"""
r"""
Return the coproduct on the basis element indexed by ``m``.
The coproduct `\Delta\colon Y(\mathfrak{gl}_n) \longrightarrow
Expand Down Expand Up @@ -904,7 +904,7 @@ def level(self):
return self._level

def defining_polynomial(self, i, j, u=None):
"""
r"""
Return the defining polynomial of ``i`` and ``j``.
The defining polynomial is given by:
Expand All @@ -928,7 +928,7 @@ def defining_polynomial(self, i, j, u=None):
return sum(self.gen(k, i, j) * u**(ell-k) for k in range(ell+1))

def quantum_determinant(self, u=None):
"""
r"""
Return the quantum determinant of ``self``.
The quantum determinant is defined by:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/posets/incidence_algebras.py
Expand Up @@ -184,7 +184,7 @@ def product_on_basis(self, A, B):

@cached_method
def one(self):
"""
r"""
Return the element `1` in ``self`` (which is the Kronecker
delta `\delta(x, y)`).
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/posets/moebius_algebra.py
Expand Up @@ -234,7 +234,7 @@ def one(self):
natural = E

class I(BasisAbstract):
"""
r"""
The (orthogonal) idempotent basis of a Möbius algebra.
Let `I_x` and `I_y` be basis elements of `M_L` for some lattice `L`.
Expand Down Expand Up @@ -592,7 +592,7 @@ def _to_natural_basis(self, x):
characteristic_basis = C

class KL(BasisAbstract):
"""
r"""
The Kazhdan-Lusztig basis of a quantum Möbius algebra.
The Kazhdan-Lusztig basis `\{ B_x \mid x \in L \}` of `M_L`
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/polynomial/laurent_polynomial_ring.py
Expand Up @@ -689,7 +689,7 @@ def _latex_(self):
sage: latex(LaurentPolynomialRing(QQ,2,'x'))
\Bold{Q}[x_{0}^{\pm 1}, x_{1}^{\pm 1}]
"""
vars = ', '.join([a + '^{\pm 1}' for a in self.latex_variable_names()])
vars = ', '.join([a + r'^{\pm 1}' for a in self.latex_variable_names()])
return "%s[%s]"%(latex(self.base_ring()), vars)

def _ideal_class_(self, n=0):
Expand Down
3 changes: 1 addition & 2 deletions src/sage/rings/polynomial/multi_polynomial_element.py
Expand Up @@ -1412,7 +1412,7 @@ def lc(self):
return self.__lc

def lt(self):
"""
r"""
Returns the leading term of self i.e., self.lc()\*self.lm(). The
notion of "leading term" depends on the ordering defined in the
parent ring.
Expand All @@ -1435,7 +1435,6 @@ def lt(self):
sage: f=x+y
sage: f.lt()
x
"""
try:
return self.__lt
Expand Down
6 changes: 3 additions & 3 deletions src/sage/rings/polynomial/term_order.py
Expand Up @@ -716,14 +716,14 @@ def __init__(self, name='lex', n=0, force=False):
self._macaulay2_str = macaulay2_name_mapping.get(name,name)
self._magma_str = magma_name_mapping.get(name,name)
else:
split_pattern = "([^(),]+(?:\([^()]*\)[^(),]*)*)" # split by outermost commas
split_pattern = r"([^(),]+(?:\([^()]*\)[^(),]*)*)" # split by outermost commas
block_names = re.findall(split_pattern,name)

if len(block_names) == 0:
raise ValueError("no term order specified")
elif len(block_names) == 1:
name = block_names[0]
match = re.match('m\(([-+0-9,]+)\)$',name)
match = re.match(r'm\(([-+0-9,]+)\)$',name)
if match: # matrix term order
m = [int(_) for _ in match.groups()[0].split(',')] # replace match.groups()[0] with match.group(1) later
self.__copy(TermOrder(m))
Expand All @@ -741,7 +741,7 @@ def __init__(self, name='lex', n=0, force=False):
singular_str = []
macaulay2_str = []

length_pattern = re.compile("\(([0-9]+)\)$") # match with parenthesized block length at end
length_pattern = re.compile(r"\(([0-9]+)\)$") # match with parenthesized block length at end
for block in block_names:
try:
block_name, block_length, _ = re.split(length_pattern,block.strip())
Expand Down

0 comments on commit 5b40968

Please sign in to comment.