Previous Up Next

5.51.8  Equivalent matrix : changebase

changebase takes as argument a matrix A and a change-of-basis matrix P.
changebase returns the matrix B such that B=P−1AP.
Input :

changebase([[1,2],[3,4]],[[1,0],[0,1]])

Output :

[[1,2],[3,4]]

Input :

changebase([[1,1],[0,1]],[[1,2],[3,4]])

Output :

[[-5,-8],[9/2,7]]

Indeed :

⎡
⎢
⎣
12
34
⎤
⎥
⎦
−1*⎡
⎢
⎣
11
01
⎤
⎥
⎦
*⎡
⎢
⎣
12
34
⎤
⎥
⎦
=⎡
⎢
⎢
⎢
⎢
⎣
−5−8
9
2
7
⎤
⎥
⎥
⎥
⎥
⎦

.


Previous Up Next