Wick’s Theorem

Wick’s theorem is the combinatorial identity that allows expectation values of products of fields under a Gaussian measure to be written as sums over all complete pairings of two-point functions.

Statement

For \(2n\) field operators and a Gaussian (free) action \(S_0\):

\[\langle \Phi_1\,\Phi_2\,\cdots\,\Phi_{2n} \rangle_{S_0} = \sum_{\text{pairings}} \prod_{\text{pairs } (i,j)} \langle \Phi_i\,\Phi_j \rangle_{S_0}\]

The sum runs over all complete pairings — every operator must be paired with exactly one other. If the total number of operators is odd, the result vanishes.

Counting Pairings

For \(2n\) items, the number of complete pairings is the double factorial:

\[(2n-1)!! = 1 \times 3 \times 5 \times \cdots \times (2n-1)\]

For example:

  • 2 operators: 1 pairing

  • 4 operators: 3 pairings

  • 6 operators: 15 pairings

  • 8 operators: 105 pairings

The function generate_all_pairings() enumerates these.

The MSR Constraint

In the MSR formalism, the \(\psi\)\(\psi\) contraction vanishes:

\[\langle \psi_i(x)\,\psi_j(x') \rangle_{S_0} = 0\]

This has a powerful combinatorial consequence: every response field \(\psi\) must be paired with a physical field \(\phi\), producing a response propagator \(R\). The remaining \(\phi\)’s then pair among themselves, producing correlation propagators \(C\).

This constraint dramatically reduces the number of non-vanishing pairings. If there are \(n_\phi\) physical operators and \(n_\psi\) response operators:

  • Feasibility check: \(n_\psi \le n_\phi\) and \((n_\phi - n_\psi)\) must be even.

  • Valid pairings: choose which \(n_\psi\) of the \(\phi\)’s pair with the \(\psi\)’s, assign them in all \(n_\psi!\) permutations, then pair the remaining \(\phi\)’s giving \((n_\phi - n_\psi - 1)!!\) sub-pairings each.

The function generate_valid_pairings() implements this optimised enumeration, skipping all vanishing \(\psi\)\(\psi\) pairings at construction time rather than generating and discarding them.

Worked Example

Consider the four-operator expectation value:

\[\langle \psi(x)\,\phi(x)\,\phi(x)\,\phi(x) \rangle_{S_0}\]

We have \(n_\psi = 1\) and \(n_\phi = 3\), so the single \(\psi\) must pair with one of the three \(\phi\)’s (producing \(R\)), and the remaining two \(\phi\)’s pair together (producing \(C\)). There are \(\binom{3}{1} = 3\) ways to choose which \(\phi\) partners the \(\psi\), and \((2-1)!! = 1\) way to pair the remaining two \(\phi\)’s. This gives 3 pairings, all contributing \(R(x,x)\,C(x,x)\):

\[\langle \psi(x)\,\phi(x)\,\phi(x)\,\phi(x) \rangle_{S_0} = 3\,R(x,x)\,C(x,x)\]

In sft-wick:

from sft_wick import Field, Action, compute_moment

phi = Field('phi', 'physical')
psi = Field('psi', 'response')

obs = [psi('x'), phi('x'), phi('x'), phi('x')]
result = compute_moment(obs, Action(vertices=[]), order=0)
print(result.order(0).to_latex())
# 3 R(x, x) C(x, x)

Low-Level Access

For direct control over the Wick contraction machinery (without the perturbative wrapper), use:

  • wick_contract() — applies Wick’s theorem to any list of field operators and returns the symbolic sum plus the list of surviving pairings.

  • contract_pair() — contracts a single pair of operators into a propagator (or None if it vanishes).