Blocks helpers

This page contains the documentation for various helper functions for manipulating blocks.

This page contains the documentation for the blocks subpackage, that contains helper functions for the Blocks class.

blocks.underlying_partition(x: Blocks) list[list[int]]

Return the underlying partition of a Blocks object. The underlying partition of a Blocks object x is the partition of a subset \(P\) of \(\{-n, \ldots, -1\}\cup \{1, \ldots, n\}\) such that:

  • \(\{|y|\mid y\in P\} = \{1, \ldots, n\}\);

  • a block of the partition consists of negative numbers if and only if the corresponding block of x is a transverse block.

Parameters:

x (Blocks) – the Blocks object.

Returns:

The underlying partition of the parameter x.

Return type:

list[list[int]]

Complexity:

\(O(n)\) where \(n\) is the x.degree().