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.

CHAPTER<br />

TWENTYTHREE<br />

OPERATION TABLES<br />

This module implements general operation tables, which are very matrix-like.<br />

class sage.matrix.operation_table.OperationTable(S, operation, names=’letters’, elements=None)<br />

Bases: sage.structure.sage_object.<strong>Sage</strong>Object<br />

An object that represents a binary operation as a table.<br />

Primarily this object is used to provide a multiplication_table() for objects in the category <strong>of</strong> magmas<br />

(monoids, groups, ...) <strong>and</strong> addition_table() for objects in the category <strong>of</strong> commutative additive magmas<br />

(additive monoids, groups, ...).<br />

INPUT:<br />

•S - a finite algebraic structure (or finite iterable)<br />

•operation - a function <strong>of</strong> two variables that accepts pairs <strong>of</strong> elements from S. A natural source<br />

<strong>of</strong> such functions is the Python operator module, <strong>and</strong> in particular operator.add() <strong>and</strong><br />

operator.mul(). This may also be a function defined with lambda or def.<br />

•names - (default: ’letters’) 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’ positions<br />

in the list given by column_keys(), 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 column_keys(),<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 />

•elements - (default: None) A list <strong>of</strong> elements <strong>of</strong> S, in forms that can be coerced into the structure,<br />

eg. their string representations. This may be used to impose an alternate ordering on the elements <strong>of</strong> S‘,<br />

perhaps when this is used in the context <strong>of</strong> a particular structure. The default is to use whatever ordering<br />

the S.list() method returns. elements‘ can also be a subset which is closed under the operation, useful<br />

perhaps when the set is infinite.<br />

OUTPUT: An object with methods that abstracts multiplication tables, addition tables, Cayley tables, etc. It<br />

should be general enough to be useful for any finite algebraic structure whose elements can be combined with<br />

a binary operation. This is not necessarily meant be constructed directly, but instead should be useful for<br />

constructing operation tables <strong>of</strong> various algebraic structures that have binary operations.<br />

EXAMPLES:<br />

In it’s most basic use, the table needs a structure <strong>and</strong> an operation:<br />

403

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

Saved successfully!

Ooh no, something went wrong!