Line 1: | Line 1: | ||
In this note I give some particular cases of the module <tt>NormalOrder</tt> (see [[Blog:Notes/NormalOrder module|here]] for this module itself). | In this note I give some particular cases of the module <tt>NormalOrder</tt> (see [[Blog:Notes/NormalOrder module|here]] for this module itself). | ||
+ | |||
--more-- | --more-- | ||
− | If <m>C</m> | + | |
+ | If <m>C</m> commutes with <m>A</m> and <m>B</m> then: | ||
:<m>[A,BC]=[A,B]C</m> | :<m>[A,BC]=[A,B]C</m> | ||
Line 19: | Line 21: | ||
:<m>[a^\dagger a,a^\dagger b]=a^\dagger b\,.</m> | :<m>[a^\dagger a,a^\dagger b]=a^\dagger b\,.</m> | ||
− | If you followed my trend yesterday you see we're getting closer to a universal engine to solve symbolically (or reduce) quantum systems. | + | If you followed my trend yesterday you see we're getting closer and closer to a universal engine to solve symbolically (or reduce) quantum systems. |
− | Here is a module that does | + | Here is a module that does the commutation directly, computing <m>:[elem_1,elem_2]:</m>: |
<pre> | <pre> | ||
Line 49: | Line 51: | ||
</pre> | </pre> | ||
− | already given above, or | + | which is the case already given above, or |
<pre> | <pre> |
In this note I give some particular cases of the module NormalOrder (see here for this module itself).
If <m>C</m> commutes with <m>A</m> and <m>B</m> then:
So it is easy to compute expressions like, e.g.,
factoring out b and computing:
NormalOrder[{{{1, 1, 1, 0}, 1}, {{2, 1}, -1}}] {{{1, 0}, 1}}
we find:
If you followed my trend yesterday you see we're getting closer and closer to a universal engine to solve symbolically (or reduce) quantum systems.
Here is a module that does the commutation directly, computing <m>:[elem_1,elem_2]:</m>:
NormalOrderCommutator[elem1_, elem2_] := Module[{}, NormalOrder[{prod[elem1, elem2], prod[{1, -1}*elem2, elem1]}] ]
in term of another module, prod, which is a component of the NormalOrder module:
prod[sequence__] := Module[{terms}, terms = Transpose[List[sequence]]; {Associate[Flatten[EvenSize /@ (terms[[1]])]], Times @@ terms[[2]]} ] EvenSize[list_] := Module[{}, If[OddQ[Length[list]], Prepend[list, 0], list] ]
Some examples:
NormalOrderCommutator[{{1, 1}, 1}, {{1, 0}, 1}] {{{1, 0}, 1}}
which is the case already given above, or
NormalOrderCommutator[{{1}, 1}, {{1, 0}, 1}] {{{0, 0}, 1}}
which is the fundamental relation <m>[a,a^\dagger]=1</m>.