On 30 October 2016 at 13:16, Vincent Delecroix
<[email protected]> wrote:
> Dear all,
>
> (cross post sage-devel, sage-nt)
>
> While working on something else I discovered that it is possible to
> multiply vectors over QQ by elements of Zmod rings
> {{{
> sage: Zmod(5).an_element() * (QQ^2).an_element()
> (0, 0)
> sage: parent(_)
> Vector space of dimension 2 over Ring of integers modulo 5
> }}}
> However it is not possible to multiply rationals by elements of Zmod ring
> {{{
> sage: Zmod(5).an_element() * QQ.an_element()
> Traceback (most recent call last):
> ...
> TypeError: unsupported operand parent(s) for '*': 'Ring of integers
> modulo 5' and 'Rational Field'
> }}}
>
> I think that the behavior of these operations should be similar. Do
> you think that
>   A) the above is fine (with explanation please)
>   B) we should raise an error in the first example
>   C) the second example should work and the answer be an element of Zmod(5)
>   D) ?
>

I vote  C  (so that QQ works the same as QQ^1) with the usual proviso
that if the denominator is not coprime to the modulus, an error is
raised.

> Cheers
> 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 [email protected].
> To post to this group, send email to [email protected].
> 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-nt" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
Visit this group at https://groups.google.com/group/sage-nt.
For more options, visit https://groups.google.com/d/optout.

Reply via email to