scipy.sparse.kronsum#

scipy.sparse.kronsum(A, B, format=None)[source]#

kronecker sum of square sparse matrices A and B

Kronecker sum of two sparse matrices is a sum of two Kronecker products kron(I_n,A) + kron(B,I_m) where A has shape (m,m) and B has shape (n,n) and I_m and I_n are identity matrices of shape (m,m) and (n,n), respectively.

Parameters:
A

square matrix

B

square matrix

formatstr

format of the result (e.g. “csr”)

Returns:
kronecker sum in a sparse matrix format