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 />

c| c a b<br />

sage: T._latex_()<br />

’{\\setlength{\\arraycolsep}{2ex}\n\\begin{array}{r|*{3}{r}}\n\\multicolumn{1}{c|}{\\times}&<br />

TESTS:<br />

sage: from sage.matrix.operation_table import OperationTable<br />

sage: G=AlternatingGroup(3)<br />

sage: T=OperationTable(G, operator.mul)<br />

sage: T.set_print_symbols(’@’, 5)<br />

Traceback (most recent call last):<br />

...<br />

ValueError: LaTeX symbol must be a string, not 5<br />

sage: T.set_print_symbols(’@x@’, ’\\times’)<br />

Traceback (most recent call last):<br />

...<br />

ValueError: ASCII symbol should be a single character, not @x@<br />

sage: T.set_print_symbols(5, ’\\times’)<br />

Traceback (most recent call last):<br />

...<br />

ValueError: ASCII symbol should be a single character, not 5<br />

table()<br />

Returns the table as a list <strong>of</strong> lists, using integers to reference the elements.<br />

OUTPUT: The rows <strong>of</strong> the table, as a list <strong>of</strong> rows, each row being a list <strong>of</strong> integer entries. The integers<br />

correspond to the order <strong>of</strong> the elements in the headings <strong>of</strong> the table <strong>and</strong> the order <strong>of</strong> the output <strong>of</strong> the<br />

list() method.<br />

EXAMPLE:<br />

sage: from sage.matrix.operation_table import OperationTable<br />

sage: C=CyclicPermutationGroup(3)<br />

sage: T=OperationTable(C, operator.mul)<br />

sage: T.table()<br />

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

translation()<br />

Returns a dictionary associating names with elements.<br />

OUTPUT: A dictionary whose keys are strings used as names for entries <strong>of</strong> the table <strong>and</strong> values that are<br />

the actual elements <strong>of</strong> the algebraic structure.<br />

EXAMPLES:<br />

sage: from sage.matrix.operation_table import OperationTable<br />

sage: G=AlternatingGroup(3)<br />

sage: T=OperationTable(G, operator.mul, names=[’p’,’q’,’r’])<br />

sage: sorted(T.translation().items())<br />

[(’p’, ()), (’q’, (1,2,3)), (’r’, (1,3,2))]<br />

411

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

Saved successfully!

Ooh no, something went wrong!