Closed mantepse closed 7 months ago
I am not sure how to deprecate this properly. The current behaviour is likely worked around in a lot of user code, so deprecation is certainly necessary.
I think we should not change this because then operations like below will not work
sage: sage: from sage.rings.polynomial.multi_polynomial_sequence import PolynomialSequence
....: sage: R.<x,y> = QQ[]
....: sage: B = PolynomialSequence([x+2*y+3, 4*x, 5]).coefficient_matrix()
sage: B[0]*B[1]
[x + 2*y + 3]
[ 4*x]
[ 5]
If we return a vector it will not give us the same answer as above.
Of course not - it will return a vector, which makes more sense I think, and also follows the documentation:
sage: from sage.rings.polynomial.multi_polynomial_sequence import PolynomialSequence
sage: R.<x,y> = QQ[]
sage: m, v = PolynomialSequence([x+2*y+3, 4*x, 5]).coefficient_matrix()
sage: m
[1 2 3]
[4 0 0]
[0 0 5]
sage: v
[x]
[y]
[1]
sage: vector(v)
(x, y, 1)
sage: m*vector(v)
(x + 2*y + 3, 4*x, 5)
Ya, you are right. This makes more sense !
Steps To Reproduce
Expected Behavior
The second element should be a vector - it is the vector of monomials appearing in the sequence.
Actual Behavior
It returns a 1-column matrix.
Additional Information
The problem is that iterating over a vector gives the elements, whereas iterating over a 1-column matrix gives vectors.
Environment
Checklist