On Wed, May 14, 2008 at 7:46 AM, Carlo Hamalainen <[EMAIL PROTECTED]> wrote: > > Hi, > > Does Macaulay2 actually have a function to enumerate the solutions to > some equations modulo n? I'm guessing not otherwise William would have > used that in solve_mod().
Macaulay2 is not included in Sage, so even if M2 does have such function it would not be used by default in solve_mod. Also, Singular (included in Sage) is typically much faster at these sorts of things. The main point of solve_mod is that it is completely generic (and stupid), but works on any form of input equations; it's mainly for small educational purposes. It doesn't even use Groebner basis right now. I'm surprised somebody hasn't rewritten it to do so in the case when the inputs are all polynomials and the system is over a field. I wish somebody would! > > Here we have a+b+2=0 and a+3=0 all done modulo 5: > > sage: R.<a,b> = ZZ[] > sage: I = ideal([a+b+2, a+3, 5]) > sage: print I.groebner_basis() > [5, b - 1, a - 2] > > So even in this simple example, I need to work out b = 1 in Sage > myself, and then solve the rest? A vastly better way to do the above problem is to work in the polynomial ring modulo 5: sage: R.<a,b> = GF(5)[] sage: I = ideal([a+b+2, a+3]) sage: I.variety() [{a: 2, b: 1}] > > I have a situation where I need solutions with a != b and other > conditions, so I've written most of a solver, but I wanted to check if > anyone knows a better way for the general case. Probably the above is better, but I don't know since I don't know what your solver does. William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---