# Smith-McMillan Form of a polynomial matrix

sage: s = var('s')
sage: G = matrix([[1,-1],[s^2+s-4,2*s^2-s-8],[s^2-4, 2*s^2-8]])


G is a symbolic matrix, each entry of which is a polynomial of variable s.

# How can we calculate the Smith McMillan Form of the matrix G?

NOTE: G.smith_form() doesn't work.

edit retag close merge delete

Sort by » oldest newest most voted

You should avoid symbolic expressions as possible and work with genuine polynomials instead:

sage: R.<s> = PolynomialRing(QQ) ; R
Univariate Polynomial Ring in s over Rational Field
sage: G = matrix([[1,-1],[s^2+s-4,2*s^2-s-8],[s^2-4, 2*s^2-8]])
sage: G.parent()
Full MatrixSpace of 3 by 2 dense matrices over Univariate Polynomial Ring in s over Rational Field
sage: G.smith_form()
(
[         1          0]  [           1            0            0]
[         0 3*s^2 - 12]  [-s^2 - s + 4            1            0]
[         0          0], [           s           -1            1],

[1 1]
[0 1]
)

more

Thanks! I haven't taken a math course like "computer algebra" or "abstract algebra". Can I extend the smith_form() to "basic ring := Complex Field", i.e., R. = PolynomialRing(CC), G = the same expression, G.smith_form() (it doesn't work)... ERROR: NotImplementedError: Smith form over non-exact rings not implemented at present

As explained in the error message, you need to use an exact ring, not a numerical ring, probably because of uncontrolled roundings in such a case. What you can do is to use QQbar, the field of (complex) algebraic numbers. It is exact and quite huge.

Thanks a lot! I should read a lecture book about basic computer/abstract algebra.