Re: [sage-devel] bug in trivial case of number field isomorphism due to wrong pari/sage conversion

2018-12-14 Thread John Cremona
On Thu, 13 Dec 2018 at 17:22, John Cremona  wrote:

>
>
> On Thu, 13 Dec 2018 at 16:42, Vincent Delecroix <20100.delecr...@gmail.com>
> wrote:
>
>> Le 13/12/2018 à 17:17, Jeroen Demeyer a écrit :
>> > On 2018-12-13 13:11, John Cremona wrote:
>> >> The problem is that t is a pari gen and Sage tries too hard to compare
>> >> that with python 0.
>> >
>> > This has nothing to do with Sage or Python, the "problem" is that PARI
>> > considers [0] and 0 equal.
>>
>> Which make sense if you think of [0] as a polynomial of degree 0, and
>> more generally as the zero vector. Sage does the same to some extent
>>
>> sage: 0 == vector([0])
>> True
>> sage: 0 == QQ['x'].zero()
>> True
>>
>> > Personally, I think that Sage (really the package cypari2 which
>> > implements the PARI <-> Python interface) should follow the PARI
>> > semantics, even if they are dubious.
>>
>> +1
>>
>
> Well that makes fixing this easier since all we need to do is change one
> line in the is_isomorphic() method.  I assume that you agree that there is
> a top-level bug at least!
>

Some apologies seem to be required since I found the same bug 3 months ago
and made a ticket https://trac.sagemath.org/ticket/26239 with exactly the
same diagnosis.  I had forgotten.  Well, at least I don't have to make a
new ticket, just fix it.


>
> John
>
>
>>
>> --
>> 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 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.


Re: [sage-devel] bug in trivial case of number field isomorphism due to wrong pari/sage conversion

2018-12-13 Thread John Cremona
On Thu, 13 Dec 2018 at 16:42, Vincent Delecroix <20100.delecr...@gmail.com>
wrote:

> Le 13/12/2018 à 17:17, Jeroen Demeyer a écrit :
> > On 2018-12-13 13:11, John Cremona wrote:
> >> The problem is that t is a pari gen and Sage tries too hard to compare
> >> that with python 0.
> >
> > This has nothing to do with Sage or Python, the "problem" is that PARI
> > considers [0] and 0 equal.
>
> Which make sense if you think of [0] as a polynomial of degree 0, and
> more generally as the zero vector. Sage does the same to some extent
>
> sage: 0 == vector([0])
> True
> sage: 0 == QQ['x'].zero()
> True
>
> > Personally, I think that Sage (really the package cypari2 which
> > implements the PARI <-> Python interface) should follow the PARI
> > semantics, even if they are dubious.
>
> +1
>

Well that makes fixing this easier since all we need to do is change one
line in the is_isomorphic() method.  I assume that you agree that there is
a top-level bug at least!

John


>
> --
> 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 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.


Re: [sage-devel] bug in trivial case of number field isomorphism due to wrong pari/sage conversion

2018-12-13 Thread Vincent Delecroix

Le 13/12/2018 à 17:17, Jeroen Demeyer a écrit :

On 2018-12-13 13:11, John Cremona wrote:

The problem is that t is a pari gen and Sage tries too hard to compare
that with python 0.


This has nothing to do with Sage or Python, the "problem" is that PARI 
considers [0] and 0 equal.


Which make sense if you think of [0] as a polynomial of degree 0, and
more generally as the zero vector. Sage does the same to some extent

sage: 0 == vector([0])
True
sage: 0 == QQ['x'].zero()
True

Personally, I think that Sage (really the package cypari2 which 
implements the PARI <-> Python interface) should follow the PARI 
semantics, even if they are dubious.


+1

--
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.


Re: [sage-devel] bug in trivial case of number field isomorphism due to wrong pari/sage conversion

2018-12-13 Thread Jeroen Demeyer

On 2018-12-13 13:11, John Cremona wrote:

The problem is that t is a pari gen and Sage tries too hard to compare
that with python 0.


This has nothing to do with Sage or Python, the "problem" is that PARI 
considers [0] and 0 equal.


Personally, I think that Sage (really the package cypari2 which 
implements the PARI <-> Python interface) should follow the PARI 
semantics, even if they are dubious.


--
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.