Python for education: permutations
Andrzej Kapanowski

TL;DR
This paper introduces Python classes for permutations and permutation groups, providing methods for calculation, error reporting, and group analysis, with implementations in Python modules.
Contribution
It presents new Python classes Perm and Group for permutations and groups, with comprehensive methods and error handling, based on dictionaries and cycle notation.
Findings
Perm class supports order, parity, ranking, unranking, and random permutations.
Group class offers subgroup analysis, orbits, and group properties.
Python modules perms and groups implement these classes and methods.
Abstract
Python implementation of permutations is presented. Three classes are introduced: Perm for permutations, Group for permutation groups, and PermError to report any errors for both classes. The class Perm is based on Python dictionaries and utilize cycle notation. The methods of calculation for the perm order, parity, ranking and unranking are given. A random permutation generation is also shown. The class Group is very simple and it is also based on dictionaries. It is mainly the presentation of the permutation groups interface with methods for the group order, subgroups (normalizer, centralizer, center, stabilizer), orbits, and several tests. The corresponding Python code is contained in the modules perms and groups.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsComputational Physics and Python Applications
