Skip to content

Conversation

chriswuthrich
Copy link
Contributor

@chriswuthrich chriswuthrich commented May 5, 2023

📚 Description

Fixes #34790

The p-adic height calculations on an elliptic curve assumed that the equation was minimal.
This is fixed as well as some docstring formatting.

The main mathematical change is in padics.py, new line 579, which is then used in new line 931. This makes sure that the point is multiplied by an integer such that it has good reduction at all primes, even if the model is not minimal. Though it is still assumed that the models is integral.

The rest is cosmetics.

📝 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.

(My first pull request, tell me if I am doing something wrong or where I need to read up on how we do things now.)

@chriswuthrich
Copy link
Contributor Author

I don't understand the error in pycodestyle. Line 332 in constructor.py is When constructing a curve over `\QQ` from a Cremona or LMFDB and that has no "\Q" but a "\QQ" as it should.

@fchapoton
Copy link
Contributor

I don't understand the error in pycodestyle. Line 332 in constructor.py is When constructing a curve over `\QQ` from a Cremona or LMFDB and that has no "\Q" but a "\QQ" as it should.

You just need to start any doctest containing latex macros with r""" instead of """.

@chriswuthrich
Copy link
Contributor Author

You just need to start any doctest containing latex macros with r""" instead of """.

Oh, of course, thanks a lot for the help, Frédéric. I am a bit rusty.

@chriswuthrich
Copy link
Contributor Author

This is ready for review in component "elliptic curves". (Can I add labels myself?)
Maybe @JohnCremona knows who could be ready to look at the changes.

@JohnCremona
Copy link
Member

I will review this

Copy link
Member

@JohnCremona JohnCremona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good. Th ecomments are all trivial, partly to keep codecov happy

li = []
for p in ps:
np = u.valuation(p)
if Emin.discriminant() %p != 0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could omit the !=0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer keeping it. Old habit to think like a mathematician: I think they increase the readability of the code, but don't slow it down significantly. But you insist, I am ok taking it off.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't insist (I do the same) but some python purists might

else: # non split
li.append(E.tamagawa_number(p) * (p+1) * p**(np-1))
otherbad = Integer(Emin.discriminant()).prime_divisors()
otherbad = [p for p in otherbad if u%p != 0 ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could omit the !=0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

@chriswuthrich
Copy link
Contributor Author

The added commits contain the requested doctests in padics.py. And it corrects my earlier changes of "√élu". It now reads "square-root Vélu" instead. A discussion on this issue took place in the pull request #35626 . I am open for a larger discussion of this question and change it back to "√élu".

@chriswuthrich
Copy link
Contributor Author

I have clicked on "resolved" on the three reviewer's comments above that I think I have resolved. I don't know if that is my job or the reviewers' job.

@JohnCremona
Copy link
Member

Probably my job to mark them as resolved, I will look again soon

@vbraun
Copy link
Member

vbraun commented May 22, 2023

Merge conflict

@JohnCremona
Copy link
Member

I'll switch this back to +ve review when tests pass

@vbraun
Copy link
Member

vbraun commented Jun 3, 2023

Merge conflict

Sorry wrong ticket!

@github-actions
Copy link

github-actions bot commented Jun 4, 2023

Documentation preview for this PR (built with commit 02ee0e2) is ready! 🎉

@vbraun vbraun merged commit fe931a7 into sagemath:develop Jun 11, 2023
vbraun pushed a commit that referenced this pull request Jun 11, 2023
gh-35626: Update  the rank function of elliptic curves to use ellrank in pari
    
### 📚 Description

Fixes #35621

Pari has now a very good in-built algorithm to determine the rank and a
set of generators of the Mordell-Weil group of elliptic curves over the
rational. It is, as far as I understand, a port of Denis Simon's script
ellQ.gp. It performs a 2-descent and uses the Cassels Tate pairing to
conclude the rank in many cases - when Sha has no 4-torsion elements.
The functionality to search rational points is also very quick.



### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x
]`. -->

- `[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.


### ⌛ Dependencies

- #35614 a pull request that fixes, among other things,  the
documentation in the files changed here.
  To avoid problems, I based it on that PR.

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: #35626
Reported by: Chris Wuthrich
Reviewer(s): Chris Wuthrich, John Cremona, Lorenz Panny
@chriswuthrich chriswuthrich deleted the trac34790_2 branch July 4, 2023 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

padic height calculations assume minimal equations
5 participants