Tag Info

New answers tagged

8

Your direct method isn't working because neither Complex nor Collect works the way you are expecting. So depending on what you mean by "elegant", the answer to your question may be no. You can jury-rig Collect to work using expr = 2 u + I + 2 + I; Expand[expr/I] /. Complex[x_, y_] -> x + i y I Collect[%, i, Simplify] /. i -> I (* 2 - 2 i - 2 i u *) ...


2

Identical multiplicands are automatically converted into powers: foo*foo*bar bar foo^2 To prevent this you either need to prevent evaluation as with HoldForm: HoldForm[foo*foo*bar] foo foo bar (* HoldForm still present but not displayed *) Or you need to define your own display method for Power which is essentially what kale proposes in a ...


0

Janis, I think the following approaches might be easier. I am going to name your expanded expression for convenience: expandedexpr = 1/2 Sqrt[3] Sqrt[(3 - mf) (5 + mf)] Ket[-(3/2), 3/2 + mf] - 1/4 Ket[-(1/2), 1/2 + mf] - 1/2 mf Ket[-(1/2), 1/2 + mf] + Sqrt[(4 - mf) (4 + mf)] Ket[1/2, -(1/2) + mf]; Easiest of all is to use Simplify on the ...



Top 50 recent answers are included