0
$\begingroup$

Here's a simple example of what I'm trying to get at with that mysterious title.

I start off with a Hermitian matrix that I derived analytically

M = {{a, g}, {g, b}}; M // MatrixForm

enter image description here

Then, before doing the job myself analytically, I desire to inspect this matrix in a different basis through the unitary transformation

U = (1/Sqrt[2]) {{1, 1}, {1, -1}};
M = U.M.ConjugateTranspose[U] // Simplify; M // MatrixForm

enter image description here

I have a couple quantities that are defined in terms of the variables a, b, and g

w = (a + b)/2;
d = (a - b)/2;
p = w + g;
m = w - g;

I would like to express M in terms of these definitions. Sort of reverse the flow of those equation signs above, and show the matrix in the most compact form possible. I can do a hack job as below

M = M /. {a + b -> 2 w, a - b -> 2 d};
M = M /. {2 w + 2 g -> 2 p, 2 w - 2 g -> 2 m};
M // MatrixForm

enter image description here

However in this case I have to carefully craft the replacements to work properly. And it's not practical for anything more complicated than this toy example I provided. I hope people understand what I'm getting at here and can suggest a solution. Please let me know if I should clarify.

$\endgroup$
  • 2
    $\begingroup$ Your code does not produce the posted results. M=U.M.ConjugateTranspose[M] evaluates to {{(a/Sqrt[2] + g/Sqrt[2])* Conjugate[a] + (b/Sqrt[2] + g/Sqrt[2])* Conjugate[g], (b/Sqrt[2] + g/Sqrt[2])* Conjugate[b] + (a/Sqrt[2] + g/Sqrt[2])* Conjugate[g]}, {(a/Sqrt[2] - g/Sqrt[2])* Conjugate[a] + (-(b/Sqrt[2]) + g/Sqrt[2])* Conjugate[g], (-(b/Sqrt[2]) + g/Sqrt[2])* Conjugate[b] + (a/Sqrt[2] - g/Sqrt[2])* Conjugate[g]}} I would guess that you have made use of some assumptions that you have not provided. $\endgroup$ – Bob Hanlon Sep 27 at 13:58
  • $\begingroup$ Try one first tiny step: M={{a+b+2g,a-b},{a-b,a+b-2g}};Simplify[M,{a+b==2w}] and look at the output to see if it replaced the "more complicated" a+b+2g with the "simpler" 2(g+w).You can determine "simpler" using LeafCount[expr]. Then try Simplify[M,{a+b==2w,a-b==2d,w+g==p}] This seems to usually work only if it results in an immediate "simplification". See how far this will get you in your more complicated actual problem. Perhaps you can then use other methods to get to your final goal. $\endgroup$ – Bill Sep 27 at 18:29
  • $\begingroup$ @BobHanlon Damn. Sorry. You're right. I made a real mess of that question. I have fixed it. $\endgroup$ – Tom Sep 28 at 19:30
1
$\begingroup$
Clear["Global`*"]

(M = {{a, g}, {g, b}}) // MatrixForm

enter image description here

U = (1/Sqrt[2]) {{1, 1}, {1, -1}};
(M = U.M.ConjugateTranspose[U]
    // Simplify) // MatrixForm

enter image description here

repl = Solve[{
    w == (a + b)/2, d == (a - b)/2,
    p == w + g, m == w - g},
   {a, b, g}, {w}][[1]]

(* {a -> 1/2 (2 d + m + p), b -> 1/2 (-2 d + m + p), g -> 1/2 (-m + p)} *)

(M = M /. repl // Simplify) // MatrixForm

enter image description here

$\endgroup$

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.