IsSimilar - Maple Help

LinearAlgebra

 IsSimilar
 determine if two Matrices are similar

 Calling Sequence IsSimilar(A, B, out, options)

Parameters

 A - square Matrix B - square Matrix out - (optional) equation of the form output = obj where obj is one of 'query' or 'C', or a list containing one or more of these names; selects result objects to compute options - (optional); constructor options for the transformation Matrix 'C'

Description

 • The IsSimilar(A, B) function returns true if A and B are similar.
 Two Matrices, A and B, are said to be similar if there exists an invertible Matrix C such that $C·A=B·C$.
 Floating-point entries in either of the Matrices are converted to rationals before proceeding.
 • If out is included in the calling sequence, then only those objects specified are returned, as an expression sequence.  The returned objects may be the Boolean response to the query and/or the similarity transformation Matrix C.  If both objects are requested, they are returned in the order specified in the output list.
 If A and B are not similar and the Matrix C is requested, then the returned Matrix C is not a similarity transformation Matrix for A and B and the query, if requested, returns false.
 • The options option provides additional information (readonly, shape, storage, order, datatype, and attributes) to the Matrix constructor that builds the result. These options may also be provided in the form outputoptions['C']=[...], where [...] represents a Maple list.  If a constructor option is provided in both the calling sequence directly and in an outputoptions['C'] option, the latter takes precedence (regardless of the order).
 • Assignment to Normalizer of a stronger normalization routine can provide better zero recognition during this calculation than is provided by the default normal routine. Such an assignment to Normalizer or Testzero may be necessary for input which is not of type ratpoly.

Examples

 > $\mathrm{with}\left(\mathrm{LinearAlgebra}\right):$
 > $\mathrm{IsSimilar}\left(⟨⟨2,0⟩|⟨I,-2⟩⟩,⟨⟨1,I⟩|⟨0,-1⟩⟩\right)$
 ${\mathrm{false}}$ (1)
 > $A≔\mathrm{DiagonalMatrix}\left(\left[5,12,13\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{5}& {0}& {0}\\ {0}& {12}& {0}\\ {0}& {0}& {13}\end{array}\right]$ (2)
 > $B≔⟨⟨5,0,0⟩|⟨3,12,0⟩|⟨4,-4,13⟩⟩$
 ${B}{≔}\left[\begin{array}{ccc}{5}& {3}& {4}\\ {0}& {12}& {-4}\\ {0}& {0}& {13}\end{array}\right]$ (3)
 > $q,P≔\mathrm{IsSimilar}\left(A,B,\mathrm{output}=\left['\mathrm{query}','C'\right]\right)$
 ${q}{,}{P}{≔}{\mathrm{true}}{,}\left[\begin{array}{ccc}{1}& {-1}& {1}\\ {0}& {-}\frac{{7}}{{3}}& {4}\\ {0}& {0}& {-1}\end{array}\right]$ (4)
 > $A={P}^{-1}·B·P$
 $\left[\begin{array}{ccc}{5}& {0}& {0}\\ {0}& {12}& {0}\\ {0}& {0}& {13}\end{array}\right]{=}\left[\begin{array}{ccc}{5}& {0}& {0}\\ {0}& {12}& {0}\\ {0}& {0}& {13}\end{array}\right]$ (5)
 > $A≔\mathrm{Matrix}\left(\left[\left[-1,0,0\right],\left[0,-\frac{\mathrm{sqrt}\left(2\right)}{2},-\frac{\mathrm{sqrt}\left(2\right)}{2}\right],\left[0,-\frac{\mathrm{sqrt}\left(2\right)}{2},\frac{\mathrm{sqrt}\left(2\right)}{2}\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{-1}& {0}& {0}\\ {0}& {-}\frac{\sqrt{{2}}}{{2}}& {-}\frac{\sqrt{{2}}}{{2}}\\ {0}& {-}\frac{\sqrt{{2}}}{{2}}& \frac{\sqrt{{2}}}{{2}}\end{array}\right]$ (6)
 > $B≔\mathrm{Matrix}\left(\left[\left[1,0,0\right],\left[0,-1,0\right],\left[0,0,-1\right]\right]\right)$
 ${B}{≔}\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {-1}& {0}\\ {0}& {0}& {-1}\end{array}\right]$ (7)
 > $\mathrm{eval}\left(\mathrm{Normalizer}\right)$
 ${\mathbf{proc}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{builtin}}{=}{\mathrm{normal}}{,}{\mathrm{remember}}{,}{\mathrm{system}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (8)
 > $\mathrm{LinearAlgebra}:-\mathrm{IsSimilar}\left(A,B\right)$
 ${\mathrm{false}}$ (9)
 > $\mathrm{Normalizer}≔\mathrm{radnormal}$
 ${\mathrm{Normalizer}}{≔}{\mathrm{radnormal}}$ (10)
 > $\mathrm{LinearAlgebra}:-\mathrm{IsSimilar}\left(A,B\right)$
 ${\mathrm{true}}$ (11)