Introduction

The main purpose of these introductory notes is to describe the nomenclature, notations and conventions used in the SNEG library. The following sections are rather  abstract and concise, they focus on the design of the library rather than on the real-world examples. The examples in the help pages for SNEG commands should thus be studied in conjunction with reading this text.

Loading sneg

To load SNEG, use the command Get or Needs:

<< sneg`sneg`;

Operators

In SNEG, operators are indexed objects, for example c[t,  σ]. The expression head, c, is the operator name, while t and σ are indexes which indicate, for example, if the operator is a creation or an annihilation operator, and the associated degrees offreedom such as spin. The operator character of c must be declared using one of following functions:

For example,

snegfermionoperators[c];

By convention,the first index indicates if the operator creates or annihilates a particle. Two constants are predefined for this purpose: CR=0 and AN=1. Another convention is that the spin index in the case of S=1/2 operators is in the last position. For convenience,two further constants are predefined: UP=1 and DO=0. For a single orbital, the creation operators are thus c[CR, UP] and c[CR, DO], while the corresponding annihilation operators are c[AN, UP] and  c[AN, DO]. (Conjugation can be performed using function conj.) Operators following this convention are displeyed using pretty printing:

{c[CR, UP], c[CR, DO], c[AN, UP], c[AN, DO]}

Non-commuting multiplication

The cornerstone of SNEG is the non-commuting multiplication function nc. Mathematica's built-in multiplication function Times has Orderless attribute, which corresponds to the mathematical property of commutativity, making this form of multiplication unsuitable. Another built-in function, NonCommutativeMultiply, has Flat attribute,which corresponds to the mathematical property of associativity. Non-commuting multiplication should indeed be associative; unfortunately, Flat attribute also affects pattern matching,which proved to be undesirable for our purposes due to decreased  performance.

nc[]
nc[a, b]
nc[b, a]
nc[a, nc[b, c]]

