sisl_toolbox.btd.BlockMatrix

class sisl_toolbox.btd.BlockMatrix

Bases: object

Container class that holds a block matrix.

A block matrix will always be a square matrix.

Methods

asformat(format)

Convert to a particular format

copy()

Create a copy of this block matrix

diagonal()

Returns the diagonal of the matrix

toarray()

Convert to a dense matrix, where non-defined blocks will be zero

tobd()

Return only the block diagonal part of the matrix

tobtd()

Return only the block tridiagonal part of the matrix

Attributes

block_indexer

Get the indexer for this block matrix

blocks

Size of the blocks that define this block-matrix

dtype

Retrieve the data-type of the first element of the matrix dictionary

shape

asformat(format)[source]

Convert to a particular format

copy()[source]

Create a copy of this block matrix

Return type:

Self

diagonal()[source]

Returns the diagonal of the matrix

Return type:

ndarray

toarray()[source]

Convert to a dense matrix, where non-defined blocks will be zero

Return type:

ndarray

tobd()[source]

Return only the block diagonal part of the matrix

Return type:

BlockMatrix

tobtd()[source]

Return only the block tridiagonal part of the matrix

Return type:

BlockMatrix

property block_indexer: BlockMatrixIndexer

Get the indexer for this block matrix

The indexer allows manipulating the matrix using indices of the blocks, rather than indices of the matrix elements.

property blocks: ndarray

Size of the blocks that define this block-matrix

property dtype

Retrieve the data-type of the first element of the matrix dictionary

property shape: tuple