bra

◼ bra[i] denotes the Dirac bra ⟨i|.
◼ ket[i] denotes the Dirac ket ⟨i|.

◼ When PrettyOutput is enabled, bra and ket expressions are output as "⟨"i"|" and "|"i"⟩".

◼ Bras and kets in nc expressions are commuted to the right of all fermionic operators.

◼ Bras and kets can be composed of several elements, as in bra[i,j,k,...],  ket[i,j,k,...]. These elements can be different quantum numbers of the same physical system, or quantum numbers for different systems. In the later case, a ket in the subspace of some subsystem can be expressed by not specifying the quantum numbers of other subspaces by putting Null in their positions, as in ket[Null, i2, Null]. Tensor product of kets in different subspaces then corresponds to coalescing these kets, as in nc[ket[i1, Null, Null], ket[Null,i2,Null], ket[Null,Null,i3]]=ket[i1,i2,i3].

◼ A bra and a ket are said to be compatible, if they have the same pattern of index pairs: quantum numbers must be defined either in both the bra and the ket or in neither of them. For example, bra[{i,Null}] and ket[{j,Null}] are compatible, but bra[{i,Null}] and ket[{j,k}] are not.

◼ Wheneven a bra and a ket are juxtaposed within a nc expression and they are compatible (in the sense described above), the braket is evaluated by calling braketrule.

◼ Bras and kets can be conjugated: conj[bra]=ket, conj[ket]=bra.

◼ Kets may appear in the occupation number vectors with Head vc. They are added to the vc vector using ap. If bra is applied to a vc vector containing kets, the braket is evaluated using braketrule.

◼ Bras and kets are especially convenient to work with spin operators (see also sneg functions spinbra,spinket,spinbasis) and with local phonon operators (see also phononnumber, phononplus, phononminus).

◼ See also: nc, braketrule, spinbra, spinket, spinbasis, phononnumber, phononplus, phononminus.

Further examples

Load Package sneg and define c to be a fermionic operator

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

Simple bras and kets

bra[]
ket[]
bra[i]
ket[i]
bra[i, j]
ket[i, j]
bra[i, j, k]
ket[i, j, k]

Mixing fermionic operators with bras and kets

c[CR]·ket[i]
ket[i]·c[CR]
c[CR]·bra[i]
bra[i]·c[CR]

Simple brakets

bra[]·ket[]
bra[i]·ket[j]
bra[i, j]·ket[k, l]
bra[i, j, k]·ket[k, l, m]

Bras and kets for subsystems

bra[i, Null]
bra[Null, j]

    
ket[i, Null]
ket[Null, j]

Juxtaposition versus coalescence

ket[i]·ket[j]
ket[i, Null]·ket[Null, j]

    
(bra[i]·bra[j])·(ket[m]·
          ket[n])
(bra[i, Null]·
          bra[Null, j])·(ket[m, Null]·
          ket[Null, n])

Evaluating brakets for "compatible" bras and kets

bra[i, Null]·ket[j, Null]
bra[Null, i, Null]·ket[Null, j, Null]

Conjugation

conj[bra[i]]
conj[ket[i]]

Example: Hubbard projection operators

hub[i_, j_] = ket[i]·bra[j]

    
hub[i, j]·hub[j, k] == hub[i, k]

Mixing bras and kets with vc vectors

bz = makebasis[{c[1], c[2]}]
bvc = ap[bz, VACUUM]

    
ap[ket[i], bvc]
ap[bra[j], %]

    
ap[ket[i, Null], bvc]
ap[ket[Null, j], %]
ap[bra[k, Null], %]
ap[bra[Null, l], %]