Skip to content

Commit

Permalink
Docstring suggestions for 5219d62 by kwankyu
Browse files Browse the repository at this point in the history
":param x:" to "- x --", "S-matrix" to "`S`-matrix", "; Whether" to "; whether", etc
  • Loading branch information
gmou3 committed Jun 10, 2024
1 parent ad120b6 commit 75b4801
Show file tree
Hide file tree
Showing 46 changed files with 666 additions and 571 deletions.
5 changes: 3 additions & 2 deletions src/sage/algebras/commutative_dga.py
Original file line number Diff line number Diff line change
Expand Up @@ -1879,12 +1879,13 @@ def basis(self, n, total=False):
sage: A.basis(2, total=True)
[a^2, a*b, b^2, c]
Since 2 is a not a multi-index, we don't need to specify ``total=True``::
Since 2 is a not a multi-index, we don't need to specify that ``total``
is ``True``::
sage: A.basis(2)
[a^2, a*b, b^2, c]
If ``total==True``, then `n` can still be a tuple, list,
If ``total`` is ``True``, then `n` can still be a tuple, list,
etc., and its total degree is used instead::
sage: A.basis((1,1), total=True)
Expand Down
14 changes: 7 additions & 7 deletions src/sage/algebras/fusion_rings/fusion_double.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,18 +237,18 @@ def _char_cache(self, i, g):
@cached_method
def s_ij(self, i, j, unitary=False, base_coercion=True):
r"""
Return the element of the S-matrix of this fusion ring
Return the element of the `S`-matrix of this fusion ring
corresponding to the given elements.
Without the unitary option set true, this is the unnormalized S-matrix
Without the unitary option set true, this is the unnormalized `S`-matrix
entry, denoted `\tilde{s}_{ij}`, in [BaKi2001]_ Chapter 3. The
normalized S-matrix entries are denoted `s_{ij}`.
normalized `S`-matrix entries are denoted `s_{ij}`.
INPUT:
- ``i``, ``j``, -- a pair of basis elements
- ``unitary`` -- boolean (default: ``False``); set to ``True`` to
obtain the unitary S-matrix
obtain the unitary `S`-matrix
EXAMPLES::
Expand Down Expand Up @@ -280,7 +280,7 @@ def s_ij(self, i, j, unitary=False, base_coercion=True):

def s_ijconj(self, i, j, unitary=False, base_coercion=True):
r"""
Return the conjugate of the element of the S-matrix given by
Return the conjugate of the element of the `S`-matrix given by
``self.s_ij(elt_i, elt_j, base_coercion=base_coercion)``.
.. SEEALSO::
Expand All @@ -299,7 +299,7 @@ def s_ijconj(self, i, j, unitary=False, base_coercion=True):

