12.07.2015 Views

Sage Reference Manual: Matrices and Spaces of Matrices

Sage Reference Manual: Matrices and Spaces of Matrices

Sage Reference Manual: Matrices and Spaces of Matrices

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Sage</strong> <strong>Reference</strong> <strong>Manual</strong>: <strong>Matrices</strong> <strong>and</strong> <strong>Spaces</strong> <strong>of</strong> <strong>Matrices</strong>, Release 6.2Truesage: S=B.right_eigenmatrix()[1]; S_inverse=S.inverse(); S_inverse*B*S # r<strong>and</strong>om[ 6 0 0 0 0 0][ 0 -12 0 0 0 0][ 0 0 -12 0 0 0][ 0 0 0 4 0 0][ 0 0 0 0 4 0][ 0 0 0 0 0 4]TESTS:Eigenvalues must all be integers.sage: r<strong>and</strong>om_matrix(QQ,3,algorithm=’diagonalizable’, eigenvalues=[2+I,2-I,2],dimensions=[1,1,1])Traceback (most recent call last):...TypeError: eigenvalues must be integers.Diagonal matrices must be square.sage: r<strong>and</strong>om_matrix(QQ, 5, 7, algorithm=’diagonalizable’, eigenvalues=[-5,2,-3], dimensions=[1,1Traceback (most recent call last):...TypeError: a diagonalizable matrix must be square.A list <strong>of</strong> eigenvalues must be accompanied with a list <strong>of</strong> dimensions.sage: r<strong>and</strong>om_matrix(QQ,10,algorithm=’diagonalizable’,eigenvalues=[4,8])Traceback (most recent call last):...ValueError: the list <strong>of</strong> eigenvalues must have a list <strong>of</strong> dimensions corresponding to each eigenvaA list <strong>of</strong> dimensions must be accompanied with a list <strong>of</strong> eigenvalues.sage: r<strong>and</strong>om_matrix(QQ, 10,algorithm=’diagonalizable’,dimensions=[2,2,4,2])Traceback (most recent call last):...ValueError: the list <strong>of</strong> dimensions must have a list <strong>of</strong> corresponding eigenvalues.The sum <strong>of</strong> the eigenvalue dimensions must equal the size <strong>of</strong> the matrix.sage: r<strong>and</strong>om_matrix(QQ,12,algorithm=’diagonalizable’,eigenvalues=[4,2,6,-1],dimensions=[2,3,5,1]Traceback (most recent call last):...ValueError: the size <strong>of</strong> the matrix must equal the sum <strong>of</strong> the dimensions.Each eigenspace dimension must be at least 1.sage: r<strong>and</strong>om_matrix(QQ,9,algorithm=’diagonalizable’,eigenvalues=[-15,22,8,-4,90,12],dimensions=[Traceback (most recent call last):...ValueError: eigenspaces must have a dimension <strong>of</strong> at least 1.Each eigenvalue must have a corresponding eigenspace dimension.sage: r<strong>and</strong>om_matrix(QQ,12,algorithm=’diagonalizable’,eigenvalues=[4,2,6,-1],dimensions=[4,3,5])Traceback (most recent call last):...ValueError: each eigenvalue must have a corresponding dimension <strong>and</strong> each dimension a correspondiEach dimension must have an eigenvalue paired to it.43

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!