{"id":45754,"library":"permutation","title":"Permutation","description":"Library for generating and manipulating permutations of finitely many positive integers. Current version 0.5.0, updated occasionally.","status":"active","version":"0.5.0","language":"python","source_language":"en","source_url":"https://github.com/borisbarbour/permutation","tags":["permutations","combinatorics","group-theory"],"install":[{"cmd":"pip install permutation","lang":"bash","label":"Default install"}],"dependencies":[],"imports":[{"wrong":"from permutation import Perm","symbol":"Permutation","correct":"from permutation import Permutation"}],"quickstart":{"code":"from permutation import Perm\np = Perm(2, 3, 1)\nprint(p)           # (2 3 1)\nprint(list(p))     # [2, 3, 1]\nprint(len(p))      # 3\nq = Perm(1, 3)(2, 4)\nprint(q)           # (1 3)(2 4)\nprint(p * q)       # composition\nprint(~p)          # inverse","lang":"python","description":"Create and manipulate permutations using Perm class. Perm accepts values 1..n in order of images."},"warnings":[{"fix":"Use Perm(2,3,1) to get the permutation mapping 1→2, 2→3, 3→1. For cycles use Perm(1,3) to denote transposition (1 3).","message":"Perm constructor expects a list of images for 1..n, not cycle notation. For cycles use separate Perm objects and multiply.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure all inputs are positive integers starting from 1.","message":"Perm objects are 1-indexed. The domain is positive integers from 1 to n. Do not include 0.","severity":"gotcha","affected_versions":"all"},{"fix":"Be consistent with notation. In many textbooks permutations are applied right-to-left; this library uses left-to-right.","message":"Multiplication order: p * q means apply q first, then p (left-to-right convention).","severity":"gotcha","affected_versions":"all"},{"fix":"For combinatorial algorithms with many permutations, consider specialized libraries.","message":"The library provides limited support for large degrees; performance may degrade with large n.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.5.0':15 'combinator':19 'current':13 'finit':9 'generat':4 'group':21 'group-theori':20 'integ':12 'librari':2 'mani':10 'manipul':6 'occasion':17 'permut':1,7,18 'posit':11 'theori':22 'updat':16 'version':14","created_at":"2026-06-07T12:56:33.463260+00:00","updated_at":"2026-06-07T12:56:33.463260+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}