On 2012-11-18, Nils Bruin <nbr...@sfu.ca> wrote: > On Nov 18, 9:22 am, Dima Pasechnik <dimp...@gmail.com> wrote: > >> How different is "rational number"*"finite field element" >> from division, which is also a partial operation? >> (Well, I admit I don't know Sage's coersion model at all...) > > Robert is probably more qualified to explain, but I'll try for now. > Both ><finite field element> * <rational number> > and ><finite field element> / <integer> > fit the pattern ><element of A> <binary operation> <element of B> > > In order to make sense of this, sage tries to find/construct a > "minimal" common parent C into which both A and B coerce. Integers > coerce into finite fields; all of them. It's the operation that later > fails. > > Rationals don't coerce into finite fields and that's probably a good > thing. > why? E.g. in GAP it's pefectly possible: gap> Z(11)*(5/7); Z(11)^8
(and, certainly, gap> Z(11)*(5/11); Error, ModRat: for <r>/<s> mod <n>, <s>/gcd(<r>,<s>) and <n> must be coprime in...) What does Sage win by not allowing this coersion? It's obvious what is loses - flexibility. > How damaging would it be to borrow the same mechanism as scalar > multiplication for this, i.e., define a "partial" action of Q on > GF(p)? > > How much would we gain by doing so? If we don't automatically get a > "partial" action of Q on GF(p)['x'] and VectorSpace(GF(p),3) it's > probably not worth the effort. if I understand it right, if we define the minimal parent of elements of GF(p^k) and QQ to be GF(p^k), then we get all this for free. Dima -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To post to this group, send email to sage-devel@googlegroups.com. To unsubscribe from this group, send email to sage-devel+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel?hl=en.