6
$\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$
1
  • $\begingroup$ Check out KroneckerProduct $\endgroup$
    – chuy
    Commented Jun 25, 2019 at 14:41

1 Answer 1

11
$\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$
1
  • $\begingroup$ thank you,it is exactly what i wanted! $\endgroup$ Commented Jun 25, 2019 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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