#11474: Elliptic curves should be unique parent structures
-------------------------------+--------------------------------------------
   Reporter:  SimonKing        |          Owner:  cremona      
       Type:  defect           |         Status:  needs_info   
   Priority:  major            |      Milestone:  sage-4.7.1   
  Component:  elliptic curves  |       Keywords:  unique parent
Work_issues:                   |       Upstream:  N/A          
   Reviewer:                   |         Author:  Simon King   
     Merged:                   |   Dependencies:               
-------------------------------+--------------------------------------------
Changes (by newvalueoldvalue):

  * status:  new => needs_info
  * author:  => Simon King


Comment:

 The discussion on [http://groups.google.com/group/sage-
 nt/browse_thread/thread/ec8d0ad14a819082 sage-nt] shows that it is even
 not clear whether we want elliptic curves to be unique parents (yet).

 Anyway, I posted a preliminary patch. There are some doctest failures -- a
 test log is attached as well.

 Some of the errors are easy to understand: Previously, one had a "Generic
 morphism", but with unique parents one has a "Generic endomorphism".
 Others seem more tricky. For example one gets
 {{{
 sage -t  devel/sage/sage/schemes/elliptic_curves/ell_field.py
 // ** nInitExp failed: using Z/2^2
 **********************************************************************
 File "/mnt/local/king/SAGE/sage-4.7.rc2/devel/sage-
 main/sage/schemes/elliptic_curves/ell_field.py", line 1038
 :
     sage: E.weierstrass_p(prec=8, algorithm='pari')
 Exception raised:
     Traceback (most recent call last):
       File "/mnt/local/king/SAGE/sage-4.7.rc2/local/bin/ncadoctest.py",
 line 1231, in run_one_test
         self.run_one_example(test, example, filename, compileflags)
       File "/mnt/local/king/SAGE/sage-4.7.rc2/local/bin/sagedoctest.py",
 line 38, in run_one_example
         OrigDocTestRunner.run_one_example(self, test, example, filename,
 compileflags)
       File "/mnt/local/king/SAGE/sage-4.7.rc2/local/bin/ncadoctest.py",
 line 1172, in run_one_example
         compileflags, 1) in test.globs
       File "<doctest __main__.example_14[7]>", line 1, in <module>
         E.weierstrass_p(prec=Integer(8), algorithm='pari')###line 1038:
     sage: E.weierstrass_p(prec=8, algorithm='pari')
       File "/mnt/local/king/SAGE/sage-4.7.rc2/local/lib/python/site-
 packages/sage/schemes/elliptic_curves/ell
 _field.py", line 1064, in weierstrass_p
         return weierstrass_p(self, prec=prec, algorithm=algorithm)
       File "/mnt/local/king/SAGE/sage-4.7.rc2/local/lib/python/site-
 packages/sage/schemes/elliptic_curves/ell_wp.py", line 141, in
 weierstrass_p
         wp = compute_wp_pari(E, prec)
       File "/mnt/local/king/SAGE/sage-4.7.rc2/local/lib/python/site-
 packages/sage/schemes/elliptic_curves/ell_wp.py", line 168, in
 compute_wp_pari
         wpp = ep.ellwp(n=prec)
     AttributeError: 'dict' object has no attribute 'ellwp'
 }}}

 Hence, first there is a (warning or error?) message "`// ** nInitExp
 failed: using Z/2^2`", and then something is a dict that ought to be a
 completely different object.

 On the bright side, one has the following.

 Elliptic curves are unique, even when they are created in different ways:
 {{{
 sage: E = EllipticCurve('5077a'); E
 Elliptic Curve defined by y^2 + y = x^3 - 7*x + 6 over Rational Field
 sage: E is EllipticCurve('5077a') is EllipticCurve(QQ, E.a_invariants())
 is EllipticCurve(j = E.j_invariant())
 True
 }}}

 If an elliptic curve is provided with some custom attribute and the "same"
 curve is found in the database with different attributes, then one has no
 uniqueness of parents; this is in order to prevent the database from
 overriding stuff that the user has computed:
 {{{
 sage: E = EllipticCurve([0, 1, 1, -2, 0])
 sage: E is EllipticCurve('389a')
 True
 sage: E._EllipticCurve_rational_field__cremona_label = 'bogus'
 sage: E is EllipticCurve('389a')
 False
 sage: E.label()
 'bogus'
 sage: EllipticCurve('389a').label()
 '389a1'
 }}}

 However, if the custom attribute is removed, then the data from the
 database are used to provide a value for that attribute:
 {{{
 sage: del E._EllipticCurve_rational_field__cremona_label
 sage: E is EllipticCurve('389a') # uniqueness of parents again
 True
 # The label has implicitly been updated
 sage: E._EllipticCurve_rational_field__cremona_label
 '389 a 1'
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11474#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to