def s_matrix(self, unitary=False, base_coercion=True):
r"""
Return the S-matrix of this fusion ring.
Return the `S`-matrix of this fusion ring.
OPTIONAL:
Expand Down Expand Up @@ -349,7 +349,7 @@ def N_ijk(self, i, j, k):
where `s_0` is the unit element (assuming ``prefix='s'``).
Method of computation is through the Verlinde formula,
deducing the values from the known values of the S-matrix.
deducing the values from the known values of the `S`-matrix.
EXAMPLES::
Expand Down
28 changes: 14 additions & 14 deletions src/sage/algebras/fusion_rings/fusion_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ class FusionRing(WeylCharacterRing):
as the Grothendieck ring of a *modular tensor category* (MTC). These
include twist methods :meth:`Element.twist` and :meth:`Element.ribbon`
for its elements related to the ribbon structure, and the
S-matrix :meth:`s_ij`.
`S`-matrix :meth:`s_ij`.
There are two natural normalizations of the S-matrix. Both
There are two natural normalizations of the `S`-matrix. Both
are explained in Chapter 3 of [BaKi2001]_. The one that is computed
by the method :meth:`s_matrix`, or whose individual entries
are computed by :meth:`s_ij` is denoted `\tilde{s}` in
[BaKi2001]_. It is not unitary.
The unitary S-matrix is `s=D^{-1/2}\tilde{s}` where
The unitary `S`-matrix is `s=D^{-1/2}\tilde{s}` where
.. MATH::
Expand All @@ -154,7 +154,7 @@ class FusionRing(WeylCharacterRing):
`d_i(V)` the *quantum dimension*. We will call quantity `D`
the *global quantum dimension* and `\sqrt{D}` the
*total quantum order*. They are computed by :meth:`global_q_dimension`
and :meth:`total_q_order`. The unitary S-matrix `s` may be obtained
and :meth:`total_q_order`. The unitary `S`-matrix `s` may be obtained
using :meth:`s_matrix` with the option ``unitary=True``.
Let us check the Verlinde formula, which is [DFMS1996]_ (16.3). This
Expand All @@ -166,7 +166,7 @@ class FusionRing(WeylCharacterRing):
where `N^k_{ij}` are the fusion coefficients, i.e. the structure
constants of the fusion ring, and ``I`` is the unit object.
The S-matrix has the property that if `i*` denotes the dual
The `S`-matrix has the property that if `i*` denotes the dual
object of `i`, implemented in Sage as ``i.dual()``, then
.. MATH::
Expand All @@ -180,7 +180,7 @@ class FusionRing(WeylCharacterRing):
N_{ijk} = \sum_l \frac{s(i, \ell)\, s(j, \ell)\, s(k, \ell)}{s(I, \ell)},
In this formula `s` is the normalized unitary S-matrix
In this formula `s` is the normalized unitary `S`-matrix
denoted `s` in [BaKi2001]_. We may define a function that
corresponds to the right-hand side, except using
`\tilde{s}` instead of `s`::
Expand Down Expand Up @@ -257,9 +257,9 @@ class FusionRing(WeylCharacterRing):
T = \begin{pmatrix} 1 & 1\\ &1 \end{pmatrix}
subject to the relations `(ST)^3 = S^2`, `S^2T = TS^2`, and `S^4 = I`.
Let `s` be the normalized S-matrix, and
Let `s` be the normalized `S`-matrix, and
`t` the diagonal matrix whose entries are the twists of the simple
objects. Let `s` the unitary S-matrix and `t` the matrix of twists,
objects. Let `s` the unitary `S`-matrix and `t` the matrix of twists,
and `C` the conjugation matrix :meth:`conj_matrix`. Let
.. MATH::
Expand Down Expand Up @@ -509,7 +509,7 @@ def field(self):
r"""
Return a cyclotomic field large enough to
contain the `2 \ell`-th roots of unity, as well as
all the S-matrix entries.
all the `S`-matrix entries.
EXAMPLES::
Expand Down Expand Up @@ -815,11 +815,11 @@ def Nk_ij(self, elt_i, elt_j, elt_k):
@cached_method
def s_ij(self, elt_i, elt_j, base_coercion=True):
r"""
Return the element of the S-matrix of this fusion ring corresponding to
Return the element of the `S`-matrix of this fusion ring corresponding to
the given elements.
This is the unnormalized S-matrix, denoted `\tilde{s}_{ij}`
in [BaKi2001]_ . To obtain the normalized S-matrix, divide by
This is the unnormalized `S`-matrix, denoted `\tilde{s}_{ij}`
in [BaKi2001]_ . To obtain the normalized `S`-matrix, divide by
:meth:`global_q_dimension()` or use :meth:`S_matrix()` with
the option ``unitary=True``.
Expand Down Expand Up @@ -854,7 +854,7 @@ def s_ij(self, elt_i, elt_j, base_coercion=True):

def s_ijconj(self, elt_i, elt_j, base_coercion=True):
"""
Return the conjugate of the element of the S-matrix given by
Return the conjugate of the element of the `S`-matrix given by
``self.s_ij(elt_i, elt_j, base_coercion=base_coercion)``.
See :meth:`s_ij`.
Expand Down Expand Up @@ -895,7 +895,7 @@ def s_ijconj(self, elt_i, elt_j, base_coercion=True):

def s_matrix(self, unitary=False, base_coercion=True):
r"""
Return the S-matrix of this fusion ring.
Return the `S`-matrix of this fusion ring.
OPTIONAL:
Expand Down
18 changes: 9 additions & 9 deletions src/sage/algebras/steenrod/steenrod_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ def basis_name(self):

def _has_nontrivial_profile(self):
r"""
``True`` if the profile function for this algebra seems to be that
Return ``True`` if the profile function for this algebra seems to be that
for a proper sub-Hopf algebra of the Steenrod algebra.
EXAMPLES::
Expand Down Expand Up @@ -1991,7 +1991,7 @@ def q_degree(m, prime=3):

