@@ -16,8 +16,10 @@ permuta
16
16
:alt: Travis
17
17
:target: https://travis-ci.org/PermutaTriangle/Permuta
18
18
.. image :: https://requires.io/github/PermutaTriangle/Permuta/requirements.svg?branch=master
19
- :target: https://requires.io/github/PermutaTriangle/Permuta/requirements/?branch=master
20
- :alt: Requirements Status
19
+ :target: https://requires.io/github/PermutaTriangle/Permuta/requirements/?branch=master
20
+ :alt: Requirements Status
21
+ .. image :: https://zenodo.org/badge/DOI/10.5281/zenodo.4725759.svg
22
+ :target: https://doi.org/10.5281/zenodo.4725759
21
23
22
24
Permuta is a Python library for working with perms (short for permutations),
23
25
patterns, and mesh patterns.
@@ -235,6 +237,22 @@ and a class (no class will use the set of all permutations).
235
237
[14 ] Longest increasing subsequence
236
238
[15 ] Longest decreasing subsequence
237
239
[16 ] Depth
240
+ [17 ] Number of bounces
241
+ [18 ] Maximum drop size
242
+ [19 ] Number of primes in the column sums
243
+ [20 ] Holeyness of a permutation
244
+ [21 ] Number of stack- sorts needed
245
+ [22 ] Number of pop- stack- sorts needed
246
+ [23 ] Number of pinnacles
247
+ [24 ] Number of cyclic peaks
248
+ [25 ] Number of cyclic valleys
249
+ [26 ] Number of double excedance
250
+ [27 ] Number of double drops
251
+ [28 ] Number of foremaxima
252
+ [29 ] Number of afterminima
253
+ [30 ] Number of aftermaxima
254
+ [31 ] Number of foreminima
255
+
238
256
>> > depth = PermutationStatistic.get_by_index(16 )
239
257
>> > depth.distribution_for_length(5 )
240
258
[1 , 4 , 12 , 24 , 35 , 24 , 20 ]
@@ -251,6 +269,8 @@ Given a bijection as a dictionary, we can check which statistics are preserved w
251
269
... print (stat)
252
270
Number of peaks
253
271
Number of valleys
272
+ Holeyness of a permutation
273
+ Number of pinnacles
254
274
255
275
We can find all (predefined) statistics equally distributed over two permutation
256
276
classes with ``equally_distributed ``. We also support checks for joint distribution
@@ -272,6 +292,7 @@ of jointly distributed stats with ``jointly_transformed_equally_distributed``.
272
292
Number of right- to- left maximas
273
293
Longest increasing subsequence
274
294
Longest decreasing subsequence
295
+ Number of pinnacles
275
296
276
297
The BiSC algorithm
277
298
==================
@@ -287,20 +308,19 @@ To use the algorithm we first need to import it.
287
308
>> > from permuta.bisc import *
288
309
289
310
A classic example of a set of permutations described by pattern avoidance are
290
- the permutations sortable in one pass through a stack. We start by loading a
291
- function ``stack_sortable `` which returns ``True `` for permutations that
292
- satisfy this property. The user now has two choices: Run
293
- ``auto_bisc(stack_sortable) `` and let the algorithm run without any more user
294
- input. It will try to use sensible values, starting by learning small patterns
295
- from small permutations, and only considering longer patterns when that fails.
296
- If the user wants to have more control over what happens that is also possible
297
- and we now walk through that: We input the property into `` bisc `` and ask it to
298
- search for patterns of length 3.
311
+ the permutations sortable in one pass through a stack. We use the function
312
+ ``stack_sortable `` which returns ``True `` for permutations that satisfy this
313
+ property. The user now has two choices: Run
314
+ ``auto_bisc(Perm. stack_sortable) `` and let the algorithm run
315
+ without any more user input. It will try to use sensible values, starting by
316
+ learning small patterns from small permutations, and only considering longer
317
+ patterns when that fails. If the user wants to have more control over what
318
+ happens that is also possible and we now walk through that: We input the
319
+ property into `` bisc `` and ask it to search for patterns of length 3.
299
320
300
321
.. code-block :: python
301
322
302
- >> > from permuta.bisc.perm_properties import stack_sortable
303
- >> > bisc(stack_sortable, 3 )
323
+ >> > bisc(Perm.stack_sortable, 3 )
304
324
I will use permutations up to length 7
305
325
{3 : {Perm((1 , 2 , 0 )): [set ()]}}
306
326
@@ -315,7 +335,7 @@ be considered.
315
335
316
336
.. code-block :: python
317
337
318
- >> > SG = bisc(stack_sortable, 3 , 5 )
338
+ >> > SG = bisc(Perm. stack_sortable, 3 , 5 )
319
339
>> > show_me(SG )
320
340
There are 1 underlying classical patterns of length 3
321
341
There are 1 different shadings on 120
@@ -341,8 +361,7 @@ patterns, such as the West-2-stack-sortable permutations
341
361
342
362
.. code-block :: python
343
363
344
- >> > from permuta.bisc.perm_properties import west_2_stack_sortable
345
- >> > SG = bisc(west_2_stack_sortable, 5 , 7 )
364
+ >> > SG = bisc(Perm.west_2_stack_sortable, 5 , 7 )
346
365
>> > show_me(SG )
347
366
There are 2 underlying classical patterns of length 4
348
367
There are 1 different shadings on 1230
@@ -394,7 +413,7 @@ which keeps them separated by length.
394
413
395
414
.. code-block :: python
396
415
397
- >> > A, B = create_bisc_input(7 , west_2_stack_sortable)
416
+ >> > A, B = create_bisc_input(7 , Perm. west_2_stack_sortable)
398
417
399
418
This creates two dictionaries with keys 1, 2, ..., 7 such that ``A[i] `` points
400
419
to the list of permutations of length ``i `` that are West-2-stack-sortable, and
@@ -476,3 +495,13 @@ License
476
495
#######
477
496
478
497
BSD-3: see the `LICENSE <https://github.com/PermutaTriangle/Permuta/blob/master/LICENSE >`_ file.
498
+
499
+ Citing
500
+ ######
501
+
502
+ If you found this library helpful with your research and would like to cite us,
503
+ you can use the following `BibTeX `_ or go to `Zenodo `_ for alternative formats.
504
+
505
+ .. _BibTex : https://zenodo.org/record/4725759/export/hx#.YImTibX7SUk
506
+
507
+ .. _Zenodo : https://doi.org/10.5281/zenodo.4725759
0 commit comments