Subset(subset, superset) is SymPy's Subset: a subset of an ordered
superset, with its ranks in binary, lexicographic and Gray code order. The
fields $subset, $superset, $size, $superset_size, $cardinality,
$rank_binary, $rank_lexicographic and $rank_gray mirror SymPy's. The
subset_next_*(), subset_prev_*() and subset_iterate_*() functions
step through the subsets in each order; subset_unrank_binary() and
subset_unrank_gray() build the subset of a rank, subset_from_bitlist()
and bitlist_from_subset() convert to and from bit strings, and
subset_indices() gives the positions of a subset in a superset.
ksubsets(superset, k) lists the subsets of size k.
Usage
Subset(subset, superset)
subset_iterate_binary(a, k)
subset_next_binary(a)
subset_prev_binary(a)
subset_next_lexicographic(a)
subset_prev_lexicographic(a)
subset_iterate_graycode(a, k)
subset_next_gray(a)
subset_prev_gray(a)
subset_from_bitlist(super_set, bitlist)
bitlist_from_subset(subset, superset)
subset_unrank_binary(rank, superset)
subset_unrank_gray(rank, superset)
subset_indices(subset, superset)
ksubsets(superset, k)