7.1.3.3 Matrix_dense_rational Objects

class Matrix_dense_rational
The Matrix_dense_rational class derives from Matrix, and defines functionality for dense matrices over the field $ \mathbf{Q}$ of rational numbers.
Matrix_dense_rational( parent, [entries=True], [coerce_entries=True], [copy=0])

Instances of class Matrix_dense_rational have the following methods (in addition to inherited methods and special methods):

charpoly,$  $ echelon_form,$  $ hessenberg_form,$  $ iterates,$  $ list,$  $ minpoly,$  $ transpose2

Further documentation:

charpoly( [bound=None])

Return the characteristic polynomial of this matrix, computed using the standard multimodular Hessenberg algorithm.

The multimodular algorithm works by first computing a bound B, then computing the characteristic polynomial (using Hessenberg form) modulo enough primes so that their product is bigger than B. One then uses the Chinese Remainder Theorem to recover the characteristic polynomial. If the optional bound is specified, that bound is used for B instead of a potentially much worse general bound.

echelon_form( [height_guess=True], [include_zero_rows=None])

Return the echelon form of this matrix over the rational numbers, computed using a multi-modular algorithm.

sage: A = MatrixSpace(RationalField(),3)(range(9))
sage: A.echelon_form()
[ 1  0 -1]
[ 0  1  2]
[ 0  0  0]

hessenberg_form( )

Return the Hessenberg form of this matrix.

iterates( v, n)

Let A be this matrix. Return a matrix with rows

$\displaystyle v, v*A, v*A^2, ..., v*A^(n-1).
$

Instances of class Matrix_dense_rational also have the following special methods:

__getitem__,$  $ __mul__,$  $ __setitem__,$  $ _entries

Further documentation:

__getitem__( ij)

Use A[i,j] to obtain the the $ (i,j)$ th entry of $ A$ , and A[i] to obtain the $ i$ -th row of $ A$ .

__setitem__( ij, x)

Use A[i,j]=x to set the $ (i,j)$ th entry of $ A$ to $ x$ , and A[i]=v to set the $ i$ th row of $ A$ to the entries of $ v$ .

See About this document... for information on suggesting changes.