# Calculating power series of quantum operators on kets

I am using the "Quantum" add-on package to perform some quantum mechanical calculations using SU(1,1) generators. The code that I've developed reads

 Needs["QuantumNotation"]
SetQuantumAliases[];

Clear[J];
SetQuantumObject[J];
SetQuantumScalar[a, b];
Subscript[J, a_]\[CenterDot]Subscript[J, 0] := Subscript[J, a];
Subscript[J, 0]\[CenterDot]Subscript[J, b_] := Subscript[J, b];
(Subscript[J, a_])^2 := Subscript[J, 0];
Subscript[J, a_]\[CenterDot]Subscript[J, b_] :=
KroneckerDelta[a, b] + I *\!$$\*UnderoverscriptBox[\(\[Sum]$$, $$c$$, $$3$$]$$Signature[{a, b, c}]* \*SubscriptBox[\(J$$, $$c$$]\)\);
\!$$\* TagBox[ SubscriptBox[ RowBox[{"[[", TagBox[ RowBox[{ SubscriptBox["J", "a_"], ",", SubscriptBox["J", "b_"]}], QuantumNotationzz080KetArgs, Editable->True, Selectable->True], "]]"}], "-"], QuantumNotationzz050Commutator, Editable->False, Selectable->False]$$ := I *\!$$\*UnderoverscriptBox[\(\[Sum]$$, $$c$$, $$3$$]$$Signature[{a, b, c}]* \*SubscriptBox[\(J$$, $$c$$]\)\);

\!$$\* TagBox[ SubscriptBox[ RowBox[{"[[", TagBox[ RowBox[{ SubscriptBox["J", "0"], ",", SubscriptBox["J", "+"]}], QuantumNotationzz080KetArgs, Editable->True, Selectable->True], "]]"}], "-"], QuantumNotationzz050Commutator, Editable->False, Selectable->False]$$ = SubPlus[J];
\!$$\* TagBox[ SubscriptBox[ RowBox[{"[[", TagBox[ RowBox[{ SubscriptBox["J", "0"], ",", SubscriptBox["J", "-"]}], QuantumNotationzz080KetArgs, Editable->True, Selectable->True], "]]"}], "-"], QuantumNotationzz050Commutator, Editable->False, Selectable->False]$$ = SubMinus[J];
\!$$\* TagBox[ SubscriptBox[ RowBox[{"[[", TagBox[ RowBox[{ SubscriptBox["J", "+"], ",", SubscriptBox["J", "-"]}], QuantumNotationzz080KetArgs, Editable->True, Selectable->True], "]]"}], "-"], QuantumNotationzz050Commutator, Editable->False, Selectable->False]$$ = 2*Subscript[J, 0];

DefineOperatorOnKets[Subscript[J, 0], {\!$$\* TagBox[ RowBox[{"\[VerticalSeparator]", TagBox[ RowBox[{ SubscriptBox["j_", OverscriptBox["h", "^"]], ",", SubscriptBox["n_", OverscriptBox["l", "^"]]}], QuantumNotationzz080KetArgs, BaseStyle->{ShowSyntaxStyles -> True}, Editable->True, Selectable->True], "\[RightAngleBracket]"}], QuantumNotationzz080Ket, BaseStyle->{ShowSyntaxStyles -> False}, Editable->False, Selectable->False]$$ :> n \!$$\* TagBox[ RowBox[{"\[VerticalSeparator]", TagBox[ RowBox[{ SubscriptBox["j", OverscriptBox["h", "^"]], ",", SubscriptBox[ RowBox[{"(", "n", ")"}], OverscriptBox["l", "^"]]}], QuantumNotationzz080KetArgs, BaseStyle->{ShowSyntaxStyles -> True}, Editable->True, Selectable->True], "\[RightAngleBracket]"}], QuantumNotationzz080Ket, BaseStyle->{ShowSyntaxStyles -> False}, Editable->False, Selectable->False]$$}]
DefineOperatorOnKets[SubPlus[J], {\!$$\* TagBox[ RowBox[{"\[VerticalSeparator]", TagBox[ RowBox[{ SubscriptBox["j_", OverscriptBox["h", "^"]], ",", SubscriptBox["n_", OverscriptBox["l", "^"]]}], QuantumNotationzz080KetArgs, BaseStyle->{ShowSyntaxStyles -> True}, Editable->True, Selectable->True], "\[RightAngleBracket]"}], QuantumNotationzz080Ket, BaseStyle->{ShowSyntaxStyles -> False}, Editable->False, Selectable->False]$$ :> Sqrt[(n + 1) (j - n)] \!$$\* TagBox[ RowBox[{"\[VerticalSeparator]", TagBox[ RowBox[{ SubscriptBox["j", OverscriptBox["h", "^"]], ",", SubscriptBox[ RowBox[{"(", RowBox[{"n", "+", "1"}], ")"}], OverscriptBox["l", "^"]]}], QuantumNotationzz080KetArgs, BaseStyle->{ShowSyntaxStyles -> True}, Editable->True, Selectable->True], "\[RightAngleBracket]"}], QuantumNotationzz080Ket, BaseStyle->{ShowSyntaxStyles -> False}, Editable->False, Selectable->False]$$}]
DefineOperatorOnKets[SubMinus[J], {\!$$\* TagBox[ RowBox[{"\[VerticalSeparator]", TagBox[ RowBox[{ SubscriptBox["j_", OverscriptBox["h", "^"]], ",", SubscriptBox["n_", OverscriptBox["l", "^"]]}], QuantumNotationzz080KetArgs, BaseStyle->{ShowSyntaxStyles -> True}, Editable->True, Selectable->True], "\[RightAngleBracket]"}], QuantumNotationzz080Ket, BaseStyle->{ShowSyntaxStyles -> False}, Editable->False, Selectable->False]$$ :> Sqrt[n (j - n + 1)] \!$$\* TagBox[ RowBox[{"\[VerticalSeparator]", TagBox[ RowBox[{ SubscriptBox["j", OverscriptBox["h", "^"]], ",", SubscriptBox[ RowBox[{"(", RowBox[{"n", "-", "1"}], ")"}], OverscriptBox["l", "^"]]}], QuantumNotationzz080KetArgs, BaseStyle->{ShowSyntaxStyles -> True}, Editable->True, Selectable->True], "\[RightAngleBracket]"}], QuantumNotationzz080Ket, BaseStyle->{ShowSyntaxStyles -> False}, Editable->False, Selectable->False]$$}]


