Okay, that’s reasonable. How about the attached, then?

Robin

On Sat, 30 Jul 2016 at 10:43 John Cremona <john.crem...@gmail.com> wrote:

> I think that an error should be raised if the projective point constructor
> is called with (0,0,0).
> On 29 Jul 2016 23:54, "Robin Houston" <robin.hous...@gmail.com> wrote:
>
> I think there’s another case that isn’t handled correctly, exemplified by:
>
> R.<x,y,z> = QQ[]
>
> T = EllipticCurve_from_cubic(y^2*z - x^3 - z^3, (0,1,0))
>
> A simple change that fixes this problem is to make the projective_point()
> method not blow up when given (0,0,0), e.g.:
>
>
> *--- a/src/sage/schemes/elliptic_curves/constructor.py*
>
> *+++ b/src/sage/schemes/elliptic_curves/constructor.py*
>
> @@ -1127,6 +1127,8 @@ def projective_point(p):
>
>          p_lcm = LCM_list([x.denominator() for x in p])
>
>      except AttributeError:
>
>          return p
>
> +    if p_gcd == 0:
>
> +        return p
>
>      scale = p_lcm / p_gcd
>
>      return [scale * x for x in p]
>
>
>
>
> This change may be undesirable for other reasons, though.
>
>
> Robin
>
>
> On Monday, 25 July 2016 11:25:00 UTC+1, Robin Houston wrote:
>>
>> I ran into an unexpected error in EllipticCurve_from_cubic, with the
>> following cubic and rational point:
>>
>> R.<x,y,z> = QQ[]
>> cubic = -3*x^2*y + 3*x*y^2 + 4*x^2*z + 4*y^2*z - 3*x*z^2 + 3*y*z^2 - 8*z^3
>> EllipticCurve_from_cubic(cubic, (-4/5, 4/5, 3/5))
>>
>> Note that it works as expected using instead the different rational point
>> (1, 1, 0).
>>
>> On investigation, I found there is a case that isn’t handled correctly.
>> The code computes
>>
>> P2 = chord_and_tangent(F, P)
>>
>> and if P2 is projectively equivalent to P then it uses a different
>> algorithm. If they’re different, it then computes
>>
>> P3 = chord_and_tangent(F, P2)
>>
>> and uses an algorithm that fails if P3 is equivalent to P2.
>>
>> I think the attached patch fixes this problem. At least, with this patch
>> it now works for my examples.
>>
>> Best wishes,
>> Robin
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
>
>
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sage-devel" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sage-devel/ywH31HkRo7g/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Attachment: cubic2.patch
Description: Binary data

Reply via email to