Skip to content

PolynomialSequence.coefficient_matrix() returns a matrix instead of a vector as second element #37027

@mantepse

Description

@mantepse

Steps To Reproduce

sage: from sage.rings.polynomial.multi_polynomial_sequence import PolynomialSequence
sage: R.<x,y> = QQ[]
sage: PolynomialSequence([x+2*y+3, 4*x, 5]).coefficient_matrix()
(
[1 2 3]  [x]
[4 0 0]  [y]
[0 0 5], [1]
)
sage: _[1].parent()
Full MatrixSpace of 3 by 1 dense matrices over Multivariate Polynomial Ring in x, y over Rational Field

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

irrelevant.

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions