# Distibutive property of Conjugate

Posted 8 years ago
5270 Views
|
8 Replies
|
9 Total Likes
|
 Hi,I am trying to solve the following equation with matrices. With[{b = {{b1}, {b2}}, a = {{a1}, {a2}}, S = {{s11, s12}, {s12, s22}}}, ConjugateTranspose[S.a]. (S.a) == ConjugateTranspose[a].a // FullSimplify // PowerExpand] However, I got the following answer: {{(a1 s11 + a2 s12) Conjugate[ a1 s11 + a2 s12] + (a1 s12 + a2 s22) Conjugate[ a1 s12 + a2 s22]}} == {{Abs[a1]^2 + Abs[a2]^2}} Is there a simple way to let Mathematica apply the distributive property of Conjugate on (a1 s12 + a2 s22) provided that all four mentioned variable are complex. Shouldn't Mathematica substitute (a1 s12 + a2 s22)* with a1* s12* + a2* s22* automatically?Thanks
8 Replies
Sort By:
Posted 8 years ago
 Sorry but I am not following you and do not know what output you are after now. How about we rewind and start from the initial state again? Could you show the input and show the output you are looking for. Then one can help write the rules/commands needed to transform the input to the output.
Posted 8 years ago
 Hi,Sorry for the ambiguity.I followed your suggested method and rewrote the code as follows: With[{b = {{b1}, {b2}}, a = {{a1}, {a2}}, S1 = {{s11, s12}, {s12, s22}}}, rule1 = Conjugate[x_ + y_] :> Conjugate[x] + Conjugate[y]; rule2 = Conjugate[x_ y_] :> Conjugate[x] Conjugate[y]; myRules = {rule1, rule2}; ConjugateTranspose[S1.a]. (S1.a) == ConjugateTranspose[a].a //. myRules // Expand // TraditionalForm] So I got the following result: ({ {a1 s11 Conjugate[a1] Conjugate[s11] + a2 s12 Conjugate[a1] Conjugate[s11] + a1 s12 Conjugate[a1] Conjugate[s12] + a2 s22 Conjugate[a1] Conjugate[s12] + a1 s11 Conjugate[a2] Conjugate[s12] + a2 s12 Conjugate[a2] Conjugate[s12] + a1 s12 Conjugate[a2] Conjugate[s22] + a2 s22 Conjugate[a2] Conjugate[s22]} }) == ({ {a1 Conjugate[a1] + a2 Conjugate[a2]} }) So my question is what is the sequence of commands that results in substituting EACH and EVERY multiplication of a complex variable with its conjugate with its square absolute value (for example: a2 s12 Conjugate[a2] Conjugate[s12] should be substituted with Abs[a2]^2 Abs[s12]^2). This can usually be done by using the command FullSimplify. However, this command seems to be selective in this case and it is not substituting all the terms. Thanks
Posted 8 years ago
 Is this what you want? With[{b = {{b1}, {b2}}, a = {{a1}, {a2}}, S = {{s11, s12}, {s12, s22}}}, ConjugateTranspose[S.a].(S.a) == ConjugateTranspose[a].a // FullSimplify // PowerExpand] ComplexExpand[%] gives  {{a1^2 s11^2 + 2 a1 a2 s11 s12 + a1^2 s12^2 + a2^2 s12^2 + 2 a1 a2 s12 s22 + a2^2 s22^2}} == {{a1^2 + a2^2}} 
Posted 8 years ago
 As far as I know, ComplexExpand assumes that all variables in its argument are real and then expands it accordingly. However, in the case I am asking about, variables may be complex. So what I want is, that Mathematica substitutes (a1 s12 + a2 s22)* with a1* s12* + a2* s22*. This equation is necessary for the S-matrix. With reference to your website, I think that you're quite familiar with it, Thanks
Posted 8 years ago
 I did not read the question carefully. You could always make a rule. How about p1 = Conjugate[x_ + y_] :> Conjugate[x] + Conjugate[y]; p2 = Conjugate[x_ y_] :> Conjugate[x] Conjugate[y]; Conjugate [a1 s12 + a2 s22] /. p1 gives  Conjugate[a1 s12] + Conjugate[a2 s22] and now  % /. p2 Conjugate[a1] Conjugate[s12] + Conjugate[a2] Conjugate[s22] Of course you can collect all your rules in one list and use them in one command: p1 = Conjugate[x_ + y_] :> Conjugate[x] + Conjugate[y]; p2 = Conjugate[x_ y_] :> Conjugate[x] Conjugate[y]; myRules = {p1, p2}; Conjugate [a1 s12 + a2 s22] //. myRules gives Conjugate[a1] Conjugate[s12] + Conjugate[a2] Conjugate[s22] 
Posted 8 years ago
 Exactly. This is the answer I wanted. However this bring me to my second question. When I apply the rules you suggested in the following code: With[{b = {{b1}, {b2}}, a = {{a1}, {a2}}, S1 = {{s11, s12}, {s12, s22}}}, Rule1 = Conjugate[x_ + y_] :> Conjugate[x] + Conjugate[y]; Rule2 = Conjugate[x_ y_] :> Conjugate[x] Conjugate[y]; MyRules = {Rule1, Rule2}; ConjugateTranspose[S1.a]. (S1.a) == ConjugateTranspose[a].a //. MyRules // Expand // PowerExpand // TraditionalForm] I get the following result: ({ {a1 s11 Conjugate[a1] Conjugate[s11] + a2 s12 Conjugate[a1] Conjugate[s11] + a1 s12 Conjugate[a1] Conjugate[s12] + a2 s22 Conjugate[a1] Conjugate[s12] + a1 s11 Conjugate[a2] Conjugate[s12] + a2 s12 Conjugate[a2] Conjugate[s12] + a1 s12 Conjugate[a2] Conjugate[s22] + a2 s22 Conjugate[a2] Conjugate[s22]} }) == ({ {a1 Conjugate[a1] + a2 Conjugate[a2]} }) When I add the //FullSimpify to the original code, terms like (a1 s11 Conjugate[a1] Conjugate[s11]) are not converted automatically to (Abs[a1]^2+ Abs[s11]^2). So my question is, do I have to add another rule to make Mathematica take care of the mentioned conversion?Thanks
Posted 8 years ago
 You can have a third rule, but it needs to be applied at the end to insure it does what you want. r = With[{b = {{b1}, {b2}}, a = {{a1}, {a2}}, S1 = {{s11, s12}, {s12, s22}}}, rule1 = Conjugate[x_ + y_] :> Conjugate[x] + Conjugate[y]; rule2 = Conjugate[x_ y_] :> Conjugate[x] Conjugate[y]; myRules = {Rule1, Rule2}; ConjugateTranspose[S1.a].(S1.a) == ConjugateTranspose[a].a //. myRules // Expand // TraditionalForm] Which givesAnd now p2 = (x_)*Conjugate[x_] :> Abs[x]^2; Expand[r] //. p2 Which givesWhich I think is what you are asking for.
Posted 8 years ago
 Thanks for your reply.. Any idea, why this final answer didn't appear until this third rule was applied? It seemed logical, that this answer would result automatically without additional rules. The application of FullSimplify should have helped. right? Regards.