polynomial coefficients -- sparse=True default -- why?

47 views
Skip to first unread message

John Cremona

unread,
Oct 19, 2022, 12:34:59 PM10/19/22
to SAGE devel
Does anyone ever use pol.coefficients() and not
pol.coefficients(sparse=False)? I mean, why is the default option
sparse=True? There must be very few occasions for the default,and I
get tired of typing sparse=False.... I do know that pol.list() is the
same as pol.coefficients(sparse=False).

I would be happy to propose changing the default, with an appropriate
depreciation warning for the usual period.

John

David Ayotte

unread,
Oct 19, 2022, 4:06:33 PM10/19/22
to sage-devel
I agree with this suggestion. Whenever I am looking for the coefficients of a polynomial, I also use the option "sparse=False" as this gives me indirect information about the degree of each associated monomial. In fact, I remember being a bit confused when I first used this method.

Best,

David A.

Dima Pasechnik

unread,
Oct 19, 2022, 4:10:13 PM10/19/22
to sage-devel
Could it be it's the same default for univariate and multivariate cases? In the latter case, it's easier to blow off memory usage to store zeros...

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/aafed6b4-fd16-4aa1-a7df-a63526470eeen%40googlegroups.com.

David Ayotte

unread,
Oct 19, 2022, 4:15:33 PM10/19/22
to sage-devel
>  Could it be it's the same default for univariate and multivariate cases? In the latter case, it's easier to blow off memory usage to store zeros...

You are right. In fact, the multivariate coefficients method does not even have a "sparse" option.

John Cremona

unread,
Oct 19, 2022, 4:18:56 PM10/19/22
to sage-...@googlegroups.com
My suggestion was only for univariate polynomials. I am certainly not
proposing this for multivariate polynomials. I still cannot think of
a use case for the current default for univariate polynomials. (And,
more than one person has complained to me about this "very annoying
and incomprehensible" behaviour.)

John
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAAWYfq0NEvr7fOr7Q16VQG0BnKeWCZZf%2BDND%3DXagk9ChOOEWFw%40mail.gmail.com.

Nils Bruin

unread,
Oct 19, 2022, 4:39:17 PM10/19/22
to sage-devel
Isn't that to make the interface between univariate and multivariate polynomials compatible? Changing the default may break code that can currently work with univariate and multivariate polynomial rings interchangeably.

John H Palmieri

unread,
Oct 19, 2022, 4:49:26 PM10/19/22
to sage-devel
See https://trac.sagemath.org/ticket/33813 for a somewhat related issue, by the way.
Reply all
Reply to author
Forward
0 new messages