Re: [sage-devel] missing coercion?

2022-10-12 Thread 'Martin R' via sage-devel
Ah, thank you!

On Wednesday, 12 October 2022 at 23:19:09 UTC+2 David Roe wrote:

> It's the difference between conversion and coercion.
>
> P = PolynomialRing(GF(2), "z", sparse=True); Q = PolynomialRing(ZZ, "z", 
> sparse=False)
> sage: P.convert_map_from(Q)
> Conversion map:
>   From: Univariate Polynomial Ring in z over Integer Ring
>   To:   Sparse Univariate Polynomial Ring in z over Finite Field of size 2
> sage: P.convert_map_from(Q)(Q.gen())
> z
>
> David
>
> On Wed, Oct 12, 2022 at 5:15 PM 'Martin R' via sage-devel <
> sage-...@googlegroups.com> wrote:
>
>> Sorry, I don't understand your last sentence.  We have
>>
>> sage: P = PolynomialRing(GF(2), "z", sparse=True); Q = 
>> PolynomialRing(ZZ, "z", sparse=False)  
>> sage: P.has_coerce_map_from(Q) 
>> False
>>
>> How does this fit with
>>
>> "And of course you can convert even when Q is not sparse."?
>>
>> Martin
>>
>> On Wednesday, 12 October 2022 at 23:04:38 UTC+2 David Roe wrote:
>>
>>> Yes, that's expected.
>>>
>>> sage: P = PolynomialRing(GF(2), "z", sparse=True); Q = 
>>> PolynomialRing(ZZ, "z", sparse=True)
>>> sage: P.has_coerce_map_from(Q)
>>> True
>>>
>>> And of course you can convert even when Q is not sparse.
>>> David
>>>
>>> On Wed, Oct 12, 2022 at 4:58 PM 'Martin R' via sage-devel <
>>> sage-...@googlegroups.com> wrote:
>>>
 I have no idea whether the following is to be expected:

 sage: P = PolynomialRing(GF(2), "z", sparse=False); Q = 
 PolynomialRing(ZZ, "z") 
 sage: P.has_coerce_map_from(Q) 
 True 

 sage: P = PolynomialRing(GF(2), "z", sparse=True); Q = 
 PolynomialRing(ZZ, "z")  
 sage: P.has_coerce_map_from(Q) 
 False

 Martin

 -- 
 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+...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/sage-devel/c585103b-9dfa-4e25-b36b-20f8fb937435n%40googlegroups.com
  
 
 .

>>> -- 
>> 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+...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-devel/5d443b30-3171-4a6c-bfdc-c61100680cc9n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/3f51dc5d-09fc-4809-b908-eec488d661e9n%40googlegroups.com.


Re: [sage-devel] missing coercion?

2022-10-12 Thread David Roe
It's the difference between conversion and coercion.

P = PolynomialRing(GF(2), "z", sparse=True); Q = PolynomialRing(ZZ, "z",
sparse=False)
sage: P.convert_map_from(Q)
Conversion map:
  From: Univariate Polynomial Ring in z over Integer Ring
  To:   Sparse Univariate Polynomial Ring in z over Finite Field of size 2
sage: P.convert_map_from(Q)(Q.gen())
z

David

On Wed, Oct 12, 2022 at 5:15 PM 'Martin R' via sage-devel <
sage-devel@googlegroups.com> wrote:

> Sorry, I don't understand your last sentence.  We have
>
> sage: P = PolynomialRing(GF(2), "z", sparse=True); Q = PolynomialRing(ZZ,
> "z", sparse=False)
> sage: P.has_coerce_map_from(Q)
> False
>
> How does this fit with
>
> "And of course you can convert even when Q is not sparse."?
>
> Martin
>
> On Wednesday, 12 October 2022 at 23:04:38 UTC+2 David Roe wrote:
>
>> Yes, that's expected.
>>
>> sage: P = PolynomialRing(GF(2), "z", sparse=True); Q = PolynomialRing(ZZ,
>> "z", sparse=True)
>> sage: P.has_coerce_map_from(Q)
>> True
>>
>> And of course you can convert even when Q is not sparse.
>> David
>>
>> On Wed, Oct 12, 2022 at 4:58 PM 'Martin R' via sage-devel <
>> sage-...@googlegroups.com> wrote:
>>
>>> I have no idea whether the following is to be expected:
>>>
>>> sage: P = PolynomialRing(GF(2), "z", sparse=False); Q =
>>> PolynomialRing(ZZ, "z")
>>> sage: P.has_coerce_map_from(Q)
>>> True
>>>
>>> sage: P = PolynomialRing(GF(2), "z", sparse=True); Q =
>>> PolynomialRing(ZZ, "z")
>>> sage: P.has_coerce_map_from(Q)
>>> False
>>>
>>> Martin
>>>
>>> --
>>> 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+...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/sage-devel/c585103b-9dfa-4e25-b36b-20f8fb937435n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/5d443b30-3171-4a6c-bfdc-c61100680cc9n%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAChs6_m2adJrXP3%3Dhs%3D9AKCFcinFgGiOg_BHJ3%2BAOVVHPguERg%40mail.gmail.com.


