scqubits.core.discretization.band_matrix#
- scqubits.core.discretization.band_matrix(band_coeffs, band_offsets, dim, dtype=None, has_corners=False)[source]#
Returns a dim x dim sparse matrix with constant diagonals of values band_coeffs[ 0], band_coeffs[1], … along the (off-)diagonals specified by the offsets band_offsets[0], band_offsets[1], … The has_corners option allows generation of band matrices with corner elements, in which lower off-diagonals wrap into the top right corner and upper off-diagonals wrap into the bottom left corner.
- Parameters:
band_coeffs (
Union
[List
[float
],List
[complex
],ndarray
]) – each element of band_coeffs is a number to be assigned as a constant to the (off-)diagonalsband_offsets (
Union
[List
[int
],ndarray
]) – offsets specifying the positions of the (off-)diagonals dim: dimension of the matrixdim (
int
) – (linear) dimension of the matrixdtype (
Optional
[Any
]) – if not specified, dtype is inferred from the dtype of band_vecshas_corners (
bool
) – if set to True, the off diagonals are wrapped into the opposing corners of the matrix
- Return type:
csc_matrix