#8723: Change to return type of E.multiplication_by_m(m,True)
-------------------------------------+-------------------------------------
       Reporter:  cremona            |        Owner:  cremona
           Type:  defect             |       Status:  closed
       Priority:  minor              |    Milestone:  sage-6.1
      Component:  elliptic curves    |   Resolution:  fixed
       Keywords:                     |    Merged in:
        Authors:  Frédéric Chapoton  |    Reviewers:  John Cremona
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/cremona/ticket/8723              |  b8268eaa6c967c22fe13f08a13017f4e82ce8476
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by saraedum):

 I just stumbled upon this while working on #16129.

 Replying to [comment:20 cremona]:
 > New commits:
 >
 ||[[http://git.sagemath.org/sage.git/commit/?id=1fec983|1fec983]]||reviewer's
 patch, makes sure that the parents are correct even with caching||

 If I understand correctly, this is to make sure that the returned elements
 live in the correct rings. Does this really work the way it is meant to?
 The `x` in a univariate/bivariate ring can not be distinguished in the
 cache:
 {{{
 sage: R.<x,y> = QQ[]
 sage: S.<x> = QQ[]
 sage: R(x) == S(x)
 True
 sage: hash(R(x))==hash(S(x))
 True
 }}}

 So what actually makes the patch work is this explicit conversion back to
 the right ring:
 {{{
 - mx = self._multiple_x_numerator(m.abs(), x) /
 self._multiple_x_denominator(m.abs(), x)
 + mx = (x.parent()(self._multiple_x_numerator(m.abs(), x))
 + / x.parent()(self._multiple_x_denominator(m.abs(), x)))
 }}}

 In other words, `_multiple_x_numerator/denominator` still return elements
 in the wrong ring. This is probably acceptable since they are marked as
 internal methods anyway:
 {{{
 sage: E = EllipticCurve([0,0,0,0,1])
 sage: R.<x,y> = QQ[]
 sage: E._multiple_x_numerator(2, x).parent()
 Univariate Polynomial Ring in x, y over Rational Field
 sage: E._multiple_x_numerator(2).parent()
 Univariate Polynomial Ring in x, y over Rational Field
 }}}

 Should I fix this in #16129?

 What causes actual trouble for me is that `x` has been added to the cache
 key in `division_polynomial_0`. Why is it necessary there? Is
 `division_polynomial_0` ever called with a different `x` but the same
 `cache`?

--
Ticket URL: <http://trac.sagemath.org/ticket/8723#comment:33>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to