Pocket Partition is a Python package designed for handling numerical sets and partitions.
For more detailed information, refer to the full documentation available at Read the Docs.
To install Pocket Partition, run the following command:
pip install git+https://github.com/blackgauss/pocketpartition.git
To update Pocket Partition run the following command:
pip install --upgrade git+https://github.com/blackgauss/pocketpartition.git
Here's a simple example to get you started:
from pocketpartition import NumericalSet, NumericalSemigroup, get_atom_monoid, get_partition
# Make a numerical set
T = NumericalSet(gaps=[1,2,3,9,11,15])
# Get its atom monoid
S = get_atom_monoid(T)
# Minimal Generating Set
print(S.minimal_generating_set())
# Get its partition
P = get_partition(T)
# Display Partition with hooks
P.display(show_hooks=True)
# Get help on all methods of a certain class
help(S)
This package can work alongside SageMath and the numericalsgps
package. However, there are a few important points to note:
-
Namespace Conflicts: To avoid conflicts with the
numericalsgps
package, importpocketpartition
using an alias, such aspp
or another name.import pocketpartition as pp
-
Type Conversion: SageMath uses its own
Integer()
type, which is different from Python'sint()
. You may need to convertInteger()
types toint()
before using them withpocketpartition
.n = int(Integer(5)) # Convert SageMath Integer to Python int
Q: I already have SageMath and the numericalsgps
package. Why do I need this?
A: This package is particularly useful for working with the correspondences between numerical sets, partitions, numerical semigroups, and posets.
W.I.P.
Some functions/classes inspired by
- Sagemath SageMath GitHub repository.
- Numerical Semigroups package for GAP numericalsgps GitHub repository