linalg(deprecated)/issimilar - Help

linalg(deprecated)

 issimilar
 determine similarity of matrices

 Calling Sequence issimilar(A, B) issimilar(A, B, 'P')

Parameters

 A - square matrix B - square matrix 'P' - (optional) assigned a transformation matrix

Description

 • Important: The linalg package has been deprecated. Use the superseding command, LinearAlgebra[IsSimilar], instead.
 - For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
 • The function issimilar(A, B) returns true if A is similar to B and false otherwise.
 • If called in the form issimilar(A, B,'P'), then P will be assigned a transformation matrix such that $A=\mathrm{inverse}\left(P\right)BP$.
 • This function is part of the linalg package, and so can be used in the form issimilar(..) only after performing the command with(linalg), or with(linalg,issimilar).  This function can always be accessed in the long form linalg[issimilar](..).

Examples

Important: The linalg package has been deprecated. Use the superseding command, LinearAlgebra[IsSimilar], instead.

 > $\mathrm{with}\left(\mathrm{linalg}\right):$
 > $A≔\mathrm{matrix}\left(3,3,\left[1,2,3,4,5,6,7,8,9\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{1}& {2}& {3}\\ {4}& {5}& {6}\\ {7}& {8}& {9}\end{array}\right]$ (1)
 > $B≔\mathrm{diag}\left(\mathrm{eigenvalues}\left(A\right)\right)$
 ${B}{≔}\left[\begin{array}{ccc}{0}& {0}& {0}\\ {0}& \frac{{15}}{{2}}{+}\frac{{3}{}\sqrt{{33}}}{{2}}& {0}\\ {0}& {0}& \frac{{15}}{{2}}{-}\frac{{3}{}\sqrt{{33}}}{{2}}\end{array}\right]$ (2)
 > $\mathrm{issimilar}\left(A,B,P\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{print}\left(P\right)$
 $\left[\begin{array}{ccc}\frac{{1}}{{6}}& {-}\frac{{1}}{{3}}& \frac{{1}}{{6}}\\ {-}\frac{{5}}{{12}}{+}\frac{{7}{}\sqrt{{33}}}{{132}}& {-}\frac{{1}}{{6}}{+}\frac{\sqrt{{33}}}{{198}}& \frac{{1}}{{12}}{-}\frac{{17}{}\sqrt{{33}}}{{396}}\\ \frac{{5}}{{12}}{+}\frac{{7}{}\sqrt{{33}}}{{132}}& \frac{{1}}{{6}}{+}\frac{\sqrt{{33}}}{{198}}& {-}\frac{{1}}{{12}}{-}\frac{{17}{}\sqrt{{33}}}{{396}}\end{array}\right]$ (4)
 > $\mathrm{map}\left(\mathrm{normal},\mathrm{evalm}\left(\left({P}^{-1}&*B\right)&*P\right)\right)$
 $\left[\begin{array}{ccc}{1}& {2}& {3}\\ {4}& {5}& {6}\\ {7}& {8}& {9}\end{array}\right]$ (5)