nc

◼ nc[a,b,c] represents non-commutative multiplication, i.e. it encloses a string of operators that do not (necessarily) commute.

◼ When PrettyOutput is enabled, nc expressions are output in infix notation with CenterDots.

◼ nc is a linear operator in all of its arguments: scalar (numeric) quantities are factored out in front of the expression, and distributive law over addition is automatically applied. See sneg command sneglinearoperator.

◼ nc is associative, for example nc[a,nc[b,c],d]=nc[a,b,c,d]. Note, however, that nc does not have Flat, nor OneIdentity attributes like Times has. This was a design decision for reasons of performance. This implies that pattern matching is different for nc as compared to Times. Note also that nc, being noncommutative multiplication, clearly does not have OrderLess attribute.

◼ nc[] is taken to be 1.

◼ nc is idempotent, nc[c]=c.

◼ nc automatically imposes Pauli rule for fermionic operators: a product of two consecutive equal operator is zero.

◼ Operator strings are automatically reordered into the  normal form. See ordering and acmt for more details.

◼ In addition to operators, nc can contain Dirac bras and kets (see sneg commands bra and ket) and VACUUM placeholder. More generally, sneg will leave intact any elements that it does not recognize to have special meaning.

◼ nc can be used to multiply abstract sums. See sum for more details.

◼ Remember to use nc instead of Times for multiplication when using Mathematica commands such as Inner and Outer (see sneg commands inner, outer, mcross and VMV). Furthermore, use pow instead of Power to raise operator expressions to some power.

◼ See also: snegfermionoperators, snegrealconstants, vev, vevwick, dd, onvac, ap, wick, pow.

Further examples

Load Package sneg

<< sneg`sneg`;

Define c as a fermionic operator

snegfermionoperators[c]

Pretty printing of operator string

nc[c[CR, 1, UP], c[CR, 2, UP], c[CR, 3, UP]]

Internally, the string is still represented by an nc expression.

FullForm[%]

Distributivity

nc[c[CR, 1, UP] + c[CR, 2, UP], c[CR, 3, DO]]

Factorization of numeric constants

nc[c[CR, 1, UP], 3 c[CR, 2, UP], π c[CR, 3, UP]]

Associativity

nc[c[CR, 1, UP], 
      nc[c[CR, 2, UP], c[CR, 3, UP]]]
FullForm[%]

Pauli rule

nc[c[CR, UP], c[CR, UP]]

Automatic reordering: by default, the creation operators are moved to the left.

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

nc expression with an operator and a ket

nc[c[CR, UP], ket[0]]

Use of VACUUM placeholder. Annihilation operator applied to a vacuum state yields zero.

nc[c[CR, UP], VACUUM]
nc[c[AN, UP], VACUUM]

Multiplication of abstract sums

nc[sum[c[CR, k1, UP], {k1}], sum[c[CR, k2, DO], {k2}]]

Raising operators to powers

number[c[]]
pow[%, 2]
pow[%%, 3]