An operator string is a sequence of second-quantization operators, such as \(TraditionalForm\`c\_\(\(k\)\(\ \)\(↓\)\)\%†\ \(c\_\(\(k\)\(\ \)\(↑\)\)\%†\) \(c\_\(\(k\)\(\ \)\(↓\)\)\) c\_\(\(k\)\(\ \)\(↑\)\)\). In SNEG, this sequence is represented as nc[c[CR, k, DO],  c[CR, k, UP],  c[AN, k, DO], 
        c[AN, k, UP]]. Pretty printing is used to show the expression:

nc[c[CR, k, DO], c[CR, k, UP], c[AN, k, DO], c[AN, k, UP]]

Operators are automatically normal ordered by (anti-)commuting the creation operators to the left and annihilation operators to the right using the default (canonical) or user-defined (anti-)commutation relations (see cmt, acmt, ordering and snegOrderedQ). This produces equivalent results for equivalent strings of operators and enables automatic expression simplifications. This property is the nc equivalent of argument sorting in the commuting multiplication function Times.

Numbers and numeric expressions

SNEG must be able to differentiate operators from numbers and other numeric expressions in order to factor out non-operator parts of operator expressions. The following declaration functions may be used for this purpose:

In SNEG, numericity of an expression is tested using isnumericQ.

Anti-commutation relations and operator ordering

Two properties of operators must be known to SNEG to perform automatic reorderings and simplifications in the case of fermionic operators: anti-commutation relations and the vacuum state. The first affects how the transpositions of operators are performed, while the latter determines the conventional ordering of operators in operator strings.

The default anti-commutation relation for fermionic operators are the usual cannonical anti-commutation relations, {(Subscript[c, α]^†),(Subscript[c, β])}=(Subscript[δ, α β]), {(Subscript[c, α]^†), (Subscript[c, β]^†)} = 
        0, {(Subscript[c, α]), (Subscript[c, β])} = 0. Operators with different heads simply anti-commute. The value of the  {(Subscript[c, α]^†),(Subscript[c, β])} anti-commutator is defined by the funciton acmt. See also cmt for the case of bosonic operators and the function snegOrderedQ which determines the low-level ordering rules.

The vacuum state may be a no-particle vacuum (ordering=EMPTY) or a Dirac sea of particles (ordering=SEA), see ordering.

Expression building functions

SNEG includes several functions that can be used to build operator expressions such as occupation number, spin operator, spin-spin scalar product, charge-charge repulsion, etc. Unless otherwise specified, parameters to such functions are operators with their type (CR or AN) and spin indeces removed, for example c[]; this form of operators is named stripped form.

Expression building functions in SNEG

number[c[]]
number[c[k]]
hubbard[c[]]
{spinx[c[]], spiny[c[]], spinz[c[]]}
nambu[c[]]
{isospinx[c[]], isospiny[c[]], isospinz[c[]]}

Expression manipulation functions

Expression manipulation functions in SNEG

komutator[spinx[c[]], spiny[c[]]] // Expand
conj[c[AN, UP]]
invertspin[c[AN, UP]]

Dirac's bra and ket notation

Dirac's bras ⟨i, j| and kets |i, j⟩ are represented by expressions bra[i, j] and ket[i, j] where i, j denote the quantum numbers that determine the corresponding state. See also bra.

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

Dirac bras and kets can appear in the nc multiplication expressions. They are automatically shifted to the right-most side of operator expressions. The default behavior is that bras and kets commute with operators, i.e.it is assumed that they belong to a different Hilbert space than the one where the second quantization operators operate. Bras and kets themselves do not commute,i.e.the braket ⟨i | 
          j⟩ is different from the projector \(TraditionalForm\`|j⟩ ⟨i|\).

By default,the values of brakets are determined using the Kronecker's delta (see braketrule).

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

Different quantum numbers correspond to different argument positions. Null placeholders can be used in place of unspecified quantum numbers. Neighboring bras and kets are ``concatenated'' if they have compatible patterns of Null placeholders. From the mathematical point of view,this corresponds to a direct (tensor) product of states.

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

Miscellaneous functions for commonly occuring uses of bras and kets (spins and phonons)

VACUUM vector

Keyword VACUUM corresponds to a vacuum state. By default, if an annihilation operator is applied to VACUUM from the left, the result is 0. Correspondingly, if a creation operator is applied to conj[VACUUM] from the right, the result is 0. See also isannihilation and iscreation.

c[AN]·VACUUM

Creation operator and occupation number representations

A state can be represented either as the effect of string of creation operators on a (unspecified) vacuum state, or as a set of occupation numbers. If the vacuum is known, a one-to-one mapping between the two representations can be established. In the creation operator representation, a state is just an operator expression. In the occupation number representation, a state is given by a vector of occupation numbers, vc[0, 1, 0, 0, 1, 0,  ... ]. Each position in the vector corresponds to some orbital with a given spin. A mapping between operators and positions in the vector is established using makebasis function. For two orbitals, for example, the mapping is defined by makebasis[c[1],  c[2]]. Position 1 then corresponds to (Subscript[c, 1↑]^†), position 2 to (Subscript[c, 1↓]^†), position 3 to (Subscript[c, 2↑]^†), and position 4 to (Subscript[c, 2↓]^†). The mapping can be accessed as the global variable BASIS, or using op2ndx and ndx2op mapping functions.

The zero-particle vacuum can be obtained using vacuum. Operator expressions can be applied to occupation number vectors using ap. One can go from creation operator representation to occupation number representation and back using ops2vc and vc2ops mapping functions.

Scalar products of vectors are given by scalarproductop and scalarproductvc. Norms can be calculated using normop and normvc. An operator given by a second-quantisation operator expression O can be transformed using matrixrepresentationop and matrixrepresentationvc to its matrix representation in a subspace spanned by states given in a list. A vector can be decomposed in a given subspace using decomposeop and decomposevc. A set of vectors can be orthogonalized in a given subspace using orthogop and orthogvc.

Basis sets

In SNEG, basis sets are lists of subspace basis sets. A subspace basis set consists of a list of invariant quantum numbers that characterize the invariant subspace and a list of states in either creation operator or occupation number representation. Conversions of basis sets from creation operator to occupation number representation can be performed using bzvc2bzop and bzop2bzvc functions.

Basis set creation and manipulations functions in SNEG

qsbasis[{c[1], c[2]}] // MatrixForm

qsbasisvc[{c[1], c[2]}] // MatrixForm

Symbolic sums

SNEG has support for symbolic sums over dummy indexes, for example sum[number[c[k]], {k}] to represent the total particle number. See sum.

Symbolic sum manipulations functions in SNEG