1

Suppose CR is my creation operator and AR is my annihilation operator.

I have to show that CR.AR= N, where N is a number.

In general, it should be like CR.AR = CR1.AR1 + CR2.AR2 + CR3.AR3= N1 + N2 + N3 = N

I have been trying to achieve this using sneg package But unable to find a way.

I have also tried a solution given to another problem here.

qOperatorQ[expr_] := MatchQ[expr, qCO | qDO | Ket[n_Integer]];

(* take scalars out *) CenterDot[left___, Times[scalar_?NumericQ, op_?qOperatorQ], right___] := Times[ scalar, CenterDot[left, op, right] ];

(* Implement commutation relations *) CenterDot[left___, qDO, qCO, right___] := Plus[ CenterDot[left, qCO, qDO, right], CenterDot[left, right] ];

(* Allow to use powers of operators *) CenterDot[left___, Power[op : (qCO | qDO), n_Integer], right___] := CenterDot[ left, Sequence @@ ConstantArray[op, n], right ];

(* effective OneIdentity attribute *) CenterDot[op_?qOperatorQ] := op;

(* implement action on Fock states *) CenterDot[left___, qDO, Ket[0]] := 0; CenterDot[left___, qCO, Ket[n_Integer]] := Times[ Sqrt[n + 1], CenterDot[left, Ket[n + 1]] ]; CenterDot[left___, qDO, Ket[n_Integer]] := Times[ Sqrt[n], CenterDot[left, Ket[n - 1]] ];

Now using the above code when I defined CR and AR and use them on a ket state I get a result as below. But How do I find the expectation value, i.e. Bra[4]\[CenterDot]SuperDagger[a]\[CenterDot]a\[CenterDot]Ket[4]?

AR = qDO;
CR = qCO;
CR\[CenterDot]AR\[CenterDot]Ket[2]

Out[%]= 2 Ket[2]

user444
  • 2,414
  • 1
  • 7
  • 28
  • There is probably a conceptual error with the dot product. For the Bose algebra of creation and annihilation operators $a,a^+$ the algebra is the simple operator product in the sense of function concatenation. – Roland F Jul 10 '23 at 09:55
  • Okay! But how will I do that in Mathematica? – user444 Jul 10 '23 at 10:40
  • The code you copied only operates on Kets. There are no rules for handling Bras, or BraKets. You might consider the Wolfram Quantum Framework paclet from the Wolfram Paclet Repository, which has a more complete implementation for the basis, states, operators, etc. –  Jul 10 '23 at 17:51

2 Answers2

2

The expression you asked for,Bra[4][CenterDot]SuperDagger[a][CenterDot]a[CenterDot]Ket[4], can be implemented by adding one extra rule for the Bra vector:

CenterDot[Bra[m_Integer], Ket[n_Integer]] := KroneckerDelta[m, n]

The code you're using represents 'a' by qDO and SuperDagger[a] by qCO, so the existing rules handle everything except the Bra/Ket scalar product.

Bra[4]\[CenterDot]qCO\[CenterDot]qDO\[CenterDot]Ket[4]

Out[19]= 4

Bra[3][CenterDot] qCO[CenterDot] qDO[CenterDot]Ket[4]

Out[26]= 0

Although it's possible to get some simple results by stitching together fragments of code from different answers on this site, if you're trying to anything reasonably complex, you're going to keep running into obstacles. Questions are often focused, as are the answers, and you're not going to get a comprehensive solution, which is why I think a better approach is to use a package designed to do these calcuations, like SNEG, the Wolfram Quantum Framework, or one of several others designed to do quantum mechanical calculations.

  • Thank you. Can you share a link where I can get more knowledge about those specifically designed packages – user444 Jul 11 '23 at 03:56
  • 1
    The Wolfram Quantum Framework paclet is available on the Woflram paclet repository site. For some other packages, just enter a Google query like "quantum packages Mathematica" and you should get numerous hits. A few that I downloaded years ago are Quantum, Quantum52, and QuantumAlgebra. But several others show up in my query. You can download ones that look promising and look at any documentation/examples to get an idea if any are useful for your needs. Good luck. –  Jul 11 '23 at 04:18
0

The action on kets with undefined coefficients a[n], b[n], linearity for factors of kets inside and $\text {down}(\left|1 \right>) \to 0$, all that in a mapping rule via replacements

  replace =
  {  up [Ket[{n_}]] :> b[n + 1] Ket[{n + 1}],
     down[Ket[{n_}] ] :> c[n] Ket[{n - 1}],
     up[x_* k_Ket] :> x *up[k],
     down[x_* k_Ket] :>  x *down[k],
     down[Ket[{1}]] :> 0};

The commutator algebra is fixed by

 0 == Coefficient[
 down[ up [Ket[{n}]]] - up [down[ Ket[{n}]]] - 
   Ket[{n}] //. replace , Ket[{n}]]  

This fixes only the product of the coefficients

       b[n+1] c[n+1] ==   b[n] c[n] + 1

The lowest state is mapped to the scalar zero

        down[Ket[{1}]] == 0  \[Implies] b[2] c[2] = 1

This immedately gives the integer ladder.

         b[n] c[n] = n - 1 

The symmetric choice is

          b[n] == c[n] = Sqrt[n - 1]

Then the index operator is

      down[up[Ket[{n}]]] == down[Sqrt[n] Ket[{n + 1}]] == n Ket[{n}]

Roland F
  • 3,534
  • 1
  • 2
  • 10
  • Forgive me for my lack of knowledge in Mathematica. Nevertheless, this above doesn't give me any result but a bunch of error – user444 Jul 10 '23 at 15:18