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

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

sage: import sage.matrix.benchmark as b<br />

sage: ts = b.matrix_add_ZZ(200)<br />

sage: tm = b.matrix_add_ZZ(200, system=’magma’)<br />

# optional - magma<br />

sage.matrix.benchmark.matrix_add_ZZ_2(n=200, bits=16, system=’sage’, times=50)<br />

Matrix addition over ZZ. Given an n x n matrix A <strong>and</strong> B over ZZ with r<strong>and</strong>om bits-bit entries, compute A +<br />

B.<br />

INPUT:<br />

•n - matrix dimension (default: 200)<br />

•bits - bitsize <strong>of</strong> entries<br />

•system - either ‘sage’ or ‘magma’ (default: ‘sage’)<br />

•times - number <strong>of</strong> experiments (default: 50)<br />

EXAMPLES:<br />

sage: import sage.matrix.benchmark as b<br />

sage: ts = b.matrix_add_ZZ_2(200)<br />

sage: tm = b.matrix_add_ZZ_2(200, system=’magma’)<br />

# optional - magma<br />

sage.matrix.benchmark.matrix_multiply_GF(n=100, p=16411, system=’sage’, times=3)<br />

Given an n x n matrix A over GF(p) with r<strong>and</strong>om entries, compute A * (A+1).<br />

INPUT:<br />

•n - matrix dimension (default: 100)<br />

•p - prime number (default: 16411)<br />

•system - either ‘magma’ or ‘sage’ (default: ‘sage’)<br />

•times - number <strong>of</strong> experiments (default: 3)<br />

EXAMPLES:<br />

sage: import sage.matrix.benchmark as b<br />

sage: ts = b.matrix_multiply_GF(100, p=19)<br />

sage: tm = b.matrix_multiply_GF(100, p=19, system=’magma’)<br />

# optional - magma<br />

sage.matrix.benchmark.matrix_multiply_QQ(n=100, bnd=2, system=’sage’, times=1)<br />

Given an n x n matrix A over QQ with r<strong>and</strong>om entries whose numerators <strong>and</strong> denominators are bounded by bnd,<br />

compute A * (A+1).<br />

INPUT:<br />

•n - matrix dimension (default: 300)<br />

•bnd - numerator <strong>and</strong> denominator bound (default: bnd)<br />

•system - either ‘sage’ or ‘magma’ (default: ‘sage’)<br />

•times - number <strong>of</strong> experiments (default: 1)<br />

EXAMPLES:<br />

sage: import sage.matrix.benchmark as b<br />

sage: ts = b.matrix_multiply_QQ(100)<br />

sage: tm = b.matrix_multiply_QQ(100, system=’magma’)<br />

# optional - magma<br />

417

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

Saved successfully!

Ooh no, something went wrong!