1
$\begingroup$

I'm trying to take absolute value squared of certain objects. Say I have

y=alpha

and I know that |alpha|^2 = alpha*Conjugate[alpha].

How do I take Abs[y]^2 without assigning a numerical value to alpha in mathematica?

$\endgroup$
  • $\begingroup$ Depending on the form of the output desired: Clear[alpha]; Abs[alpha]^2 // ComplexExpand[#, {alpha}] & or Abs[alpha]^2 // ComplexExpand[#, {alpha}, TargetFunctions -> Conjugate] & $\endgroup$ – Bob Hanlon Apr 8 at 23:15
5
$\begingroup$
α = αr + I*αi;
Abs[α]^2 // ComplexExpand

αi^2 + αr^2

$\endgroup$
1
$\begingroup$
y[alpha_] := Abs[alpha]^2

ComplexExpand[y[a - I*b]]

a^2 + b^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.