3
$\begingroup$

I have a long expression involving different complex numbers. I want to force Mathematica to replace z Conjugate[z] by Abs[z]^2 without using polar coordinates in the whole expression. For example,

z w Conjugate[z] Conjugate[w] + Conjugate[z] w + z^2 

should just be 'simplified' to

Abs[z]^2 Abs[w]^2 + Conjugate[z] w + z^2
$\endgroup$
5
$\begingroup$

One way is to use a repeatedly applied rule

z w Conjugate[z] Conjugate[w] + Conjugate[z] w + z^2 //. a_ Conjugate[a_] :> Abs[a]^2
z^2 + Abs[w]^2 Abs[z]^2 + w Conjugate[z]
$\endgroup$
0
$\begingroup$

The FullSimplify function knows how to do that:

FullSimplify[z Conjugate[z]]
 Abs[z]^2
$\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.