I have also attached a screenshot of my code for better readability

Having this script, I tried to evaluate $$\exp[a J_{+} - bJ_{-}] | j, 0 \rangle$$. Following the documentation on the power series of operators in here and using the following script, I expanded the exponential to some order, say 2.

expande =
Normal[
Series[
Exp[(a*SubPlus[J] - b*SubMinus[J])], {SubPlus[J], 0,
2}, {SubMinus[J], 0, 2}]];
opt = expande // ExpandAll
opt\[CenterDot]\!$$\* TagBox[ RowBox[{"\[VerticalSeparator]", TagBox[ RowBox[{ SubscriptBox["j", OverscriptBox["h", "^"]], ",", SubscriptBox["0", OverscriptBox["l", "^"]]}], QuantumNotationzz080KetArgs, BaseStyle->{ShowSyntaxStyles -> True}, Editable->True, Selectable->True], "\[RightAngleBracket]"}], QuantumNotationzz080Ket, BaseStyle->{ShowSyntaxStyles -> False}, Editable->False, Selectable->False]$$ // Simplify


The outcome reads As it is evident from the screenshot, the action of some operators, such as $$J_{-}J_{+} | j, 0 \rangle$$, are not evaluated. Do you have any suggestions on how to fix this issue?

• I didn't use this package. But from your output I guess Jplus and Jminus are not treated as quantum object correctly. You see the quantum objects are connected by CenterDot instead of Times while Jplus and Jminus are not. I guess the reason is that Subscript[J,-] is interpreted as SubMinus[J] automatically. Could you try by changing Jplus and Jminus to e.g. J_p and J_m? Aug 5 at 16:34
• Does this change give the correct result? Instead of (Subscript[J, a_])^2 := Subscript[J, 0] define Subscript[J, a_]\[CenterDot]Subscript[J, a_] := Subscript[J, 0] . With this change, the result is $\frac{1}{4} \left(a^2 J_+^2+2 a J_++2\right) \left(b^2 J_-^2-2 b J_-+2\right) \left|j_{\hat{h}},0_{\hat{l}}\right\rangle$ Aug 5 at 19:43
• @lilyric This suggestion is not compatible with the notation. This is because a and b are not operators and thus, CenterDot should not be used. Aug 5 at 19:51
• @LouisB Sadly, this also didn't help. I want my final results to be only expressed in terms of kets and no remaining $J_{\pm}$ operators. Aug 5 at 19:53

The reason is simple: this package uses CenterDot as multiplication, while Series of Exp gives commutative polynomials wrt. Times instead of CenterDot.

The relevant codes are

Block[{Print},Needs["QuantumNotation"]];
SetQuantumAliases[];

SetQuantumObject[J];
SetQuantumScalar[a,b];

