# Rational Jordan matrix: rat_jordan

### 5.48.4 Rational Jordan matrix: rat_jordan

The rat_jordan command finds the rational Jordan form of a matrix.

- rat_jordan takes one mandatory and one optional argument:
  - A, a square matrix (preferably with exact coefficients).
  - Optionally, var, a variable name.
- rat_jordan(A) (in all modes but Maple) returns a sequence [P,J] of two matrices, where J is the rational Jordan matrix of A (the most reduced matrix in the field of the coefficients of A or the complexified field in complex mode) and

  J=P−1AP

  The coefficients of P and J belongs to the same field as the coefficients of A. If A is diagonalizable in the field of its coefficients, then the columns of P are the eigenvectors of A.

  rat_jordan(A) (in Maple mode) only returns the matrix J.

- rat_jordan(A ⟨var⟩) returns the matrix J, as above, and assigns the matrix P to the variable var.

#### Examples.

- Input (not in Maple mode):
  rat_jordan([[1,0,0],[1,2,-1],[0,0,1]])

  ⎡
  ⎢
  ⎢
  ⎣

  0 | 1 | 0
  1 | 0 | 1
  0 | 1 | 1

  ⎤
  ⎥
  ⎥
  ⎦

  ,

  ⎡
  ⎢
  ⎢
  ⎣

  2 | 0 | 0
  0 | 1 | 0
  0 | 0 | 1

  ⎤
  ⎥
  ⎥
  ⎦

- Input:
  rat_jordan([[1,0,0],[1,2,-1],[0,0,1]],P)

  ⎡
  ⎢
  ⎢
  ⎣

  2 | 0 | 0
  0 | 1 | 0
  0 | 0 | 1

  ⎤
  ⎥
  ⎥
  ⎦

  then input:
  P
  Output:

  ⎡
  ⎢
  ⎢
  ⎣

  0 | 1 | 0
  1 | 0 | 1
  0 | 1 | 1

  ⎤
  ⎥
  ⎥
  ⎦

- Input:
  rat_jordan([[1,0,1],[0,2,-1],[1,-1,1]])
  Output:

  ⎡
  ⎢
  ⎢
  ⎣

  1 | 1 | 2
  0 | 0 | −1
  0 | 1 | 2

  ⎤
  ⎥
  ⎥
  ⎦

  ,

  ⎡
  ⎢
  ⎢
  ⎣

  0 | 0 | −1
  1 | 0 | −3
  0 | 1 | 4

  ⎤
  ⎥
  ⎥
  ⎦

- Input:
  rat_jordan([[1,0,0],[0,1,1],[1,1,-1]])
  Output:

  ⎡
  ⎢
  ⎢
  ⎣

  −1 | 0 | 0
  1 | 1 | 1
  0 | 0 | 1

  ⎤
  ⎥
  ⎥
  ⎦

  ,

  ⎡
  ⎢
  ⎢
  ⎣

  1 | 0 | 0
  0 | 0 | 2
  0 | 1 | 0

  ⎤
  ⎥
  ⎥
  ⎦

If A is symmetric and has eigenvalues with multiple orders, the matrix P returned by rat_jordan(A) will contain orthogonal eigenvectors (not always of norm equal to 1); i.e., tran(P)*P will be a diagonal matrix where the diagonal is the square norm of the eigenvectors.

#### Example.

Input:

rat_jordan([[4,1,1],[1,4,1],[1,1,4]])

Output:

⎡
⎢
⎢
⎣

1 | 2 | −1
1 | 0 | 2
1 | −2 | −1

⎤
⎥
⎥
⎦

,

⎡
⎢
⎢
⎣

6 | 0 | 0
0 | 3 | 0
0 | 0 | 3

⎤
⎥
⎥
⎦