Re: [sage-devel] missing coercion?

2022-10-12 Thread 'Martin R' via sage-devel
Sorry, I don't understand your last sentence.  We have

sage: P = PolynomialRing(GF(2), "z", sparse=True); Q = PolynomialRing(ZZ, 
"z", sparse=False)  
sage: P.has_coerce_map_from(Q) 
False

How does this fit with

"And of course you can convert even when Q is not sparse."?

Martin

On Wednesday, 12 October 2022 at 23:04:38 UTC+2 David Roe wrote:

> Yes, that's expected.
>
> sage: P = PolynomialRing(GF(2), "z", sparse=True); Q = PolynomialRing(ZZ, 
> "z", sparse=True)
> sage: P.has_coerce_map_from(Q)
> True
>
> And of course you can convert even when Q is not sparse.
> David
>
> On Wed, Oct 12, 2022 at 4:58 PM 'Martin R' via sage-devel <
> sage-...@googlegroups.com> wrote:
>
>> I have no idea whether the following is to be expected:
>>
>> sage: P = PolynomialRing(GF(2), "z", sparse=False); Q = 
>> PolynomialRing(ZZ, "z") 
>> sage: P.has_coerce_map_from(Q) 
>> True 
>>
>> sage: P = PolynomialRing(GF(2), "z", sparse=True); Q = 
>> PolynomialRing(ZZ, "z")  
>> sage: P.has_coerce_map_from(Q) 
>> False
>>
>> Martin
>>
>> -- 
>> 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+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-devel/c585103b-9dfa-4e25-b36b-20f8fb937435n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/5d443b30-3171-4a6c-bfdc-c61100680cc9n%40googlegroups.com.


Re: [sage-devel] missing coercion?

2022-10-12 Thread David Roe
Yes, that's expected.

sage: P = PolynomialRing(GF(2), "z", sparse=True); Q = PolynomialRing(ZZ,
"z", sparse=True)
sage: P.has_coerce_map_from(Q)
True

And of course you can convert even when Q is not sparse.
David

On Wed, Oct 12, 2022 at 4:58 PM 'Martin R' via sage-devel <
sage-devel@googlegroups.com> wrote:

> I have no idea whether the following is to be expected:
>
> sage: P = PolynomialRing(GF(2), "z", sparse=False); Q =
> PolynomialRing(ZZ, "z")
> sage: P.has_coerce_map_from(Q)
> True
>
> sage: P = PolynomialRing(GF(2), "z", sparse=True); Q = PolynomialRing(ZZ,
> "z")
> sage: P.has_coerce_map_from(Q)
> False
>
> Martin
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/c585103b-9dfa-4e25-b36b-20f8fb937435n%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAChs6_%3DJT8Fiaw-U%2BVch2nzb4-OQYa4LgUygOPNnXvEJtY_U%2Bg%40mail.gmail.com.


[sage-devel] missing coercion?

2022-10-12 Thread 'Martin R' via sage-devel
I have no idea whether the following is to be expected:

sage: P = PolynomialRing(GF(2), "z", sparse=False); Q = PolynomialRing(ZZ, 
"z") 
sage: P.has_coerce_map_from(Q) 
True 

sage: P = PolynomialRing(GF(2), "z", sparse=True); Q = PolynomialRing(ZZ, 
"z")  
sage: P.has_coerce_map_from(Q) 
False

Martin

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/c585103b-9dfa-4e25-b36b-20f8fb937435n%40googlegroups.com.