LinearAlgebra - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Linear Algebra : LinearAlgebra Package : Queries : LinearAlgebra/IsSimilar

LinearAlgebra

  

IsSimilar

  

determine if two Matrices are similar

 

Calling Sequence

Parameters

Description

Examples

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

with(LinearAlgebra):

IsSimilar( <<2,0>|<I,-2>>, <<1,I>|<0,-1>> );

false

(1)

A := DiagonalMatrix([5,12,13]);

A50001200013

(2)

B := <<5,0,0>|<3,12,0>|<4,-4,13>>;

B534012−40013

(3)

(q, P) := IsSimilar(A, B, output=['query', 'C']);

q,Ptrue,1−11073400−1

(4)

A = P^(-1) . B . P;

50001200013=50001200013

(5)

A:=Matrix([[-1,0,0],[0,-sqrt(2)/2,-sqrt(2)/2],[0,-sqrt(2)/2,sqrt(2)/2]]);

A−1000222202222

(6)

B:=Matrix([[1,0,0],[0,-1,0],[0,0,-1]]);

B1000−1000−1

(7)

eval(Normalizer);

procoptionbuiltin&equals;normal&comma;remember&comma;system&semi;end proc

(8)

LinearAlgebra:-IsSimilar(A,B);

false

(9)

Normalizer := radnormal;

Normalizerradnormal

(10)

LinearAlgebra:-IsSimilar(A,B);

true

(11)

See Also

LinearAlgebra[Eigenvalues]

LinearAlgebra[SmithForm]

Matrix

Normalizer

type[float]