7

How do I complex conjugate a vector?

E^(-((I β)/2)) p (Cos[α/2] (Cos[θ]^2 + Sin[θ]^2 Sin[ϕ] (-I Cos[ϕ] + Sin[ϕ]))
+ E^(I β)Sin[α/2] (Cos[θ]^2 + Sin[θ]^2 Sin[ϕ] (I Cos[ϕ] + Sin[ϕ])))

I tried doing Assuming[β ∈ Reals, c[[1]]^*, but that didn't work :\ ... I just want i's flipped, but I'm getting this:

enter image description here


Attempt at using ComplexExpand as suggested my LLiaMnYP. Still doesn't look as compact as c[[1]] if I just change all the i's by hand :(

enter image description here

rhermans
  • 36,518
  • 4
  • 57
  • 149
Raksha
  • 633
  • 1
  • 6
  • 19
  • You are getting this as there is no way for Mathematica to know, that all other variables are real. Check out the documentation for ComplexExpand IIRC. – LLlAMnYP Mar 17 '15 at 23:30
  • tried it... see pic above... naturally, Mathematica decided to expand exponentials and rearrange everything %\ and cc* product has changed to a really long string compared to what it was when I just changed i's manually – Raksha Mar 17 '15 at 23:39
  • Is p a factor or a function? – Mahdi Mar 17 '15 at 23:43
  • 1
    p is a factor here – Raksha Mar 17 '15 at 23:44

3 Answers3

14

Is this what you wanted?

expr = E^(-((I β)/2)) p (Cos[α/2] (Cos[θ]^2 + Sin[θ]^2 Sin[ϕ] (-I Cos[ϕ] + Sin[ϕ])) + 
    E^(I β) Sin[α/2] (Cos[θ]^2 + Sin[θ]^2 Sin[ϕ] (I Cos[ϕ] + Sin[ϕ])))

Mathematica graphics

expr /. Complex[x_, y_] :> Complex[x, -y]

Mathematica graphics

LCarvalho
  • 9,233
  • 4
  • 40
  • 96
Nasser
  • 143,286
  • 11
  • 154
  • 359
  • YES! Thank you! Tho it also returned "Complex::argr: Complex called with 1 argument; 2 arguments are expected." for some reason. – Raksha Mar 17 '15 at 23:56
  • @Solarmew please try it now. – Nasser Mar 18 '15 at 00:00
  • Perfect :] Thanks so much! – Raksha Mar 18 '15 at 00:25
  • 1
    Cool trick. This does literally "flip the i's", as OP requested. Just be warned, if you have I represented as Sqrt[-1] anywhere, this will probably not work. – LLlAMnYP Mar 18 '15 at 00:44
  • @LLlAMnYP you are not supposed to use Sqrt[-1] for I in Mathematica :) but I just checked and M converts Sqrt[-1] to Complex[0,1] so it is ok. – Nasser Mar 18 '15 at 00:56
  • 1
    Agreed, I was too lazy to extend to more elaborate constructs such as Sqrt[-a] (where a may be positive, but not have a value assigned to it and remain in symbolic form) and a large class of functions, although elementary, but for which the relation Conjufate[f[x]]==f[Conjugate[x]] does not hold. Of course, OP's expression does happen to be one of those where you just need to flip the Is, I just wanted to point out, that your trick may not work in some cases even if all variables are real. – LLlAMnYP Mar 18 '15 at 01:31
  • Following up on LLIAMnYP's comment, here is a more general method for taking the conjugate assuming all the symbols are real: Refine[Conjugate[expr], _Symbol ∈ Reals]. For an exhaustive discussion, see here. – Jess Riedel Sep 27 '17 at 19:09
4

You might use:

  FullSimplify@ComplexExpand@Conjugate[(* expression *)]

in your case, it returns:

$$ e^{\frac{i \beta }{2}} p \left(\sin \left(\frac{\alpha }{2}\right) e^{-i (\beta -\phi )} \left(\cos ^2(\theta ) \cos (\phi )-i \sin (\phi )\right)+\cos \left(\frac{\alpha }{2}\right) \left(\cos ^2(\theta )+\sin ^2(\theta ) \sin (\phi ) (\sin (\phi )+i \cos (\phi ))\right)\right) $$

Mahdi
  • 1,619
  • 10
  • 23
  • Mine still returned the same expression as in the first picture, but without Conjugate[ ] around beta. (how did you input such pretty text so fast?) I also typed {beta, p, alpha, theta, phi} instead of just beta. That got p outside of Conjugate[ ] but left all the trig functions in. Tried including trig function, but that also didn't do anything. – Raksha Mar 17 '15 at 23:43
  • 1
    @Solarmew such "pretty text" is input using $\LaTeX$. See a basic help page and an extended tutorial about what MathJax supports. – Ruslan Mar 18 '15 at 04:45
3

You can also do

Refine[Conjugate@c[[1]],
       Assumptions->(\[Alpha] | \[Beta] | \[Phi]) \[Element] Reals]

This also works in cases when you have additional manifestly complex variables in your expression (ComplexExpand assumes that all variables are real). Of course in that case you would not add those in your Assumptions. For example:

Refine[Conjugate[a b], Assumptions -> a \[Element] Reals]
(*
==> a Conjugate[b]
*)
celtschk
  • 19,133
  • 1
  • 51
  • 106