downfold_partition

sisl_toolbox.btd.downfold_partition(csr, elecs, device=None, buffer=None, cost='speed', refine=True)

Downfolding regions of the electrodes, their permutation tables and BTD blocks

The downfolding region of an electrode is the connected sub-graph of csr containing the electrode rows, which is disconnected from the device region (it stops at the device rows). The last block are the rows of the device region that couples to the downfolding region, i.e. where the downfolded self-energy lives. An electrode may be partially in the device region, then only its rows outside the device region are downfolded, and its rows in the device region are part of the last block. The downfolding region is ordered by a bandwidth reduction starting from the electrode, the device rows are placed last.

All indices are rows of csr, i.e. use the atomic sparse pattern (H.toSparseAtom()) with atomic indices, or H with orbital indices.

Parameters:
  • csr (SparseCSR | _SparseGeometry) – the sparse matrix of the full system, columns may extend into supercells. For a sparse geometry object (e.g. Hamiltonian) its sparse pattern is used.

  • elecs (Sequence[TypeAliasForwardRef('~numpy.typing.ArrayLike')]) – rows of each electrode

  • device (TypeAliasForwardRef('~numpy.typing.ArrayLike') | None) – rows of the device region. Electrodes whose rows are all in the device region are not downfolded, electrodes partially in the device region are partially downfolded. Defaults to all rows not in the electrodes nor in buffer.

  • buffer (TypeAliasForwardRef('~numpy.typing.ArrayLike') | None) – rows that are removed from the calculation

  • cost ({"speed", "memory", "speed-diagonal"}) – the cost model of the block-tridiagonal matrix, see btd_blocks

  • refine (bool) – refine the permutation tables, see reduce_bandwidth

Returns:

for each electrode, a PermuteBTD with the rows of the downfolding region (including the electrode and device rows), or None for electrodes in the device region.

Return type:

list

Raises:

ValueError – if a downfolding region couples to the buffer or other (downfolded) electrode rows.