Repository navigation
Writing Operators
Operators are written as on paper: ladder operators, multiplied and summed. The package keeps them compact and reads them back as local operators and spins. Every block on this page runs after
Needs["FermiWick`"]c[i, s] annihilates a fermion on site i with spin s, and cDag[i, s] creates it. The spin is SpinUp, SpinDown
(shown as ↑ and ↓) or a symbol; the site is a number or a symbol. ** multiplies in the order written, and NormalOrder
brings every creator to the left:
NormalOrder[c[1, SpinUp] ** cDag[1, SpinUp]]a · b (typed \[CenterDot], or Esc . Esc) is the product already in normal order.
Sums are ordinary sums; $Spins is the list of the two spins. Different symbols are different sites, so a result
written with symbols holds on any lattice:
NormalOrder[Sum[c[i, s] ** cDag[j, s], {s, $Spins}]]To include the case i = j, write it apart, with the same symbol for both.
Products on one site are local operators, which stay compact: nOp[i, s] and nTotOp[i] (densities), SzOp[i],
SpOp[i], SmOp[i] (spin), DOp[i] (double occupancy), B[i] and Bdag[i] (doublons), EmptyProjector[i] and
SingleOccupationProjector[i]. ToSpinChargeBasis writes any expression with them:
ToSpinChargeBasis[SpOp[1] ** SmOp[1]]and ToLadderBasis writes them back with ladder operators:
ToLadderBasis[DOp[1]]SdotS[i, j] is SdotScrossS[i, j, k] the scalar chirality
ToSpinChargeBasis recognizes them in a result, also from their
components:
ToSpinChargeBasis[SpOp[1] ** SmOp[2] + SmOp[1] ** SpOp[2] + 2 SzOp[1] ** SzOp[2]]Dagger reverses products, exchanges creators and annihilators and conjugates the coefficients: the amplitudes χ, Δ
are complex, other symbols are taken as real (the option "Complex" -> {...} lists more complex symbols). PlusHC
adds the "+ h.c.", and HermitianOperatorQ checks a Hamiltonian:
hubbard = -t Sum[PlusHC[cDag[1, s] ** c[2, s]], {s, $Spins}] + U/2 Sum[(nTotOp[i] - 1)^2, {i, 2}];
HermitianOperatorQ[hubbard]True
A complex hopping is declared complex, and its conjugate appears in the "+ h.c.":
PlusHC[τ cDag[1, SpinUp] ** c[2, SpinUp], "Complex" -> {τ}]OperatorCoefficients gives the coefficient of every monomial, in normal order; the constant has the key 1:
OperatorCoefficients[ToLadderBasis[hubbard], cDag[2, SpinDown] ** c[1, SpinDown]]c[l1, l2, ...] can carry any labels: orbitals, momenta, labels of your own. DeclareModeLabels says what each one is:
"Site" (used for locality), "Spin" (a spin ½), or any other name, compared with KroneckerDelta:
DeclareModeLabels[{"Site", "Orbital", "Spin"}];
NormalOrder[c[1, a, SpinUp] ** cDag[1, b, SpinUp]]The defaults are {"Site"} for one label and {"Site", "Spin"} for two.
DefineOperator[head, n, definition, display] defines an operator on n sites from known ones; it stays compact, and
ToSpinChargeBasis recognizes it in a result. Here the operator
DefineOperator[pair, 2, Function[{i, j}, (c[i, SpinUp] ** c[j, SpinDown] - c[i, SpinDown] ** c[j, SpinUp])/Sqrt[2]],
Function[{i, j}, Subscript[b, Row[{i, j}]]]];
ToSpinChargeBasis[Dagger[pair[1, 2]] ** pair[1, 2]]On two singly occupied sites (
The adjoint of a defined operator stays compact too: Dagger gives the operator itself when it is Hermitian, the
operator with its sites permuted when that is its adjoint (a hopping), and otherwise AdjointOperator[head][sites],
shown with a dagger, expanded and recognized like the operator itself. Here
{Dagger[pair[1, 2]], WickVEV[Dagger[pair[1, 2]], SpinSingletState["Pairing" -> Δ]]}