# Kronecker Product (G Dataflow)

Calculates the Kronecker product of two input matrices.  ## matrix A

The first input matrix.

This input accepts a 2D array of double-precision, floating point numbers or 2D array of complex double-precision, floating point numbers.

Default: Empty array ## matrix B

The second input matrix.

This input accepts a 2D array of double-precision, floating point numbers or 2D array of complex double-precision, floating point numbers.

Default: Empty array ## error in

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

Default: No error ## kronecker product

Matrix containing the Kronecker product of the first and second input matrices.

The number of rows in kronecker product is the product of the number of rows in the first and second input matrices. The number of columns in kronecker product is the product of the number of columns in the first and second input matrices. ## error out

Error information. The node produces this output according to standard error behavior.

## Algorithm for Calculating the Kronecker Product

If A is an n-by-m matrix and B is a k-by-l matrix, the Kronecker product of A and B, C = AB, results in a matrix C with dimensions nk-by-ml. This node calculates the Kronecker product using the following equation.

$C={\left[\begin{array}{cccc}{a}_{11}B& {a}_{12}B& \dots & {a}_{1m}B\\ {a}_{21}B& {a}_{22}B& \dots & {a}_{2m}B\\ ⋮& ⋮& \ddots & ⋮\\ {a}_{n1}B& {a}_{n2}B& \dots & {a}_{nm}B\end{array}\right]}_{nk×ml}$

For example, if

$\begin{array}{cc}A=\left[\begin{array}{cc}1& 2\\ 3& 4\end{array}\right]& B=\left[\begin{array}{cc}5& 6\\ 7& 8\end{array}\right]\end{array}$

then

$\begin{array}{ccc}{a}_{11}B=\left[\begin{array}{cc}5& 6\\ 7& 8\end{array}\right]& {a}_{12}B=\left[\begin{array}{cc}10& 12\\ 14& 16\end{array}\right]& C=\left[\begin{array}{cc}{a}_{11}B& {a}_{12}B\\ {a}_{21}B& {a}_{22}B\end{array}\right]=\left[\begin{array}{cccc}5& 6& 10& 12\\ 7& 8& 14& 16\\ 15& 18& 20& 24\\ 21& 24& 28& 32\end{array}\right]\end{array}$

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported