On Tue, May 1, 2018 at 1:01 PM, Vincent Delecroix <20100.delecr...@gmail.com
> wrote:

> On 01/05/2018 18:31, Nils Bruin wrote:
>
>> On Tuesday, May 1, 2018 at 9:10:27 AM UTC-7, vdelecroix wrote:
>>
>>>
>>> Dear all,
>>>
>>> How should be defined division in non-integral domains like Zmod(6)? The
>>> following looks a bit incoherent to me
>>>
>>> PPS: people with access to magma are welcome to report!
>>>
>>>
>> Magma complains about division by a non-unit. It does allow "div", but it
>> also allows 5 div 2 in ZZ/6.
>>
>> I think the problem for "/" is division by a zero-divisor. Otherwise an
>> answer can be returned in a structure where an inverse has been adjoined.
>>
>> The ZeroDivisionError is therefore spot-on, if you read it as an
>> abbreviation of ZeroDivisorDivisionError. Using non-unit as abbreviation
>> for zero-divisor in Z/nZ is pretty common too. I don't think a change is
>> necessary.
>>
>
> But there is still something missing in Sage: how do I compute all
> possible "quotients" of 5 by 2 in Zmod(6) in my Sage console other than
>
> sage: R = Zmod(6)
> sage: a = R(5)
> sage: b = R(2)
> sage: [c for c in R if c*b == a]
> [2, 5]
>

Such a function would be reasonable to implement, though note that the
actual answer in your example is [], not [2, 5].

I agree with Nils that the ZeroDivisionError is correct.  If there's
something to be fixed, it's the divides function, which is currently using
a generic implementation from element.pyx that falls back on testing
whether a % b == 0.  Indeed:

sage: R = Zmod(6)
sage: R(2).divides(R(4))
True
sage: R(4).divides(R(2))
ArithmeticError: reduction modulo 4 not defined
David


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

Reply via email to