# New package Combinat

**URL:** <https://discourse.julialang.org/t/new-package-combinat/80363>\
**Category:** Package Announcements\
**Created:** [May 2, 2022, 12:02pm UTC](https://discourse.julialang.org/t/new-package-combinat/80363 "2022-05-02T12:02:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean\_Michel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jean_michel/32/8282_2.png) [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Post date:** [May 2, 2022, 12:02pm UTC](https://discourse.julialang.org/t/new-package-combinat/80363/1 "2022-05-02T12:02:14Z")

</div>

This is to announce a package I just registered, [Combinat.jl](https://github.com/jmichel7/Combinat.jl).  
Here is the README

This module is a Julia port of some GAP combinatorics and basic number theory. The only dependency is the package `Primes`.

The list of functions it exports are:

Classical enumerations:

`combinations, arrangements, partitions, partition_tuples, compositions, multisets`

functions to count them without computing them:

`ncombinations, narrangements, npartitions, npartition_tuples, ncompositions, nmultisets`

some functions on partitions and permutations:

`lcm_partitions, gcd_partitions, conjugate_partition, dominates, tableaux, robinson_schensted`

counting functions:

`bell, stirling1, stirling2, catalan`

number theory

`divisors, prime_residues, primitiveroot, bernoulli`

some structural manipulations not yet in Julia:

`groupby, tally, tally_sorted, collectby, unique_sorted!`

matrix blocks:

`blocks, diagblocks`

Have a look at the individual docstrings and enjoy (any feedback is welcome).

After writing most of this module I became aware of the package `Combinatorics` which has a considerable overlap. However there are some fundamental disagreements between these two packages which makes `Combinatorics` not easily usable for me:

- often I use sorting in algorithms when `Combinatorics` use hashing. Thus the algorithms cannot be applied to the same objects (and sorting is often faster). I provide optionally a hashing variant of some algorithms.
- `Combinatorics.combinations` does not include the empty set.
- I use lower case for functions and Camel case for structs (Iterators). `Combinatorics` does not have functions for classical enumerations but only (lowercase) iterators.

Some less fundamental disagreements is disagreement on names. However I would welcome discussions with the authors of `Combinatorics` to see if both packages could be made more compatible.
