aspcore.matrices.block_diagonal_same

aspcore.matrices.block_diagonal_same(block, num_blocks)

Creates a block diagonal matrix from a single block.

Parameters:
  • block (ndarray of shape (block_size, block_size)) – The block to be repeated.

  • num_blocks (int) – The number of times the block is repeated.

Returns:

block_diag – The block diagonal matrix.

Return type:

ndarray of shape (num_blocks * block_size, num_blocks * block_size)