algebraixlib.partition module¶
Operations for partitioning sets and multisets.
-
algebraixlib.partition.
partition
(set_or_mset, class_invariant_func)[source]¶ Return
set_or_mset
partitioned according toclass_invariant_func
.Parameters: - set_or_mset – The set or multiset that is to be partitioned.
- class_invariant_func –
A function from elements of
set_or_mset
toMathObject
s. It defines an equivalence relation onset_or_mset
such that\[x, y \in set\_or\_mset : x \equiv y \iff class\_invariant\_func(x) = class\_invariant\_func(y)\]
Returns: A set with structure \(P(set\_or\_mset.ground\_set)\) that defines a partition on
set_or_mset
, imposed by the equivalence relation defined by the functionclass_invariant_func
.
-
algebraixlib.partition.
make_labeled_partition
(set_or_mset, class_invariant_func)[source]¶ Return a ‘labeled’ partition of
set_or_mset
, partitioned according toclass_invariant_func
.Parameters: - set_or_mset – The set or multiset that is to be partitioned.
- class_invariant_func –
A function from elements of
set_or_mset
toMathObject
s. It defines an equivalence relation onset_or_mset
such that\[x, y \in set\_or\_mset : x \equiv y \iff class\_invariant\_func(x) = class\_invariant\_func(y)\]
Returns: A function with structure \(P(range(class\_invariant\_func) \times P(set\_or\_mset.ground\_set))\) that maps the range of
class_invariant_func
when applied toset_or_mset
to sets of elements ofset_or_mset
that belong to the given equivalence class.