IMO we do not want there to be too much of a distinction between multivariate polynomial rings in 1 variable and univariate polynomial rings. I would say the proper thing to do is to pass along the underlying implementation as part of the MPoly functor (which is what you proposed change is secretly doing). The current behavior as in your example of not storing that implementation is probably a bug and could lead to other subtle changes (e.g. you working in Sage's generic polynomial rings over *Z* but then a pushout gives an implementation in singular). Although I don't currently see why this change leads to such a slowdown, but my guess is it is just taking a lot longer to do the coercion (checks). I would have to look into this in more detail than I have the time right now.
Best, Travis On Thursday, February 28, 2019 at 10:33:32 PM UTC+10, Daniel Krenn wrote: > > On 28.02.19 09:15, Daniel Krenn wrote: > > Does someone have a glue why > > > > sage: T = PolynomialRing(QQ, 't', 1); t = T.gen() > > sage: t * vector([1,2]) > > The underlying problem is that the functor MPoly[t] applied to QQ (for > example) returns a true univariate polynomial ring instead of a > multivariate polynomial ring in 1 variable. I believe it shouldn't, also > because we want > > sage: T = PolynomialRing(QQ, 't', 1); t = T.gen(); T > sage: F, R = T.construction() > sage: F(R) is T > True > > right? > > Now the fix for the above is simple. However, a new problem arises: > > sage: R = PolynomialRing(ZZ, 'x', 500) > sage: S = PolynomialRing(GF(5), 'x', 200) > sage: R.gen(0) + S.gen(0) > > The last line takes a second or so in current SageMath, but ages (I've > interrupted after two minutes) with the change above. RunSnakeRun says > that most of the time is spent in > > method '_coerce_' of 'sage.structure.parent_old.Parent' > > This is also not what we'd like. So what should we do now? > > Input of any kind is very much appreciated. > > Daniel > -- 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.