btd_partition
- sisl_toolbox.btd.btd_partition(csr, method='gps', cost='speed', refine=True, dense=None, **kwargs)
Permutation table and block sizes of the block-tridiagonal matrix of minimal cost
The permutation table reduces the bandwidth of csr (see
reduce_bandwidth), and the permuted matrix is partitioned into the block-tridiagonal matrix that minimizes the cost model, seebtd_blocks. The indices within each block are sorted, which improves memory access when assembling and post-processing the blocks.- Parameters:
csr (SparseCSR | _SparseGeometry) – the sparse matrix, columns may extend into supercells. For a sparse geometry object (e.g.
Hamiltonian) its sparse pattern is used. The rows are the nodes of the partitioning, i.e. use the atomic sparse pattern (H.toSparseAtom()) to partition atoms, andHto partition orbitals.method (str) – the bandwidth reduction method, see
reduce_bandwidthcost (
{"speed", "memory", "speed-diagonal"}) – the cost model of the block-tridiagonal matrix, seebtd_blocksrefine (bool) – refine the permutation table, see
reduce_bandwidthdense (Sequence[TypeAliasForwardRef('~numpy.typing.ArrayLike')] | None) – rows of csr that are fully coupled, one array per dense block. E.g. the nodes (atoms or orbitals) of an electrode self-energy. The dense blocks are added to the graph, so each dense block is guaranteed to span at most 2 neighboring blocks.
**kwargs – passed to the routine of method
- Returns:
PermuteBTD
- Return type:
holding both the block-sizesandthe permutation table.