(Created page with "In this note I give some particular cases of the module <tt>NormalOrder</tt> (see here). If <m>C</m> commute with <m>A</m> and <m>B</m> then: ...") |
m |
||
(5 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | In this note I give some particular cases of the module <tt>NormalOrder</tt> (see [[Blog:Notes/NormalOrder module|here]]). | + | 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-- | |
− | :< | + | If <math>C</math> commutes with <math>A</math> and <math>B</math> then: |
+ | |||
+ | :<math>[A,BC]=[A,B]C</math> | ||
So it is easy to compute expressions like, e.g., | So it is easy to compute expressions like, e.g., | ||
− | :< | + | :<math>[a^\dagger a,a^\dagger b]</math> |
factoring out b and computing: | factoring out b and computing: | ||
Line 17: | Line 19: | ||
we find: | we find: | ||
− | :< | + | :<math>[a^\dagger a,a^\dagger b]=a^\dagger b\,.</math> |
+ | |||
+ | 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 <math>:[elem_1,elem_2]:</math>: | ||
+ | |||
+ | <pre> | ||
+ | NormalOrderCommutator[elem1_, elem2_] := Module[{}, | ||
+ | NormalOrder[{prod[elem1, elem2], prod[{1, -1}*elem2, elem1]}] | ||
+ | ] | ||
+ | </pre> | ||
+ | |||
+ | in term of another module, prod, which is a component of the NormalOrder module: | ||
+ | |||
+ | <pre> | ||
+ | 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] | ||
+ | ] | ||
+ | </pre> | ||
+ | |||
+ | Some examples: | ||
+ | |||
+ | <pre> | ||
+ | NormalOrderCommutator[{{1, 1}, 1}, {{1, 0}, 1}] | ||
+ | {{{1, 0}, 1}} | ||
+ | </pre> | ||
+ | |||
+ | which is the case already given above, or | ||
+ | |||
+ | <pre> | ||
+ | NormalOrderCommutator[{{1}, 1}, {{1, 0}, 1}] | ||
+ | {{{0, 0}, 1}} | ||
+ | </pre> | ||
+ | |||
+ | which is the fundamental relation <math>[a,a^\dagger]=1</math>. | ||
+ | {{wl-publish: 2010-11-03 14:08:36 -0500 | Fabrice }} |
In this note I give some particular cases of the module NormalOrder (see here for this module itself).
If \(C\) commutes with \(A\) and \(B\) then:
\[[A,BC]=[A,B]C\]
So it is easy to compute expressions like, e.g.,
\[[a^\dagger a,a^\dagger b]\]
factoring out b and computing:
NormalOrder[{{{1, 1, 1, 0}, 1}, {{2, 1}, -1}}] {{{1, 0}, 1}}
we find:
\[[a^\dagger a,a^\dagger b]=a^\dagger b\,.\]
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 \(:[elem_1,elem_2]:\):
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 \([a,a^\dagger]=1\).