sisl_toolbox.btd.PermuteBTD

class sisl_toolbox.btd.PermuteBTD

Bases: object

Permutation table and block sizes of a block-tridiagonal matrix

Parameters:
  • permute (ndarray) – the permutation table, permute[new] = old. If blocks is not passed, this should be a sequence of the permutation indices for each block (e.g. np.split(permute, np.cumsum(blocks)[:-1])), the permutation table is then their concatenation, and the block sizes are their lengths.

  • blocks (Optional[np.ndarray]) – the block sizes, blocks.sum() == len(permute)

Examples

The two forms are equivalent:

>>> PermuteBTD([2, 0, 1, 3], [1, 3])
>>> PermuteBTD([[2], [0, 1, 3]])

Attributes

blocks

blocks: np.ndarray | None = None
permute: np.ndarray