Skip to content

Commit

Permalink
sagemathgh-37714: sage.modular: Docstring/doctest cosmetics
Browse files Browse the repository at this point in the history
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Cherry-picked from sagemath#35095.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#37714
Reported by: Matthias Köppe
Reviewer(s): Matthias Köppe, Sebastian A. Spindler
  • Loading branch information
Release Manager committed Apr 20, 2024
2 parents f373ea0 + 3ee561a commit 25b0269
Show file tree
Hide file tree
Showing 10 changed files with 510 additions and 296 deletions.
7 changes: 3 additions & 4 deletions src/sage/modular/arithgroup/arithgroup_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ cdef class ArithmeticSubgroupElement(MultiplicativeGroupElement):
- ``parent`` -- an arithmetic subgroup
- `x` -- data defining a 2x2 matrix over ZZ
which lives in parent
- ``x`` -- data defining a 2x2 matrix over ZZ
which lives in ``parent``
- ``check`` -- if ``True``, check that parent is an arithmetic
subgroup, and that `x` defines a matrix of
determinant `1`.
subgroup, and that `x` defines a matrix of determinant `1`.
We tend not to create elements of arithmetic subgroups that are not
SL2Z, in order to avoid coercion issues (that is, the other arithmetic
Expand Down
4 changes: 2 additions & 2 deletions src/sage/modular/cusps_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ def is_Gamma0_equivalent(self, other, N, Transformation=False):
::
sage: k.<a> = NumberField(x^2+23)
sage: k.<a> = NumberField(x^2 + 23)
sage: N = k.ideal(3)
sage: alpha1 = NFCusp(k, a+1, 4)
sage: alpha2 = NFCusp(k, a-8, 29)
Expand Down Expand Up @@ -1189,7 +1189,7 @@ def NFCusps_ideal_reps_for_levelN(N, nlists=1):
::
sage: k.<a> = NumberField(x^4 - x^3 -21*x^2 + 17*x + 133)
sage: k.<a> = NumberField(x^4 - x^3 - 21*x^2 + 17*x + 133)
sage: N = k.ideal(6)
sage: from sage.modular.cusps_nf import NFCusps_ideal_reps_for_levelN
sage: NFCusps_ideal_reps_for_levelN(N)
Expand Down
121 changes: 84 additions & 37 deletions src/sage/modular/dirichlet.py

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/sage/modular/hypergeometric_motive.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
sage: H = Hyp(cyclotomic=([30], [1,2,3,5]))
sage: H.alpha_beta()
([1/30, 7/30, 11/30, 13/30, 17/30, 19/30, 23/30, 29/30],
[0, 1/5, 1/3, 2/5, 1/2, 3/5, 2/3, 4/5])
[0, 1/5, 1/3, 2/5, 1/2, 3/5, 2/3, 4/5])
sage: H.M_value() == 30**30 / (15**15 * 10**10 * 6**6)
True
sage: H.euler_factor(2, 7)
Expand Down Expand Up @@ -1458,7 +1458,7 @@ def H_value(self, p, f, t, ring=None):
- `t` -- a rational parameter
- ``ring`` -- optional (default ``UniversalCyclotomicfield``)
- ``ring`` -- optional (default :class:`UniversalCyclotomicfield`)
The ring could be also ``ComplexField(n)`` or ``QQbar``.
Expand All @@ -1469,9 +1469,9 @@ def H_value(self, p, f, t, ring=None):
.. WARNING::
This is apparently working correctly as can be tested
using ComplexField(70) as value ring.
using ``ComplexField(70)`` as the value ring.
Using instead UniversalCyclotomicfield, this is much
Using instead :class:`UniversalCyclotomicfield`, this is much
slower than the `p`-adic version :meth:`padic_H_value`.
EXAMPLES:
Expand Down
7 changes: 4 additions & 3 deletions src/sage/modular/modform/ambient_R.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, M, base_ring):
EXAMPLES::
sage: M = ModularForms(23,2,base_ring=GF(7)) # indirect doctest
sage: M = ModularForms(23, 2, base_ring=GF(7)) # indirect doctest
sage: M
Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(23)
of weight 2 over Finite Field of size 7
Expand All @@ -47,9 +47,10 @@ def modular_symbols(self,sign=0):
sage: # needs sage.rings.number_field
sage: K.<i> = QuadraticField(-1)
sage: chi = DirichletGroup(5, base_ring = K).0
sage: chi = DirichletGroup(5, base_ring=K).0
sage: x = polygen(ZZ, 'x')
sage: L.<c> = K.extension(x^2 - 402*i)
sage: M = ModularForms(chi, 7, base_ring = L)
sage: M = ModularForms(chi, 7, base_ring=L)
sage: symbs = M.modular_symbols()
sage: symbs.character() == chi
True
Expand Down
2 changes: 1 addition & 1 deletion src/sage/modular/modform/ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def __init__(self, group, base_ring=QQ):
Traceback (most recent call last):
...
ValueError: group (=3.40000000000000) should be a congruence subgroup
sage: ModularFormsRing(Gamma0(2), base_ring=PolynomialRing(ZZ,x))
sage: ModularFormsRing(Gamma0(2), base_ring=PolynomialRing(ZZ, 'x'))
Traceback (most recent call last):
...
ValueError: base ring (=Univariate Polynomial Ring in x over Integer Ring) should be QQ, ZZ or a finite prime field
Expand Down
8 changes: 4 additions & 4 deletions src/sage/modular/modform_hecketriangle/graded_ring_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _richcmp_(self, other, op):
EXAMPLES::
sage: from sage.modular.modform_hecketriangle.graded_ring import MeromorphicModularFormsRing
sage: (x,y,z,d) = MeromorphicModularFormsRing().pol_ring().gens()
sage: x, y, z, d = MeromorphicModularFormsRing().pol_ring().gens()
sage: MeromorphicModularFormsRing(n=3)(x) == MeromorphicModularFormsRing(n=4)(x)
False
sage: MeromorphicModularFormsRing()(-1/x) is MeromorphicModularFormsRing()(1/(-x))
Expand Down Expand Up @@ -1250,7 +1250,7 @@ def order_at(self, tau=infinity):
Return the (overall) order of ``self`` at ``tau`` if easily possible:
Namely if ``tau`` is ``infinity`` or congruent to ``i`` resp. ``rho``.
It is possible to determine the order of points from ``HyperbolicPlane()``.
It is possible to determine the order of points from :class:`HyperbolicPlane`.
In this case the coordinates of the upper half plane model are used.
If ``self`` is homogeneous and modular then the rational function
Expand Down Expand Up @@ -1835,7 +1835,7 @@ def evaluate(self, tau, prec=None, num_prec=None, check=False):
(and fail) for certain (many) choices of
(``base_ring``, ``tau.parent()``).
It is possible to evaluate at points of ``HyperbolicPlane()``.
It is possible to evaluate at points of :class:`HyperbolicPlane`.
In this case the coordinates of the upper half plane model are used.
To obtain a precise and fast result the parameters
Expand Down Expand Up @@ -2124,7 +2124,7 @@ def evaluate(self, tau, prec=None, num_prec=None, check=False):
sage: (f.q_expansion_fixed_d().polynomial())(exp((2*pi*i).n(1000)*az/G.lam())) # long time
-140.471170232432551196978... + 469.079369280804086032719...*I
It is possible to evaluate at points of ``HyperbolicPlane()``::
It is possible to evaluate at points of :class:`HyperbolicPlane`::
sage: # needs sage.symbolic
sage: p = HyperbolicPlane().PD().get_point(-I/2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2889,9 +2889,9 @@ def root_extension_embedding(self, K=None):
INPUT:
- ``K`` -- A field to which we want the (correct) embedding.
If ``K=None`` (default) then ``AlgebraicField()`` is
used for elliptic elements and ``AlgebraicRealField()``
otherwise.
If ``K=None`` (default), then ``AlgebraicField()`` is
used for elliptic elements and ``AlgebraicRealField()``
otherwise.
EXAMPLES::
Expand Down Expand Up @@ -2956,26 +2956,25 @@ def fixed_points(self, embedded=False, order="default"):
INPUT:
- ``embedded`` -- If ``True`` the fixed points are embedded into
``AlgebraicRealField`` resp. ``AlgebraicField``.
Default: ``False``.
- ``embedded`` -- If ``True``, the fixed points are embedded into
``AlgebraicRealField`` resp. ``AlgebraicField``. Default: ``False``.
- ``order`` -- If ``order="none"`` the fixed points are choosen
and ordered according to a fixed formula.
- ``order`` -- If ``order="none"`` the fixed points are choosen
and ordered according to a fixed formula.
If ``order="sign"`` the fixed points are always ordered
according to the sign in front of the square root.
If ``order="sign"`` the fixed points are always ordered
according to the sign in front of the square root.
If ``order="default"`` (default) then in case the fixed
points are hyperbolic they are ordered according to the
sign of the trace of ``self`` instead, such that the
attracting fixed point comes first.
If ``order="default"`` (default) then in case the fixed
points are hyperbolic they are ordered according to the
sign of the trace of ``self`` instead, such that the
attracting fixed point comes first.
If ``order="trace"`` the fixed points are always ordered
according to the sign of the trace of ``self``.
If the trace is zero they are ordered by the sign in
front of the square root. In particular the fixed_points
in this case remain the same for ``-self``.
If ``order="trace"`` the fixed points are always ordered
according to the sign of the trace of ``self``.
If the trace is zero they are ordered by the sign in
front of the square root. In particular the fixed_points
in this case remain the same for ``-self``.
OUTPUT:
Expand Down Expand Up @@ -3109,16 +3108,15 @@ def acton(self, tau):
INPUT:
- ``tau`` -- Either an element of ``self`` or any
element to which a linear fractional
transformation can be applied in
the usual way.
- ``tau`` -- Either an element of ``self`` or any
element to which a linear fractional
transformation can be applied in the usual way.
In particular ``infinity`` is a possible
argument and a possible return value.
In particular ``infinity`` is a possible
argument and a possible return value.
As mentioned it is also possible to use
points of ``HyperbolicPlane()``.
As mentioned it is also possible to use
points of ``HyperbolicPlane()``.
EXAMPLES::
Expand Down Expand Up @@ -3153,8 +3151,10 @@ def acton(self, tau):
sage: p = HyperbolicPlane().PD().get_point(-I/2+1/8)
sage: G.V(2).acton(p)
Point in PD -((-(47*I + 161)*sqrt(5) - 47*I - 161)/(145*sqrt(5) + 94*I + 177) + I)/(I*(-(47*I + 161)*sqrt(5) - 47*I - 161)/(145*sqrt(5) + 94*I + 177) + 1)
sage: bool(G.V(2).acton(p).to_model('UHP').coordinates() == G.V(2).acton(p.to_model('UHP').coordinates()))
Point in PD -((-(47*I + 161)*sqrt(5) - 47*I - 161)/(145*sqrt(5) + 94*I + 177)
+ I)/(I*(-(47*I + 161)*sqrt(5) - 47*I - 161)/(145*sqrt(5) + 94*I + 177) + 1)
sage: bool(G.V(2).acton(p).to_model('UHP').coordinates()
....: == G.V(2).acton(p.to_model('UHP').coordinates()))
True
sage: p = HyperbolicPlane().PD().get_point(I)
Expand Down Expand Up @@ -3335,9 +3335,15 @@ def as_hyperbolic_plane_isometry(self, model="UHP"):
[lam^2 - 1 lam]
[lam^2 - 1 lam^2 - 1]
sage: el.as_hyperbolic_plane_isometry().parent()
Set of Morphisms from Hyperbolic plane in the Upper Half Plane Model to Hyperbolic plane in the Upper Half Plane Model in Category of hyperbolic models of Hyperbolic plane
Set of Morphisms
from Hyperbolic plane in the Upper Half Plane Model
to Hyperbolic plane in the Upper Half Plane Model
in Category of hyperbolic models of Hyperbolic plane
sage: el.as_hyperbolic_plane_isometry("KM").parent()
Set of Morphisms from Hyperbolic plane in the Klein Disk Model to Hyperbolic plane in the Klein Disk Model in Category of hyperbolic models of Hyperbolic plane
Set of Morphisms
from Hyperbolic plane in the Klein Disk Model
to Hyperbolic plane in the Klein Disk Model
in Category of hyperbolic models of Hyperbolic plane
"""
from sage.geometry.hyperbolic_space.hyperbolic_interface import HyperbolicPlane
return HyperbolicPlane().UHP().get_isometry(self._matrix).to_model(model)

0 comments on commit 25b0269

Please sign in to comment.