08.02.2015 Views

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

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.1.1<br />

[1 0 0 0 0 1]<br />

[0 1 1 0 0 0]<br />

[0 0 0 1 0 0]<br />

[0 0 0 0 1 1]<br />

sage: A*E.transpose() == zero_matrix(GF(2), 3, 4)<br />

True<br />

Since GF(2) is a field we can route this computation to the generic code <strong>and</strong> obtain the ‘pivot’ form <strong>of</strong> the<br />

basis. The algorithm keywords, ‘pluq’, ‘default’ <strong>and</strong> unspecified, all have the same effect as there is<br />

no optional behavior.<br />

sage: A = matrix(GF(2),[[0, 1, 1, 0, 0, 0],<br />

... [1, 0, 0, 0, 1, 1,],<br />

... [1, 0, 0, 0, 1, 1]])<br />

sage: P = A.right_kernel_matrix(algorithm=’generic’, basis=’pivot’); P<br />

[0 1 1 0 0 0]<br />

[0 0 0 1 0 0]<br />

[1 0 0 0 1 0]<br />

[1 0 0 0 0 1]<br />

sage: A*P.transpose() == zero_matrix(GF(2), 3, 4)<br />

True<br />

sage: DP = A.right_kernel_matrix(algorithm=’default’, basis=’pivot’); DP<br />

[0 1 1 0 0 0]<br />

[0 0 0 1 0 0]<br />

[1 0 0 0 1 0]<br />

[1 0 0 0 0 1]<br />

sage: A*DP.transpose() == zero_matrix(GF(2), 3, 4)<br />

True<br />

sage: A.right_kernel_matrix(algorithm=’pluq’, basis=’echelon’)<br />

[1 0 0 0 0 1]<br />

[0 1 1 0 0 0]<br />

[0 0 0 1 0 0]<br />

[0 0 0 0 1 1]<br />

We test that the mod 2 code is called for matrices over GF(2).<br />

sage: A = matrix(GF(2),[[0, 1, 1, 0, 0, 0],<br />

... [1, 0, 0, 0, 1, 1,],<br />

... [1, 0, 0, 0, 1, 1]])<br />

sage: set_verbose(1)<br />

sage: A.right_kernel(algorithm=’default’)<br />

verbose ...<br />

verbose 1 () computing right kernel matrix over integers mod 2 for 3x6 matrix<br />

verbose 1 () done computing right kernel matrix over integers mod 2 for 3x6 matrix<br />

...<br />

Vector space <strong>of</strong> degree 6 <strong>and</strong> dimension 4 over Finite Field <strong>of</strong> size 2<br />

Basis matrix:<br />

[1 0 0 0 0 1]<br />

[0 1 1 0 0 0]<br />

[0 0 0 1 0 0]<br />

[0 0 0 0 1 1]<br />

sage: set_verbose(0)<br />

Over Arbitrary Fields:<br />

For kernels over fields not listed above, totally general code will compute a set <strong>of</strong> basis vectors in the pivot<br />

format. These could be returned as a basis in echelon form.<br />

244 Chapter 7. Base class for matrices, part 2

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

Saved successfully!

Ooh no, something went wrong!