def _coerce_map_from_(self, S):
r"""
``True`` if there is a coercion from ``S`` to ``self``, ``False``
Return ``True`` if there is a coercion from ``S`` to ``self``, ``False``
otherwise.
INPUT:
Expand Down Expand Up @@ -2135,7 +2135,7 @@ def _element_constructor_(self, x):

def __contains__(self, x):
r"""
``True`` if self contains `x`.
Return ``True`` if self contains `x`.
EXAMPLES::
Expand Down Expand Up @@ -2262,7 +2262,7 @@ def basis(self, d=None):

def _check_profile_on_basis(self, t):
"""
``True`` if the element specified by the tuple ``t`` is in this
Return ``True`` if the element specified by the tuple ``t`` is in this
algebra.
INPUT:
Expand Down Expand Up @@ -2829,7 +2829,7 @@ def gen(self, i=0):

def is_commutative(self):
r"""
``True`` if ``self`` is graded commutative, as determined by the
Return ``True`` if ``self`` is graded commutative, as determined by the
profile function. In particular, a sub-Hopf algebra of the
mod 2 Steenrod algebra is commutative if and only if there is
an integer `n>0` so that its profile function `e` satisfies
Expand Down Expand Up @@ -2881,7 +2881,7 @@ def is_commutative(self):

def is_finite(self):
r"""
``True`` if this algebra is finite-dimensional.
Return ``True`` if this algebra is finite-dimensional.
Therefore true if the profile function is finite, and in
particular the ``truncation_type`` must be finite.
Expand Down Expand Up @@ -3517,8 +3517,8 @@ def excess_odd(mono):

def is_unit(self):
r"""
``True`` if element has a nonzero scalar multiple of
`\textnormal{P}(0)` as a summand, ``False`` otherwise.
Return ``True`` if element has a nonzero scalar multiple of
`P(0)` as a summand, ``False`` otherwise.
EXAMPLES::
Expand All @@ -3539,7 +3539,7 @@ def is_unit(self):

def is_nilpotent(self):
"""
``True`` if element is not a unit, ``False`` otherwise.
Return ``True`` if element is not a unit, ``False`` otherwise.
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/steenrod/steenrod_algebra_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def get_basis_name(basis, p, generic=None):

def is_valid_profile(profile, truncation_type, p=2, generic=None):
r"""
``True`` if ``profile``, together with ``truncation_type``, is a valid
Return ``True`` if ``profile``, together with ``truncation_type``, is a valid
profile at the prime `p`.
INPUT:
Expand Down
2 changes: 0 additions & 2 deletions src/sage/categories/coxeter_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -2886,8 +2886,6 @@ def is_coxeter_sortable(self, c, sorting_word=None):
- ``sorting_word`` -- sorting word (default: ``None``); used to
not recompute the `c`-sorting word if already computed
OUTPUT: is ``self`` `c`-sortable
EXAMPLES::
sage: W = CoxeterGroups().example()
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/rings.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def is_integral_domain(self, proof=True) -> bool:
INPUT:
- ``proof`` -- boolean (default: ``True``); Determines what to do
- ``proof`` -- boolean (default: ``True``); determine what to do
in unknown cases
ALGORITHM:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/coding/linear_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -1933,7 +1933,7 @@ def weight_enumerator(self, names=None, bivariate=True):
homogeneous polynomial. Can be given as a single string of length 2,
or a single string with a comma, or as a tuple or list of two strings.
- ``bivariate`` -- boolean (default: ``True``); Whether to return a
- ``bivariate`` -- boolean (default: ``True``); whether to return a
bivariate, homogeneous polynomial or just a univariate polynomial. If
set to ``False``, then ``names`` will be interpreted as a single
variable name and default to ``'x'``.
Expand Down
6 changes: 3 additions & 3 deletions src/sage/combinat/binary_recurrence_sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ def pthpowers(self, p, Bound):
#Starting lower bound on good primes
self._ell = 1

