I don't think Sage currently supports localizations, though it would make a nice project for a student.... David
On Sun, Nov 18, 2012 at 12:10 AM, Dima Pasechnik <dimp...@gmail.com> wrote: > On 2012-11-18, Michael Orlitzky <mich...@orlitzky.com> wrote: > > I just opened, > > > > http://trac.sagemath.org/sage_trac/ticket/13720 > > > > intending to submit a patch a few minutes later, but I've hit a problem. > > The current examples feature, > > > > sage: legendre_P(3, GF(11)(5)) > > 8 > > > > which works due to a quirk in Maxima's string representation of the > > polynomial: > > > > sage: maxima.eval('legendre_p(%s,x)'%ZZ(3)) > > '-6*(1-x)-5*(1-x)^3/2+15*(1-x)^2/2+1' > > > > In Sage, this becomes, > > > > sage: -6*(1-x)-5*(1-x)^3/2+15*(1-x)^2/2+1 > > 5/2*(x - 1)^3 + 15/2*(x - 1)^2 + 6*x - 5 > > > > with division (in Maxima) replaced by rational multiplication in Sage. > > This kills the last example: > > > > sage: GF(11)(5) / 2 > > 8 > > > > sage: (1/2) * GF(11)(5) > > ---------------------------------------------------------------------- > > TypeError > > ... > > TypeError: unsupported operand parent(s) for '*': 'Rational Field' > > and 'Finite Field of size 11' > > > > So, substituting GF(11)(5) into the equation before converting it to > > Sage works. But doing the entire computation in Sage fails. > > > > How easy would this be to fix? I could convert my polynomials to Maxima > > and back I guess, but that seems a little goofy. > > > Can Sage work with Z_{(11)} ? It makes perfect sense to talk about the > product of an element of Z_{(p)} and an element of GF(p), as GF(p) is an > Z_{(p)}-module. > Conceivably, one could implement the product of a rational number and an > element of GF(p) (or even GF(p^k)) this way. > > Well, this is probably a huge overkill of the problem at hand. > > > > -- > 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. > > > -- 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.