I am looking for an algorithm that decomposes a $2^n$ square matrix into a Kronecker product $\otimes$ of $n$ number of $2 \times 2$ matrices. Does anyone know if there is an implementation out there (in python) or, there are general strategies to build such an algorithm?
Approximate decomposition is fine for me too.