Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved algorithm choice for isogeny computation #37242

Merged
merged 9 commits into from
Feb 25, 2024

Conversation

r98inver
Copy link
Contributor

@r98inver r98inver commented Feb 5, 2024

Improved the logic for algorithm choice in EllipticCurve_field.isogeny():

  • if we have multiple points, factored is used;
  • if the order is known and composite, factored is used;
  • if the order is known and (pseudo-)prime, we chose between the traditional Velù formulae and Velù-sqrt, depending on a parameter; this parameter may be supplied by the user with the velu_sqrt_bound argument, and if None a global parameter is used (see below);
  • in all the other cases we fall back to the traditional isogeny algorithm.

The new velu_sqrt_bound:

  • can be supplied as a parameter when calling .isogeny();
  • if supplied, is recursively passed to all calls to factored, such that each single isogeny computation has the same bound;
  • if not supplied, a global value is used instead; this is stored in the object _velu_sqrt_bound from sage.schemes.elliptic_curves.hom_velusqrt, and is initially set to 1000 (due to empirical observations) but can be manually set at runtime by the user

#sd123

Copy link
Contributor

@GiacomoPope GiacomoPope left a comment

Choose a reason for hiding this comment

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

Some small suggestions throughout and a comment about the representation of "composite but prime degree isogenies".

Very nice work, thank you for implementing this.

src/sage/schemes/elliptic_curves/ell_curve_isogeny.py Outdated Show resolved Hide resolved
src/sage/schemes/elliptic_curves/ell_field.py Outdated Show resolved Hide resolved
src/sage/schemes/elliptic_curves/ell_field.py Outdated Show resolved Hide resolved
src/sage/schemes/elliptic_curves/ell_field.py Outdated Show resolved Hide resolved
src/sage/schemes/elliptic_curves/hom_composite.py Outdated Show resolved Hide resolved
src/sage/schemes/elliptic_curves/hom_composite.py Outdated Show resolved Hide resolved
src/sage/schemes/elliptic_curves/hom_composite.py Outdated Show resolved Hide resolved
src/sage/schemes/elliptic_curves/hom_composite.py Outdated Show resolved Hide resolved
@r98inver
Copy link
Contributor Author

r98inver commented Feb 6, 2024

Thank you! I applied all your suggestions (my try-except was actually taken from ell_point.py, so I modified that as well)

@GiacomoPope
Copy link
Contributor

I was about to mark this as completed, but somehow config.cache has ended up in this commit? I'm not sure why or how?

@r98inver
Copy link
Contributor Author

r98inver commented Feb 6, 2024

Sorry, I keep messing up with git. I deleted it with a new commit, is that fine? Or should I do something different?

Copy link
Contributor

@GiacomoPope GiacomoPope left a comment

Choose a reason for hiding this comment

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

Great addition to the isogeny functionality. Thanks for also fixing the small clean up with ell_point. Appreciated.

@r98inver
Copy link
Contributor Author

r98inver commented Feb 6, 2024

Thanks!

@vbraun
Copy link
Member

vbraun commented Feb 7, 2024

Test failure, see the CI at https://github.com/sagemath/sage/actions/runs/7805562652

@r98inver
Copy link
Contributor Author

r98inver commented Feb 8, 2024

Fixed, I also noticed another failure in the coding style so I fixed that one as well.

@grhkm21
Copy link
Contributor

grhkm21 commented Feb 13, 2024

If CI passes then it's all good. This already has s: positive review.

Copy link

Documentation preview for this PR (built with commit b4408ab; changes) is ready! 🎉

vbraun pushed a commit to vbraun/sage that referenced this pull request Feb 18, 2024
    
Improved the logic for algorithm choice in
`EllipticCurve_field.isogeny()`:
- if we have multiple points, `factored` is used;
- if the order is known and composite, `factored` is used;
- if the order is known and (pseudo-)prime, we chose between the
traditional Velù formulae and Velù-sqrt, depending on a parameter; this
parameter may be supplied by the user with the `velu_sqrt_bound`
argument, and if `None` a global parameter is used (see below);
- in all the other cases we fall back to the traditional isogeny
algorithm.

The new `velu_sqrt_bound`:
- can be supplied as a parameter when calling `.isogeny()`;
- if supplied, is recursively passed to all calls to `factored`, such
that each single isogeny computation has the same bound;
- if not supplied, a global value is used instead; this is stored in the
object `_velu_sqrt_bound` from
`sage.schemes.elliptic_curves.hom_velusqrt`, and is initially set to
1000 (due to empirical observations) but can be manually set at runtime
by the user

#sd123
    
URL: sagemath#37242
Reported by: Riccardo Invernizzi
Reviewer(s): Giacomo Pope, grhkm21, Riccardo Invernizzi
vbraun pushed a commit to vbraun/sage that referenced this pull request Feb 19, 2024
    
Improved the logic for algorithm choice in
`EllipticCurve_field.isogeny()`:
- if we have multiple points, `factored` is used;
- if the order is known and composite, `factored` is used;
- if the order is known and (pseudo-)prime, we chose between the
traditional Velù formulae and Velù-sqrt, depending on a parameter; this
parameter may be supplied by the user with the `velu_sqrt_bound`
argument, and if `None` a global parameter is used (see below);
- in all the other cases we fall back to the traditional isogeny
algorithm.

The new `velu_sqrt_bound`:
- can be supplied as a parameter when calling `.isogeny()`;
- if supplied, is recursively passed to all calls to `factored`, such
that each single isogeny computation has the same bound;
- if not supplied, a global value is used instead; this is stored in the
object `_velu_sqrt_bound` from
`sage.schemes.elliptic_curves.hom_velusqrt`, and is initially set to
1000 (due to empirical observations) but can be manually set at runtime
by the user

#sd123
    
URL: sagemath#37242
Reported by: Riccardo Invernizzi
Reviewer(s): Giacomo Pope, grhkm21, Riccardo Invernizzi
@vbraun vbraun merged commit d4075f1 into sagemath:develop Feb 25, 2024
18 checks passed
@mkoeppe mkoeppe added this to the sage-10.3 milestone Mar 7, 2024
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.

None yet

6 participants