algebraixlib.partition module¶
Operations for partitioning sets and multisets.
-
algebraixlib.partition.
partition
(set_, class_invariant_func)[source]¶ Return
set_
partitioned according toclass_invariant_func
.Parameters: - set – The set that is to be partitioned.
- class_invariant_func –
A function from elements of
set_
toMathObject
s. It defines an equivalence relation onset_
such that\[x, y \in set\_ : x \equiv y \iff class\_invariant\_func(x) = class\_invariant\_func(y)\]
Returns: A set with structure \(P(set\_.ground\_set)\) that defines a partition on
set_
, imposed by the equivalence relation defined by the functionclass_invariant_func
.
-
algebraixlib.partition.
make_labeled_partition
(set_, class_invariant_func)[source]¶ Return a ‘labeled’ partition of
set_
, partitioned according toclass_invariant_func
.Parameters: - set – The set that is to be partitioned.
- class_invariant_func –
A function from elements of
set_
toMathObject
s. It defines an equivalence relation onset_
such that\[x, y \in set\_ : 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\_.ground\_set))\) that maps the range of
class_invariant_func
when applied toset_
to sets of elements ofset_
that belong to the given equivalence class.