DefineOperatorOnKets[Subscript[J, 0], {\!$$\* TagBox[ RowBox[{"\[VerticalSeparator]", TagBox[ RowBox[{ SubscriptBox["j_", OverscriptBox["h", "^"]], ",", SubscriptBox["n_", OverscriptBox["l", "^"]]}], QuantumNotationzz080KetArgs, BaseStyle->{ShowSyntaxStyles -> True}, Editable->True, Selectable->True], "\[RightAngleBracket]"}], QuantumNotationzz080Ket, BaseStyle->{ShowSyntaxStyles -> False}, Editable->False, Selectable->False]$$ :> n \!$$\* TagBox[ RowBox[{"\[VerticalSeparator]", TagBox[ RowBox[{ SubscriptBox["j", OverscriptBox["h", "^"]], ",", SubscriptBox[ RowBox[{"(", "n", ")"}], OverscriptBox["l", "^"]]}], QuantumNotationzz080KetArgs, BaseStyle->{ShowSyntaxStyles -> True}, Editable->True, Selectable->True], "\[RightAngleBracket]"}], QuantumNotationzz080Ket, BaseStyle->{ShowSyntaxStyles -> False}, Editable->False, Selectable->False]$$}]
DefineOperatorOnKets[Subscript[J, p], {\!$$\* TagBox[ RowBox[{"\[VerticalSeparator]", TagBox[ RowBox[{ SubscriptBox["j_", OverscriptBox["h", "^"]], ",", SubscriptBox["n_", OverscriptBox["l", "^"]]}], QuantumNotationzz080KetArgs, BaseStyle->{ShowSyntaxStyles -> True}, Editable->True, Selectable->True], "\[RightAngleBracket]"}], QuantumNotationzz080Ket, BaseStyle->{ShowSyntaxStyles -> False}, Editable->False, Selectable->False]$$ :> Sqrt[(n + 1) (j - n)] \!$$\* TagBox[ RowBox[{"\[VerticalSeparator]", TagBox[ RowBox[{ SubscriptBox["j", OverscriptBox["h", "^"]], ",", SubscriptBox[ RowBox[{"(", RowBox[{"n", "+", "1"}], ")"}], OverscriptBox["l", "^"]]}], QuantumNotationzz080KetArgs, BaseStyle->{ShowSyntaxStyles -> True}, Editable->True, Selectable->True], "\[RightAngleBracket]"}], QuantumNotationzz080Ket, BaseStyle->{ShowSyntaxStyles -> False}, Editable->False, Selectable->False]$$}]
DefineOperatorOnKets[Subscript[J, m], {\!$$\* TagBox[ RowBox[{"\[VerticalSeparator]", TagBox[ RowBox[{ SubscriptBox["j_", OverscriptBox["h", "^"]], ",", SubscriptBox["n_", OverscriptBox["l", "^"]]}], QuantumNotationzz080KetArgs, BaseStyle->{ShowSyntaxStyles -> True}, Editable->True, Selectable->True], "\[RightAngleBracket]"}], QuantumNotationzz080Ket, BaseStyle->{ShowSyntaxStyles -> False}, Editable->False, Selectable->False]$$ :> Sqrt[n (j - n + 1)] \!$$\* TagBox[ RowBox[{"\[VerticalSeparator]", TagBox[ RowBox[{ SubscriptBox["j", OverscriptBox["h", "^"]], ",", SubscriptBox[ RowBox[{"(", RowBox[{"n", "-", "1"}], ")"}], OverscriptBox["l", "^"]]}], QuantumNotationzz080KetArgs, BaseStyle->{ShowSyntaxStyles -> True}, Editable->True, Selectable->True], "\[RightAngleBracket]"}], QuantumNotationzz080Ket, BaseStyle->{ShowSyntaxStyles -> False}, Editable->False, Selectable->False]$$}]


Now let's define the non-commutative Exp as

opExp[op_,n_Integer]:=Sum[1/$$i! CenterDot@@Table[op,$$i],{i,0,n}]


Then we have the correct result,

op=opExp[(a Subscript[J, p]+b Subscript[J, m]),2]//ExpandAll
op\[CenterDot]\!$$\* TagBox[ RowBox[{"\[VerticalSeparator]", TagBox[ RowBox[{ SubscriptBox["j", OverscriptBox["h", "^"]], ",", SubscriptBox["0", OverscriptBox["l", "^"]]}], QuantumNotationzz080KetArgs, BaseStyle->{ShowSyntaxStyles -> True}, Editable->True, Selectable->True], "\[RightAngleBracket]"}], QuantumNotationzz080Ket, BaseStyle->{ShowSyntaxStyles -> False}, Editable->False, Selectable->False]$$


• +1 This works! Thank you for your effort! Aug 6 at 6:38