Feynman Diagram Rules¶
Every non-vanishing Wick contraction corresponds to a Feynman
diagram — a graph that encodes the topology of the contraction.
sft-wick automatically constructs these diagrams as
FeynmanDiagram objects backed by a
networkx.MultiGraph.
Elements of a Diagram¶
Symbol |
Element |
Description |
|---|---|---|
● |
External point |
An observable field operator (e.g. \(\phi_a(x)\)). Rendered as a filled circle. |
■ |
Interaction vertex |
A term from \(S_{\mathrm{int}}\) (e.g. \(F_{ijk} \phi_i\phi_j\psi_k\)). Rendered as a filled square. |
— |
C propagator |
Correlation \(C_{ij}(x,x') = \langle\phi_i(x)\, \phi_j(x')\rangle_{S_0}\). Drawn as a solid blue line. |
→ |
R propagator |
Response \(R_{ij}(x,x') = \langle\phi_i(x)\, \psi_j(x')\rangle_{S_0}\). Drawn as a dashed red arrow (pointing from \(\psi\) to \(\phi\)). |
Constructing a Diagram from a Pairing¶
Given an observable \(\mathcal{O}\) and an expansion of \(S_{\mathrm{int}}^n\), the Wick contraction produces a set of pairings. Each pairing maps to a diagram as follows:
Create nodes: one external node per observable operator and one vertex node per interaction vertex instance.
Create edges: for each contracted pair \((i,j)\), draw a propagator edge between the nodes that own operators i and j.
The class method from_pairing()
performs this construction automatically.
Reading Off Expressions¶
To reconstruct the algebraic expression from a diagram:
Each vertex \(v\) contributes:
A coupling factor (e.g. \(F_{ijk}\))
Integration(s) over internal spatial variable(s) (\(\int \mathrm{d}y\,\ldots\))
Summation(s) over internal component indices (\(\sum_{i=1}^N \ldots\))
Each propagator edge contributes a two-point function: \(C_{ij}(x,x')\) or \(R_{ij}(x,x')\).
The overall prefactor for an order-n diagram is \((-1)^n / n!\) times the multinomial coefficient from the vertex combination.
Topological Properties¶
Loop count:
where \(E\) is the number of edges (propagators), \(V\) the
number of nodes (external + vertex), and \(C\) the number of
connected components. Accessed via the
n_loops property.
Connectivity:
A diagram is connected if every node can be reached from every
other node. Disconnected diagrams factorise into independent sub-diagrams.
Checked via is_connected.
Self-loops (tadpoles):
When a propagator connects a node to itself (e.g. \(C(x,x)\) at a vertex), it forms a tadpole. These are rendered as small loops in the diagram.
Rendering¶
Use DiagramRenderer (or the convenience
method draw_diagrams())
to visualise diagrams:
result = compute_moment(obs, action, order=1)
# Quick visualisation
result.draw_diagrams(order=1)
# Manual rendering with custom layout
from sft_wick import DiagramRenderer
renderer = DiagramRenderer(figsize=(8, 6))
for d_info in result.diagrams_by_order[1]:
fd = d_info.to_feynman_diagram()
renderer.draw(fd, title=fd.summary())
See Feynman Diagrams for the full usage guide.