Given matrices $A \in \mathbb{C}^{n_1,m_1}, B \in \mathbb{C}^{n_2,m_2}$ a naive way to computer the Kronecker product would be as such:
$M = \operatorname{zeros}(n_1n_2,m_1m_2)$ (initialize an empty array)
For $p = 1,2,\ldots n_1n_2:$
For $q = 1,2,\ldots m_1m_2:$
$M_{p,q} = A_{{\lfloor {{p}{n_1}} \rfloor},{\lfloor {{q}{m_1}} \rfloor}} B_{p \bmod n_2,\ q\bmod m_2}$
Which will have running time $O(n_1n_2m_1m_2)$.
I was wondering if there is a more efficient way to computer $M$?
Thanks!