On Tue, Jun 18, 2013 at 11:08 PM, Simon King <simon.k...@uni-jena.de> wrote: > Hi Fredrik, > > On 2013-06-18, Fredrik Johansson <fredrik.johans...@gmail.com> wrote: >> Hi all, >> >> Version 0.1 of the ore_algebra package for Sage has been released: >> http://www.risc.jku.at/research/combinat/software/ore_algebra/ >> >> The package is being developed by Manuel Kauers, Maximilian Jaroschek >> and myself. A tutorial paper (as well as Sphinx documentation) is >> available on the web site. > > Out of curiosity: Does it use the non-commutative stuff (g-algebras) > that is in Singular and that is also wrapped in Sage? > > For the latter, see the documentation of > sage.rings.polynomial.plural.g_Algebra > (that's a factory) respectively > sage.rings.polynomial.plural.NCPolynomialRing_plural > (that's the wrapper)? > > If I'm not mistaken, g-algebras are general enough to implement Ore > algebras. If your code is not based on Singular: How does it compare, > speed-wise? > > Best regards, > Simon
No, we just use commutative Sage polynomials. Here is a test of arithmetic with ore_algebra in Sage 5.9: sage: A.<x> = QQ[] sage: R.<Dx> = OreAlgebra(A, 'Dx') sage: a = (Dx + x + 1) sage: %timeit a * a 1000 loops, best of 3: 280 us per loop sage: a = (Dx + x + 1)^10 sage: %timeit a * a 10 loops, best of 3: 28.9 ms per loop sage: a = (Dx + x + 1)^100 sage: %timeit a * a 1 loops, best of 3: 11.2 s per loop With g_algebra: sage: A.<x,Dx> = FreeAlgebra(QQ,2) sage: R.<x,Dx> = A.g_algebra(relations={Dx*x:x*Dx+1}, order='lex') sage: a = (Dx + x + 1) sage: %timeit a * a 1000000 loops, best of 3: 1.69 us per loop sage: a = (Dx + x + 1)^10 sage: %timeit a * a 100 loops, best of 3: 7.05 ms per loop sage: a = (Dx + x + 1)^100 sage: %timeit a * a 1 loops, best of 3: 715 s per loop So it appears that the Python overhead makes our code quite a bit slower for small objects, while we scale better for large objects, or maybe the multiplication in Plural just does something stupid... Fredrik -- 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 http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.