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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<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.2gen(n)Return the n-th generator <strong>of</strong> this matrix space.This doesn’t compute all basis matrices, so it is reasonably intelligent.EXAMPLES:sage: M = Mat(GF(7),10000,5); M.ngens()50000sage: a = M.10sage: a[:4][0 0 0 0 0][0 0 0 0 0][1 0 0 0 0][0 0 0 0 0]get_action_impl(S, op, self_on_left)x.__init__(...) initializes x; see help(type(x)) for signatureidentity_matrix()Returns the identity matrix in self.self must be a space <strong>of</strong> square matrices. The returned matrix is immutable. Please use copy if you wanta modified copy.EXAMPLES:sage: MS1 = MatrixSpace(ZZ,4)sage: MS2 = MatrixSpace(QQ,3,4)sage: I = MS1.identity_matrix()sage: I[1 0 0 0][0 1 0 0][0 0 1 0][0 0 0 1]sage: Er = MS2.identity_matrix()Traceback (most recent call last):...TypeError: self must be a space <strong>of</strong> square matricesTESTS:sage: MS1.one()[1,2] = 3Traceback (most recent call last):...ValueError: matrix is immutable; please change a copy instead (i.e., use copy(M) to change ais_dense()Returns True if matrices in self are dense <strong>and</strong> False otherwise.EXAMPLES:sage: Mat(RDF,2,3).is_sparse()Falsesage: Mat(RR,123456,22,sparse=True).is_sparse()Trueis_finite()EXAMPLES:sage: MatrixSpace(GF(101), 10000).is_finite()True7

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

Saved successfully!

Ooh no, something went wrong!