2
$\begingroup$

I'm trying to simplify an expression with complex coefficients. It should be very straightforward, but for some reason, I cannot get the correct answer. Please, see the code below:

Simplify[\[Gamma]0[0] == Re[(0.5852908990577314` + 1.831942535298071` I)*\[Gamma]0[
      1] + (0.25530515981369933` + 0.6158107565352037` I)*\[Gamma]0[
      3]], {Element[\[Gamma]0[1], Reals], 
  Element[\[Gamma]0[3], Reals]}]

It should return

0.585291\[Gamma]0[1] + 0.255305\[Gamma]0[3] == \[Gamma]0[0]

But returns

Re[(0.585291 + 1.83194 I) \[Gamma]0[
     1] + (0.255305 + 0.615811 I) \[Gamma]0[3]] == \[Gamma]0[0]

Can't really find my error. Thank you for your help!

$\endgroup$
0

2 Answers 2

3
$\begingroup$

Use ComplexExpand

$Version

(* "14.1.0 for Mac OS X ARM (64-bit) (July 16, 2024)" *)

Clear["Global`*"]

γ0[0] == 
  Re[(0.5852908990577314` + 1.831942535298071` I)*γ0[1] + 
      (0.25530515981369933` + 0.6158107565352037` I)*γ0[3]] // 
    ComplexExpand

(* γ0[0] == 0. + 0.585291 γ0[1] + 0.255305 γ0[3] *)

% // Rationalize

(* γ0[0] == 0.585291 γ0[1] + 0.255305 γ0[3] *)
$\endgroup$
1
  • $\begingroup$ Thank you, that worked perfectly. $\endgroup$ Commented Aug 12 at 21:26
3
$\begingroup$
eqn = γ0[0] == (0.5852908990577314` + 1.831942535298071`  I)*γ0[1] + 
               (0.25530515981369933` + 0.6158107565352037`  I)*γ0[3];

Using ReplaceAll:

Reverse[eqn /. x_Complex :> Re[x]]

0.585291 γ0[1] + 0.255305 γ0[3] == γ0[0]

$\endgroup$
1
  • 1
    $\begingroup$ Thank you, that worked perfectly. $\endgroup$ Commented Aug 12 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.