5
$\begingroup$

I have my matrix $h$ of size $2N\times 2N$ in this form

$$h=\begin{pmatrix} a & b \\ c & d \end{pmatrix} $$ where $a,b,c,d$ are smaller matrices which i don't know. Is there any simple way to get this matrix? $$\begin{pmatrix} a &0& b&0 \\ 0 &a& 0&b\\ c &0& d&0 \\ 0 &c& 0&d\\ \end{pmatrix} $$

$\endgroup$
  • $\begingroup$ Check out KroneckerProduct $\endgroup$ – chuy Jun 25 at 14:41
10
$\begingroup$
MatrixForm[h = {{a, b}, {c, d}}]

$ h=\left( \begin{array}{cc} a & b \\ c & d \\ \end{array} \right)$

KroneckerProduct[h, IdentityMatrix@2] // MatrixForm

$ \left( \begin{array}{cccc} a & 0 & b & 0 \\ 0 & a & 0 & b \\ c & 0 & d & 0 \\ 0 & c & 0 & d \\ \end{array} \right)$

$\endgroup$
  • $\begingroup$ thank you,it is exactly what i wanted! $\endgroup$ – Alexander Nikolaenko Jun 25 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.