Skip to content

Commit

Permalink
gh-36165: Fix reduction of cusps for Gamma(N)
Browse files Browse the repository at this point in the history
    
The method reduce_cusp for Gamma(N) did not work properly on cusps u/v
where (u,v) is congruent to (-1,0) mod N.  This fixes that by fixing the
function _lift_pair().  A doctest has been added with the example
reported on sage-devel.

Fixes #36163

### 📝 Checklist

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation accordingly.
    
URL: #36165
Reported by: John Cremona
Reviewer(s): Frédéric Chapoton
  • Loading branch information
Release Manager committed Sep 15, 2023
2 parents 4553735 + bf08b12 commit 4f4fbc2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/sage/modular/arithgroup/congroup_gamma.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ def reduce_cusp(self, c):
sage: G = Gamma(50)
sage: all(c == G.reduce_cusp(c) for c in G.cusps())
True
We test that :trac:`36163` is fixed::
sage: Gamma(7).reduce_cusp(Cusp(6,7))
Infinity
"""
N = self.level()
c = Cusp(c)
Expand Down Expand Up @@ -341,7 +347,7 @@ def _lift_pair(U,V,N):
u = U % N
v = V % N
if v == 0:
if u == 1:
if u == 1 or u == N-1:
return (1,0)
else:
v = N
Expand Down

0 comments on commit 4f4fbc2

Please sign in to comment.