This is a class for permutation group.
Initialize
Initialize with key.
>>>pg=ExPermute(key)
Example
>>>Pg=PermGroup(5) >>>Pgk=PermGroup(['a','b','c','d','e'])
== | Equality |
len | Grouporder |
Create new element in self.key permutation group.
>>>Pg.createElement([3,4,5,1,2]) [1, 2, 3, 4, 5] -> [3, 4, 5, 1, 2] >>>Pg.createElement([(1,2),(3,4)]) [(1, 2), (3, 4)] <[1, 2, 3, 4, 5]>
Return permutation group identity as normal type.
>>>Pg.identity() [1, 2, 3, 4, 5] -> [1, 2, 3, 4, 5]
Return permutation group identity as cyclic type.
>>>Pg.identity_c() [] <[1, 2, 3, 4, 5]>
Compute permutation group order.
>>>Pg.grouporder() 120L
Create random new element as normal type in self.key permutation group.
>>>Pg.randElement() [1, 2, 3, 4, 5] -> [3, 4, 5, 2, 1] >>>Pg.randElement() [1, 2, 3, 4, 5] -> [3, 4, 1, 2, 5]