0
$\begingroup$

I have a simple question about the output of a calculation. I have written a function which is a sum of 3j-symbols and Clebsch-Gordan coefficients in which I sum over various indices.

Jsymbol[l1_, l2_, S_, L1_, L2_, J1_, J2_] := 
 3*Sum[(-1)^(ml1 + b + mL)*(2 L + 1)*Sqrt[(2 l1 + 1)*(2 l2 + 1)]*
    ThreeJSymbol[{l1, 0}, {l2, 0}, {L, 0}]*
    ThreeJSymbol[{l1, ml1}, {l2, ml2}, {L, mL}]*
    ThreeJSymbol[{1, 0}, {1, 0}, {L, 0}]*
    ThreeJSymbol[{1, b}, {1, c}, {L, mL}]*
    ClebschGordan[{1, mg1}, {1, i}, {1, b}]*
    ClebschGordan[{1, mg2}, {1, i}, {1, c}]*
    ClebschGordan[{l1, ml1}, {1, mg1}, {L1, ML1}]*
    ClebschGordan[{l2, ml2}, {1, mg2}, {L2, ML2}]*
    ClebschGordan[{S, MS}, {L1, ML1}, {J1, MJ1}]*
    ClebschGordan[{S, MS}, {L2, ML2}, {J2, MJ2}], {ml1, -l1, l1, 
    1}, {ml2, -l2, l2, 1}, {mg1, -1, 1, 1}, {mg2, -1, 1, 1}, {mL, -L, 
    L, 1}, {i, -1, 1, 1}, {b, -1, 1, 1}, {c, -1, 1, 1}, {ML1, -L1, L1,
     1}, {ML2, -L2, L2, 1}, {MS, -S, S, 1}, {MJ1, -J1, J1, 
    1}, {MJ2, -J2, J2, 1}, {L, 0, 2, 1}]

When I plug in certain numbers for the indices I get

Jsymbol[1, 1, 0, 0, 0, 0, 0]
3 (-(2/15) + 2[{-1/30, L>=1, 0 True}])

But how do I interpret this? I tried to perform the sums for the three values of L that I am interested in, $L=0,1,2$, separately, and I get $-1/3,0,-7/15$, respectively, which I can't make agree with the previous answer. What am I misunderstanding?

Thank you in advance.

$\endgroup$
2
  • 1
    $\begingroup$ Mathematica silently keeps a cache of all previous assignments to help speed things up, but this can sometimes surprise you if you do and then forget odd assignments. Because you have a 2[...] in your output it is almost certain that you previously assigned 2 to some symbol which is later being used as a function name in your calculation. Do you get the same result if you restart Mathematica and don't do any other assignments before you do the single calculation you show above? $\endgroup$ – Bill Sep 2 '20 at 17:12
  • $\begingroup$ @Bill Interesting. Now that I restarted I get something slightly different, but still in the same form. $$3(1/5+2(-1/15, L>=2, 0~True)+2(-1/30, L>=1, 0~True))$$. I am just confused by the meaning of the True in this. $\endgroup$ – Christian Sep 2 '20 at 17:37
0
$\begingroup$
Clear["Global`*"] (* clear all prior definitions *)

Jsymbol[l1_, l2_, S_, L1_, L2_, J1_, J2_] := 
 3*Sum[(-1)^(ml1 + b + mL)*(2 L + 1)*Sqrt[(2 l1 + 1)*(2 l2 + 1)]*
    ThreeJSymbol[{l1, 0}, {l2, 0}, {L, 0}]*
    ThreeJSymbol[{l1, ml1}, {l2, ml2}, {L, mL}]*
    ThreeJSymbol[{1, 0}, {1, 0}, {L, 0}]*
    ThreeJSymbol[{1, b}, {1, c}, {L, mL}]*
    ClebschGordan[{1, mg1}, {1, i}, {1, b}]*
    ClebschGordan[{1, mg2}, {1, i}, {1, c}]*
    ClebschGordan[{l1, ml1}, {1, mg1}, {L1, ML1}]*
    ClebschGordan[{l2, ml2}, {1, mg2}, {L2, ML2}]*
    ClebschGordan[{S, MS}, {L1, ML1}, {J1, MJ1}]*
    ClebschGordan[{S, MS}, {L2, ML2}, {J2, MJ2}], {ml1, -l1, l1, 
    1}, {ml2, -l2, l2, 1}, {mg1, -1, 1, 1}, {mg2, -1, 1, 1}, {mL, -L, L, 
    1}, {i, -1, 1, 1}, {b, -1, 1, 1}, {c, -1, 1, 1}, {ML1, -L1, L1, 
    1}, {ML2, -L2, L2, 1}, {MS, -S, S, 1}, {MJ1, -J1, J1, 1}, {MJ2, -J2, J2, 
    1}, {L, 0, 2, 1}]

result = Jsymbol[1, 1, 0, 0, 0, 0, 0]

enter image description here

result // InputForm

(* 3*(-2/15 + 2*Piecewise[{{-1/30, L >= 1}}, 0]) *)

The last term is a Piecewise function. The value of the Piecewise is -1/30 if L >= 1 or zero (default) otherwise. To simplify the expression use either

result // Simplify

enter image description here

or

result // PiecewiseExpand

enter image description here

The results for different values of L are

result /. {{L -> 0}, {L -> 1}, {L -> 2}}

(* {-(2/5), -(3/5), -(3/5)} *)

Assigning the values to L prior to calculating Jsymbol produces error messages and presumably erroneous results.

 Table[(L = val;
  Jsymbol[1, 1, 0, 0, 0, 0, 0]), {val, 0, 2}]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you! This helps a lot. $\endgroup$ – Christian Sep 2 '20 at 18:50

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.