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

...<br />

TypeError: unable to coerce 5 into Cyclic group <strong>of</strong> order 4 as a permutation group<br />

sage: elts[2]=’(1,3,2,4)’<br />

sage: OperationTable(H, operator.mul, elements=elts)<br />

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

...<br />

TypeError: unable to coerce (1,3,2,4) into Cyclic group <strong>of</strong> order 4 as a permutation group<br />

sage: elts[2]=’(1,2,3,4)’<br />

sage: OperationTable(H, operator.mul, elements=elts)<br />

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

...<br />

ValueError: (1,3)(2,4)*(1,2,3,4)=(1,4,3,2), <strong>and</strong> so the set is not closed<br />

Unusable functions should be recognized as such:<br />

sage: H=CyclicPermutationGroup(4)<br />

sage: OperationTable(H, operator.add)<br />

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

...<br />

TypeError: elements () <strong>and</strong> () <strong>of</strong> Cyclic group <strong>of</strong> order 4 as a permutation group are incompatible<br />

sage: from operator import xor<br />

sage: OperationTable(H, xor)<br />

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

...<br />

TypeError: elements () <strong>and</strong> () <strong>of</strong> Cyclic group <strong>of</strong> order 4 as a permutation group are incompatible<br />

TODO:<br />

Provide color <strong>and</strong> grayscale graphical representations <strong>of</strong> tables. See commented-out stubs in source code.<br />

AUTHOR:<br />

•Rob Beezer (2010-03-15)<br />

change_names(names)<br />

For an existing operation table, change the names used for the elements.<br />

INPUT:<br />

•names - the type <strong>of</strong> names used, values are:<br />

–’letters’ - lowercase ASCII letters are used for a base 26 representation <strong>of</strong> the elements’<br />

positions in the list given by list(), padded to a common width with leading ‘a’s.<br />

–’digits’ - base 10 representation <strong>of</strong> the elements’ positions in the list given by list(),<br />

padded to a common width with leading zeros.<br />

–’elements’ - the string representations <strong>of</strong> the elements themselves.<br />

–a list - a list <strong>of</strong> strings, where the length <strong>of</strong> the list equals the number <strong>of</strong> elements.<br />

OUTPUT: None. This method changes the table “in-place”, so any printed version will change <strong>and</strong> the<br />

output <strong>of</strong> the dict() will also change. So any items <strong>of</strong> interest about a particular table need to be<br />

copied/saved prior to calling this method.<br />

EXAMPLES:<br />

More examples can be found in the documentation for OperationTable since creating a new operation<br />

table uses the same routine.<br />

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

sage: D=DihedralGroup(2)<br />

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

408 Chapter 23. Operation Tables

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

Saved successfully!

Ooh no, something went wrong!