scipy 1.8.0 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
kron(A, B, format=None)

Parameters

A : sparse or dense matrix

first matrix of the product

B : sparse or dense matrix

second matrix of the product

format : str, optional

format of the result (e.g. "csr")

Returns

kronecker product in a sparse matrix format

kronecker product of sparse matrices A and B

Examples

>>> from scipy import sparse
... A = sparse.csr_matrix(np.array([[0, 2], [5, 0]]))
... B = sparse.csr_matrix(np.array([[1, 2], [3, 4]]))
... sparse.kron(A, B).toarray() array([[ 0, 0, 2, 4], [ 0, 0, 6, 8], [ 5, 10, 0, 0], [15, 20, 0, 0]])
>>> sparse.kron(A, [[1, 2], [3, 4]]).toarray()
array([[ 0,  0,  2,  4],
       [ 0,  0,  6,  8],
       [ 5, 10,  0,  0],
       [15, 20,  0,  0]])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.sparse._construct.kron

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/sparse/_construct.py#277
type: <class 'function'>
Commit: