permute.py

ExPermute

This is a class for permutation group.
Create element with 'cyclic' way.

(考1,考2,...,考k)

(This is one-to-one mapping,考1->考2,考2->考3,..,考(k-1)->考k,考k->考1)
See Permute.

Initialize
Initialize with dimension and list of 'cyclic' tuple.

>>>ep=ExPermute(dimension,[cyclic tuple,..])
 

Example

>>>a=ExPermute(5,[(1,2,3),(4,5)])

(This means multiplication of permutation, [2,3,1,4,5]*[1,2,3,5,4].)

Operation

==Equality
*Multiplication
/Division
**Powering

Methods

inverse()

Return inverse(-1 powering).

>>>a.inverse()
[(4,5),(3,2,1)](5)

identity()

Return identity element(unit) of permutation group.

>>>a.identity()
[](5)

grouporder()

Return group order(Cardinality) of permutation group.

>>>a.grouporder()
120

order()

Return order.
GroupElement method faster with large dimension.

>>>a.order()
6

ToNormal()

Return the Permute element.

>>>a.ToNormal()
[2,3,1,5,4]

simplify()

Return the more simple cyclic element.

>>>a*a
[(1,2,3),(4,5),(1,2,3),(4,5)](5)
>>>(a*a).simplify()
[(1,3,2)](5)

Last-modified: 2006-02-15 (踹) 13:32:05