Running FullSimplify
I get
FullSimplify[z Conjugate[z] + 2 Abs[z]^2]
3 z Conjugate[z]
This is actually more simple than 3 Abs[z]^2
in the eyes of FullSimplify
. See here for more info.
Simplify`SimplifyCount[3 z Conjugate[z]]
5
Simplify`SimplifyCount[3 Abs[z]^2]
6
Luckily there are many ways to guide FullSimplify
. Here is one such way.
FullSimplify[z Conjugate[z] + 2 Abs[z]^2, ExcludedForms -> {_Abs}]
3 Abs[z]^2
Edit
A more general way is to use a combination of ComplexityFunction
and TransformationFunctions
. Basically we'll assign a penalty whenever the unwanted pattern is present and teach FullSimplify
the rule we want to use.
ToAbs[a_. z_ Conjugate[z_]] := a Abs[z]^2
ToAbs[e_] := e
FullSimplify[a1 Conjugate[a1] + a1 Conjugate[a1] + b1 Conjugate[b1],
ComplexityFunction -> (LeafCount[#] + 100 Count[#, _Conjugate, ∞] &),
TransformationFunctions -> {ToAbs, Automatic}
]
2 Abs[a1]^2 + Abs[b1]^2
ComplexExpand
is intended for this sort of transformation. But it is a bit dull in this case and benefits from postprocessing bySimplify
.Simplify[ComplexExpand[z*Conjugate[z], z, TargetFunctions->{Abs,Arg}]]
gives the desired result. $\endgroup$