# Equivalent matrix: changebase

### 5.47.8 Equivalent matrix: changebase

The changebase command changes a matrix to represent the same linear function in a different basis.

- changebase takes two arguments:
  - A, a matrix.
  - P, a change-of-basis matrix.
- changebase(A,P) returns the matrix P−1AP.

#### Examples.

- 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:

  ⎡
  ⎢
  ⎣

  1 | 2
  3 | 4

  ⎤
  ⎥
  ⎦

  −1

  ·

  ⎡
  ⎢
  ⎣

  1 | 1
  0 | 1

  ⎤
  ⎥
  ⎦

  ·

  ⎡
  ⎢
  ⎣

  1 | 2
  3 | 4

  ⎤
  ⎥
  ⎦

  =

  ⎡
  ⎢
  ⎢
  ⎢
  ⎢
  ⎣

  −5 | −8

  9
  2

  7

  ⎤
  ⎥
  ⎥
  ⎥
  ⎥
  ⎦