1
$\begingroup$

Suppose I have a $2\times2$ matrix which contains $2\times2$ matrices as entries, is there a clean way to find the inverse of such object and compute its eigenvalues/vectors?

My code is

entry1 = {{0, 0}, {0, 0}};

entry2 = (N + L)/(2 LN)*{{1, 0}, {0, 1}} + (N - L)/(2 LN)*{{Cos[2 x], 
      Sin[2 x]}, {Sin[2 x], -Cos[2 x]}};

entry3  = rho*{{1, 0}, {0, 1}};

entry4 = {{0, 0}, {0, 0}};

M = MatrixForm[{{entry1, entry2}, {entry3, entry4}}];

Then

Det[M]

doesn't work as expected, it gives no result. Can this be done in mathematica? (Yes I know I shouln't be using these variable names)

$\endgroup$
2
  • 1
    $\begingroup$ First, you should not do M = MatrixForm[...]; followed by Det[M] since M is wrapped in MatrixForm. Second, should not use N since that means something else in Mathematica. Third, what is L and LN? do these have numerical values? Fourth: Det takes a square matrix as input. Not a matrix of matrices. So you would need to convert that to a normal 2D matrix. $\endgroup$
    – Nasser
    Jul 19, 2019 at 11:54
  • 2
    $\begingroup$ Use ArrayFlatten[{{entry1, entry2}, {entry3, entry4}}], then Det will compute the result. $\endgroup$
    – Alx
    Jul 19, 2019 at 11:56

1 Answer 1

4
$\begingroup$

Try

entry1 = {{0, 0}, {0, 0}};

entry2 = (n + L)/(2 LN)*{{1, 0}, {0, 1}} + (n - L)/(2 LN)*{{Cos[2 x], 
      Sin[2 x]}, {Sin[2 x], -Cos[2 x]}};

entry3 = rho*{{1, 0}, {0, 1}};

entry4 = {{0, 0}, {0, 0}};
(M = ArrayFlatten[{{entry1, entry2}, {entry3, entry4}}]) // MatrixForm
Det[M]

Mathematica graphics

$\endgroup$

Your Answer

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

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