#If the sequence is geometric, then the `n`th term is `a*r^n`. Thus the
#If the sequence is geometric, then the `n`-th term is `a*r^n`. Thus the
#property of being a ``p`` th power is periodic mod ``p``. So there are either
#no ``p`` th powers if there are none in the first ``p`` terms, or many if there
#is at least one in the first ``p`` terms.
Expand Down Expand Up @@ -941,7 +941,7 @@ def _is_p_power_mod(a, p, N):
- ``N`` -- a positive integer
OUTPUT: ``True`` if `a` is a `p`th power modulo `N`; ``False`` otherwise
OUTPUT: ``True`` if `a` is a `p`-th power modulo `N`; ``False`` otherwise
EXAMPLES::
Expand Down Expand Up @@ -1128,7 +1128,7 @@ def _is_p_power(a, p):
- ``p`` -- a prime number
OUTPUT: ``True`` if `a` is a `p`th power; else ``False``
OUTPUT: ``True`` if `a` is a `p`-th power; else ``False``
EXAMPLES::
Expand Down
2 changes: 0 additions & 2 deletions src/sage/combinat/crystals/affine_factorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,6 @@ def affine_factorizations(w, l, weight=None):
[s3, s2, s3, s1, s2, s3]]
sage: affine_factorizations(w0,6,(0,0,0,1,2,3))
[[1, 1, 1, s1, s2*s1, s3*s2*s1]]
"""
if weight is None:
if l == 0:
Expand Down
2 changes: 0 additions & 2 deletions src/sage/combinat/finite_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -3834,8 +3834,6 @@ def __bool__(self):
Return ``True`` if the finite state machine consists of at least
one state.

OUTPUT: boolean

TESTS::

sage: bool(FiniteStateMachine())
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/sf/sfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -6838,7 +6838,7 @@ def _to_polynomials(lf, R):
def _from_polynomial(p, f):
"""
Return the polynomial as a symmetric function in the given
basis , where the `n`th variable corresponds to the symmetric
basis , where the `n`-th variable corresponds to the symmetric
function`f[n]`.
INPUT:
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/yang_baxter_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,8 @@ def __call__(self, u):

def position(self):
r"""
``self`` is the operator that swaps positions ``i`` and ``i+1``. This
method returns ``i``.
Return ``i`` where ``self`` is the operator that swaps positions ``i``
and ``i+1``.
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/databases/oeis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ def __call__(self, k):

def __getitem__(self, i):
r"""
Return the ``i``th element of sequence ``self``, viewed as a tuple.
Return the `i`-th element of sequence ``self``, viewed as a tuple.
The first element appearing in the sequence ``self``corresponds to
``self[0]``. Do not confuse with calling ``self(k)``.
Expand Down
8 changes: 5 additions & 3 deletions src/sage/geometry/lattice_polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,11 @@ def ReflexivePolytopes(dim):
future use, so repetitive calls will return the same object in
memory.
:param dim: dimension of required reflexive polytopes
:type dim: 2 or 3
:rtype: list of lattice polytopes
INPUT:
- ``dim`` -- integer (2 or 3); dimension of required reflexive polytopes
OUTPUT: list of lattice polytopes
EXAMPLES:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/generators/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def CircularLadderGraph(n):
displayed as an inner and outer cycle pair, with the first `n` nodes drawn
on the inner circle. The first (0) node is drawn at the top of the
inner-circle, moving clockwise after that. The outer circle is drawn with
the `(n+1)`th node at the top, then counterclockwise as well.
the `(n+1)`-th node at the top, then counterclockwise as well.
When `n == 2`, we rotate the outer circle by an angle of `\pi/8` to ensure
that all edges are visible (otherwise the 4 vertices of the graph would be
placed on a single line).
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -10118,7 +10118,7 @@ def bipartite_double(self, extended=False):
INPUT:
- ``extended`` -- boolean (default: ``False``); Whether to return the
- ``extended`` -- boolean (default: ``False``); whether to return the
extended bipartite double, or only the bipartite double (default)
OUTPUT: a graph; ``self`` is left untouched
Expand Down
Loading

0 comments on commit 75b4801

Please sign in to comment.