Creation and Annihilation
Quantum chemistry doesnβt work with Pauli operators directly β it works with ladder operators: creation ($a^\dagger$) and annihilation ($a$). These add or remove a particle from a specific orbital:
// The three ladder operator cases:
let create = Raise // aβ β adds an electron
let destroy = Lower // a β removes an electron
let nothing = Identity // I β does nothing
// Parse from short names:
LadderOperatorUnit.Apply "u" // Some Raise ("up")
LadderOperatorUnit.Apply "d" // Some Lower ("down")
Indexed ladder operators
In practice, each operator targets a specific mode (orbital):
// aβ β β create an electron in orbital 2:
let adag2 = LadderOperatorUnit.FromUnit(true, 2u)
// { Index = 2u; Op = Raise }
// aβ β annihilate an electron in orbital 1:
let a1 = LadderOperatorUnit.FromUnit(false, 1u)
// { Index = 1u; Op = Lower }
Product terms: multi-operator strings
A typical quantum chemistry term involves several ladder operators. For example, $a^\dagger_0 a^\dagger_1 a_1 a_0$ (a two-body interaction):
let twoBody = LadderOperatorProductTerm.FromUnits [|
(true, 0u) // aβ β
(true, 1u) // aβ β
(false, 1u) // aβ
(false, 0u) // aβ
|]
// Is this in "normal order" (all creates before annihilates)?
twoBody.IsInNormalOrder // true β
// Is it in "index order" (create indices ascending, annihilate descending)?
twoBody.IsInIndexOrder // true β
You can also build from explicit tuples or parse from strings:
let oneBody = LadderOperatorProductTerm.FromTuples [|
(Raise, 2u); (Lower, 3u)
|]
let parsed = LadderOperatorProductTerm.TryCreateFromString "[(u, 0)|(d, 1)]"
And sum expressions work the same way:
let expr = LadderOperatorSumExpression.TryCreateFromString
"{[(u, 0)|(d, 1)]; [(u, 2)|(d, 3)]}"
// Two terms: aβ β aβ + aβ β aβ
Next: Normal Ordering β making physics legal with CAR and CCR