ap

◼ ap[op, vc]applies an operator op to a vector vc in the occupation number representation.

◼ If it is attempted to add a particle that does not correspond to an operator that is part of the declared basis, ap returns unevaluated.

◼ ap[vc]=vc.

◼ ap[1,VACUUM] returns the vacuum state of the occupation number representation. See also function vacuum.

◼ See also: basis, makebasis, op2ndx, ndx2op, goodopQ, vacuum, vc, vc2ops.

Further examples

Load sneg and declare some quantities

<< sneg`sneg`;
snegfermionoperators[c, d];

Construct a basis for two lattice sites c and d, and obtain the vacuum state

makebasis[{c[], d[]}]
vac = vacuum[]

Single-particle states can be constructed by adding individual particles to the vacuum

p1 = ap[c[CR, UP], vac]
p2 = ap[c[CR, DO], vac]
p3 = ap[d[CR, UP], vac]
p4 = ap[d[CR, DO], vac]

By taking the particles away using annihilation operators, the vacuum is obtained again.

ap[c[AN, UP], p1]
ap[c[AN, DO], p2]
ap[d[AN, UP], p3]
ap[d[AN, DO], p4]

ap is a linear operator

ap[(1/(Sqrt[2])) (c[CR, UP] + d[CR, UP]), vac]

ap is Listable.

ap[{c[CR, UP], c[CR, DO], d[CR, UP], d[CR, DO]}, vac]

Annihilation operators annihilate vacuum!

ap[c[AN, UP], vac] == 0
ap[c[AN, DO], vac] == 0
ap[d[AN, UP], vac] == 0
ap[d[AN, DO], vac] == 0

Many-particle states are obtained by repeatedly adding single particles. The order is important, since we are dealing with fermions.

p12 = ap[c[CR, UP], ap[c[CR, DO], vac]]
ap[c[CR, DO], ap[c[CR, UP], vac]]
p14 = ap[c[CR, UP], ap[d[CR, DO], vac]]
ap[d[CR, DO], ap[c[CR, UP], vac]]

Equivalently, we can achieve the same by operating with creation operator products

ap[nc[c[CR, UP], c[CR, DO]], vac]
ap[nc[c[CR, DO], c[CR, UP]], vac]
ap[nc[c[CR, UP], d[CR, DO]], vac]
ap[nc[d[CR, DO], c[CR, UP]], vac]

States in the occupation number representation can be transformed to the equivalent creation operators  by calling  vc2ops.

vc2ops[p12]
vc2ops[p14]

Special rule

ap[1, VACUUM]

If we attempt to add a particle that does not correspond to an operator that is part of the declared bases, ap returns unevaluated.

ap[e[CR, UP], vac]

ap interoperates correctly with bras and kets

ap[ket[a], vac]
ap[bra[b], %]

ap[ket[a], p12]
ap[bra[b], %]

ap[ket[a, Null], p12]
ap[ket[Null, b], %]
ap[bra[a, Null], %]
ap[bra[Null, b], %]