1
$\begingroup$

I need to solve a matrix equation such as $A=S^{-1}A~S$ for a given matrix A. Suppose that the matrices are $3*3$ and A is diagonal.

A = {{1, 0, 0}, {0, -1/2 + I Sqrt[3]/2, 0}, {0, 0, -1/2 - I Sqrt[3]/2}};
S[a_, b_, c_, d_, e_, f_, g_, h_, k_] := {{a, b, c}, {d, e, f}, {g, h, k}};

Solve[A == Inverse[S] . A . S, {a, b, c, d, e, f, g, h, k}] // MatrixForm
$\endgroup$
3
  • 1
    $\begingroup$ You write S[a_....] then call it using just S. So need to correct this. But Mathematica finds only trivial solution !Mathematica graphics $\endgroup$
    – Nasser
    Feb 6 at 10:49
  • $\begingroup$ Thank you so much, I changed the command as you said and It works. $\endgroup$
    – Arian
    Feb 6 at 11:07
  • 1
    $\begingroup$ FindInstance[A . S == S . A, S ∈ Matrices[Dimensions[A], Reals], 20] for 20 random solutions. $\endgroup$
    – flinty
    Feb 6 at 11:26

1 Answer 1

2
$\begingroup$

Any diagonal matrix with non-zero entries will solve:

a = {{1, 0, 0}, {0, -1/2 + I  Sqrt[3]/2, 0}, {0, 
    0, -1/2 - I  Sqrt[3]/2}};
m = Array[s, {3, 3}];
ans = m /. Solve[m . a == a . m, Flatten[m]][[1]];
ans // MatrixForm
test = ans /. {s[1, 1] -> 1, s[2, 2] -> 2, s[3, 3] -> 3};
Inverse[test] . a . test === a

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks, Yeah I got the same answer. $\endgroup$
    – Arian
    Feb 7 at 10:40

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.