Switching to Singular for working over ZZ seems like a good idea. I timed it over ZZ and QQ in Singular and don't notice much difference in the timings.
I'm sure the following is obvious, but let me mention it just in case. In the blog post I explain that some systems do not explicitly provide arithmetic over Z (e.g. Giac, which internally optimises for Z, but works over Q from the point of view of the user). The answer to a general division over Z will not necessarily be the same as the answer over Q. I chose the specific benchmark examples so that this is actually the case, but it isn't true in general. This was the only way to give meaningful comparison with Giac. But this doesn't imply that one can always work over Q instead of Z of course! Apparently, Factory does have code to work over Z instead of Q, which could be called directly (after explicit conversion, sanity checking, etc). But note that the code in Factory for working over Z certainly gets less of a workout than the code over Q, so caveat emptor. Apparently, one comment in my blog about Singular calling Factory for one of the commands I was issuing, is incorrect. I will correct this in my blog. We traced it through, and in fact I was using Singular functions only. Bill. On Monday, 10 July 2017 14:02:51 UTC+2, mmarco wrote: > > This is now #23395 <https://trac.sagemath.org/ticket/23395> > > El lunes, 10 de julio de 2017, 13:43:46 (UTC+2), mmarco escribió: >> >> If you used quo_rem, beware that Sage only uses Singular if the >> coefficient ring is a field. So if you define your polynomials over QQ >> instead of ZZ you will get timings similar to those of Singular. In the >> case of ZZ, it will do so with some generic python implementation of >> division. >> >> I guess we could rely on Singular also for the case of Integers. >> >> El lunes, 10 de julio de 2017, 12:48:55 (UTC+2), mmarco escribió: >>> >>> It is surprising the difference between singular and Sage, considering >>> that Sage mostly relies on Singular for multivariate polynomial arithmetic. >>> In the case of divisions, I suspect that it has to do with the fact that >>> Sage treats division of polynomials as an operation in the fraction field, >>> so it would construct the fraction, look for common factors in the >>> numerator and denominator, and cancel them. That is probably not what other >>> systems do. >>> >>> Which commands/instructions did you use in your benchmarks? >>> >>> El lunes, 10 de julio de 2017, 12:13:00 (UTC+2), Bill Hart escribió: >>>> >>>> The reason that I required the quotient as well in the divisibility >>>> benchmark was that Magma does the n = 20 dense case in 0.15s otherwise, >>>> and >>>> I don't believe it is possible to do it that fast if you aren't doing it >>>> heuristically, as I explained in the blog post. Therefore, all the systems >>>> timed must return the quotient if the division is exact (which it is in >>>> the >>>> benchmark examples, since that is the hard case), so that Magma can't >>>> possibly "cheat". >>>> >>>> As mentioned, if the various systems don't provide such a function, I >>>> substituted divrem, since it is possible to look at the remainder to see >>>> if >>>> it was divisible, and then take the quotient as required by the benchmark. >>>> >>>> It is really hard to benchmark a bunch of systems against one another. >>>> When I first timed Giac, I wasn't aware of a bunch of special parameters >>>> you can pass to the Giac functions which make them run much faster. And >>>> basically, there aren't many functions that all the systems happen to >>>> implement with the same semantics, so I have to simulate what a user would >>>> do if that is the semantics they want. I didn't do it to make Sage look >>>> bad, honest! >>>> >>>> On Monday, 10 July 2017 12:05:28 UTC+2, Bill Hart wrote: >>>>> >>>>> 7.6 >>>>> >>>>> On Monday, 10 July 2017 11:56:32 UTC+2, vdelecroix wrote: >>>>>> >>>>>> On 10/07/2017 09:34, Ralf Stephan wrote: >>>>>> > On Monday, July 10, 2017 at 8:55:23 AM UTC+2, vdelecroix wrote: >>>>>> >> >>>>>> >> He was certainly not using the awfully slow symbolic ring >>>>>> >> >>>>>> > >>>>>> > Then his slow timings for e.g. "Divisibility test with quotient >>>>>> (sparse)" >>>>>> > needs a different explanation. >>>>>> >>>>>> Sage version? >>>>>> >>>>>> -- 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.