-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
elliptic-curve isogenies probably shouldn't be mutable #32388
Comments
Author: Lorenz Panny |
Commit: |
This comment has been minimized.
This comment has been minimized.
comment:4
Replaced the previous, very hacky implementation of compositions between different types of |
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:6
Yet another example where this causes things to break: sage: from sage.schemes.elliptic_curves.weierstrass_morphism import WeierstrassIsomorphism
sage: E = EllipticCurve([1,0])
sage: phi = E.isogeny(E(0,0))
sage: psi = phi.dual(); psi
Isogeny of degree 2 from Elliptic Curve defined by y^2 = x^3 - 4*x over Rational Field to Elliptic Curve defined by y^2 = x^3 + x over Rational Field
sage: psi.set_post_isomorphism(WeierstrassIsomorphism(E, (1,2,3,4)))
sage: phi.dual()
Isogeny of degree 2 from Elliptic Curve defined by y^2 = x^3 - 4*x over Rational Field to Elliptic Curve defined by y^2 + 6*x*y + 8*y = x^3 - 3*x^2 - 11*x - 6 over Rational Field |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:9
Replying to @mkoeppe:
Sounds reasonable, but feels somewhat orthogonal to this ticket. In any case, to avoid fixing an interface prematurely, we should think about whether we'd like |
comment:10
For the internal call to |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:12
Only other thing that needs to be done is make sure every method has a doctest. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:14
Done, I believe. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:16
Thanks to those who have been working on this and related tickets. I have just been looking at the threads after returning from holiday and am happy with what is being proposed. The issue regarding normalization of isogenies is almost entirely restricted to isogenies over finite fields, where it is easy to achieve by changing the model used for the domain or codomain, but is almost irrelevant for isogenies over Q and other number fields, which I have done most with (and use most), where you often have few units around to scale modles by, and do not care whether the isogenies are normalised. Secondly, composing with isomorphisms in general is used a lot in the code I wrote for compstructing isogenies over number fields, where there's a generic formula for short Weiertstrass equations but one want an isogeny between other (say minimal) models. In particular, pre- and post-composing by automorphisms was implemented the way it is (I seem to remember) by the original implemented, who worked over finite fields, and added some features at my request before the first versions of all this were merged years ago. |
Reviewer: Travis Scrimshaw |
comment:17
Thank you. This LGTM. John, forgive me as this is a bit outside my mathematical area, is there something with this ticket, such as removing the pre/post-compose with mutation that you disagree with, such as for performance reasons? |
Changed reviewer from Travis Scrimshaw to Travis Scrimshaw, John Cremona |
comment:18
Replying to @tscrim:
No, not at all. I really like these changes, and also the move towards unifying isogenies with isomorphisms (of Weierstrass models) which always were a special case. This is much better. I think that implementing W. isomorphisms was the very first thing I ever did in Sage, in 2007, so probably my first ever Python programming, and hence almost certainly in need of attention -- that was before isogenies were implemented at all, and was desperately needed at the time! I have looked at the changes and am happy to add my name to the reviewers, and give this a positive review. |
comment:19
Great, thank you for clarifying and reviewing. |
comment:20
Thanks both of you! I'm glad you agree that these changes are a step towards making things better. :-) |
Changed branch from public/deprecate_mutable_elliptic_curve_isogenies to |
Right now, isogenies of elliptic curves are slightly mutable:
The three methods
switch_sign
,set_post_isomorphism
, andset_pre_isomorphism
all modifyself
.As usual, this alone already causes bugs because it breaks hashing:
The bigger issue is that it breaks other constructions that use
EllipticCurveIsogenies
as a building block: The easiest example is the existingFormalCompositeMap
we already get from composing two isogenies. Mutability means that the factors of the map can be changed after the composition has been constructed, with weird and buggy results:The main reason I care about this is because I'm working on parts of #7368, and this precise issue is causing quite a bit of headache. I suggest deprecating the
set_*_isomorphism()
andswitch_sign()
methods as soon as possible so that isogenies can stop mutating in-place at some point in the not too distant future.Since I'm sure composing isogenies with isomorphisms will be sorely missed (I use this feature a lot myself), the patch does introduce new syntax for the same operations: We can simply write
iso * phi
to post-composephi
withiso
, and similarly for pre-composition. Theswitch_sign
method can already be substituted by the unary negation operator.(Note that composing isogenies and isomorphisms using
*
does not result in a generic formal composition, but in anEllipticCurveIsogeny
like before.)To facilitate these "mixed" compositions, the patch reparents
WeierstrassIsomorphism
andEllipticCurveIsogeny
under a common parent classEllipticCurveHom
(mostly just aMorphism
with a different name). This should also make implementing other classes of elliptic-curve morphisms (e.g., purely inseparable isogenies, formal sums of isogenies for endomorphism rings, etc.) easier in the future. As part of this change,WeierstrassIsomorphism
s now have actual curves rather than groups of points as their (co)domains. This was the mathematically right choice all along and is consistent withEllipticCurveIsogenies
.Note: This patch is intentionally kept small. I'm aware of other things in the elliptic-curve isogeny code that need refactoring or fixing. My hope is that making small changes one at a time has a better chance of actually getting things done.
Also note: The patch is probably easiest to review by looking at the individual commits rather than the overall diff.
CC: @defeo @JohnCremona @tscrim
Component: elliptic curves
Keywords: isogenies, mutability
Author: Lorenz Panny
Branch/Commit:
40081c7
Reviewer: Travis Scrimshaw, John Cremona
Issue created by migration from https://trac.sagemath.org/ticket/32388
The text was updated successfully, but these errors were encountered: