# How to reduce the λ-matrix to Smith Standard Form

A = {{1 - λ, 2 λ - 1, λ},
{λ, λ^2, -λ}, {1 + λ^2, λ^3 + λ - 1, -λ^2}}


How to reduce the above λ-matrix to the following Smith standard form:

{{1, 0, 0}, {0, λ, 0}, {0, 0, λ^2 + λ}}

• SmithDecomposition works if lambda is numeric. – Michael E2 Jan 21 at 2:50
• The following kglr's answer solves my problem, but I don't know where to get built-in functions that are not shown in help documents like ControlPCSSmithForm. – Please Correct GrammarMistakes Jan 21 at 3:06

## 2 Answers

ControlPCSSmithForm[A, λ] // MatrixForm // TeXForm


$$\left( \begin{array}{ccc} 1 & 0 & 0 \\ 0 & \lambda & 0 \\ 0 & 0 & \lambda (\lambda +1) \\ \end{array} \right)$$

• I'd like to ask you where you get built-in functions like ControlPCSSmithForm that are not shown in the help documents – Please Correct GrammarMistakes Jan 21 at 3:04
• @Gowiththewind, I used ??**SmithForm* – kglr Jan 21 at 3:12
• @Gowiththewind actually, you'd better use \ to type  ,or the effect will not be so good. – wuyudi Jan 21 at 3:43
• @wuyudi Okay,thank you very much for your suggestion. – Please Correct GrammarMistakes Jan 21 at 6:04

The Wolfram Function Repository has a (recently added) function for this.

amat = {{1 - lam, 2 lam - 1, lam}, {lam, lam^2, -lam}, {1 + lam^2,
lam^3 + lam - 1, -lam^2}};

ResourceFunction["PolynomialSmithDecomposition"][amat]

(* Out[3320]= {{{0, -1 - lam - lam^2, 1 + lam}, {0,
1 + lam^2, -lam}, {1, -lam^2 - lam^3, -1 + lam + lam^2}}, {{1, 0,
0}, {0, lam, 0}, {0, 0, lam + lam^2}}, {{1, 1, 1 - lam}, {0, 1,
1}, {0, 0, 1}}} *)


It returns three matrices in the form {left multiplier, SNF, right multiplier}

--- edit ---

Since it came up in other responses, I'll say a bit about the relationship between this WFR function and the ControlPCS​ functions. They predate the WFR function (obviously). There is a PolynomialSmithDecomposition as well as SmithForm`. I believe the latter simply returns the middle matrix from the former (so no computation is saved).

The WFR function is a rewritten variant, and I believe in some cases it will be more efficient. I've not had a chance yet to pass this on to the developer handling the control functionality. Also there remains a question of which version is better to use in the case of polynomials with approximate coefficients. That will require some experimentation. Also it could be the case that the new one is sometimes slower, ergo, more experimentation needed. So this remains a work in progress.

--- end edit ---

• Thank you very much for the function you added in the FunctionRepository. – Please Correct GrammarMistakes Jan 22 at 0:42