# Permuta

Ragnar, Arnar, Christian, Unnar, Émile, Jay, Tomas and Henning

Permuta is a Python library for working with permutations and patterns.

If you need support, you can join us in our Discord support server.

The newest release of Permuta is always on PyPI. For the developmental version there is a GitHub repository.

After installing Permuta with

```
pip install permuta
```

you can define and work with permutation classes

```
>>> from permuta import *
>>> basis = [Perm((1, 0, 2)), Perm((1, 2, 0))]
>>> basis
[Perm((1, 0, 2)), Perm((1, 2, 0))]
>>> perm_class = Av(basis)
>>> perm_class
Av((Perm((1, 0, 2)), Perm((1, 2, 0))))
```

You can ask whether a perm belongs to the perm class:

```
>>> Perm((3, 2, 1, 0)) in perm_class
True
>>> Perm((0, 2, 1, 3)) in perm_class
False
```

Permuta includes the BiSC algorithm, which can conjecture a set of mesh patterns describing a set of permutations. The easiest way to use it is to pass a True/False property of permutations into it

```
>>> from permuta.bisc import *
>>> from permuta.bisc.permsets.perm_properties import West_2_stack_sortable
>>> auto_bisc(West_2_stack_sortable)
!!! Found a basis with 2 patts of length at most 4
!!! for the input using perms of length 6
| | | |
-+-+-●-+-
| | | |
-+-●-+-+-
| | | |
-●-+-+-+-
| | | |
-+-+-+-●-
| | | |
|▒| | |
-+-+-●-+-
| | | |
-●-+-+-+-
| | | |
-+-●-+-+-
| | | |
-+-+-+-●-
| | | |
```

There is a full readme at PyPi.