auto_contractor.wick — Wick Contraction Engine¶
Source: qlat/auto_contractor/wick.py
Note: Update this document when updating the source file.
Outline¶
Overview¶
wick implements the symbolic Wick contraction engine for the auto-contractor
framework. Given products of quark creation/annihilation operators, gamma
matrices, and gauge links, it performs Wick contractions to produce expressions
in terms of quark propagator traces. The result is a sum of terms, each
containing traces (Tr) or open chains (Chain) of propagators, gamma
matrices, and gauge links, multiplied by symbolic coefficients.
The module also handles baryon operators via the Bfield and BS (baryon
propagator) classes, supporting spin-1/2 and spin-3/2 baryons with both
standard and positive-parity interpolating fields.
Operator Classes¶
Quark Fields¶
All inherit from Qfield (which inherits from Op).
Class |
Otype |
Description |
|---|---|---|
|
|
Quark annihilation operator \(\psi(p)\); acts as \(\partial/\partial\bar H\) |
|
|
Quark creation operator \(\bar\psi(p)\); acts as \(\partial/\partial H\) |
|
|
Hadronic annihilation operator |
|
|
Hadronic creation operator |
|
|
Smeared hadronic annihilation |
|
|
Smeared hadronic creation |
Parameters: f = flavor, p = position label, s = spin index, c = color index.
Propagators and Matrices¶
Class |
Otype |
Description |
|---|---|---|
|
|
Quark propagator from |
|
|
Gamma matrix; |
|
|
Gauge link at position |
Traces and Chains¶
Class |
Otype |
Description |
|---|---|---|
|
|
Trace over spin/color of a product of S, G, U operators |
|
|
Open (non-loop) product of S, G, U operators |
The tag attribute indicates what indices are traced: "sc" (spin+color), "s" (spin only), "c" (color only), or "" (neither).
Baryon Fields¶
Class |
Description |
|---|---|
|
Baryon creation/annihilation tensor |
|
Spin-tensor coefficients for baryon operators |
|
Baryon propagator (three chained quark propagators) |
Predefined baryon tags in bfield_tag_dict:
Tag |
Description |
|---|---|
|
Standard spin-1/2 proton/neutron |
|
Positive-parity spin-1/2 |
|
Standard spin-3/2 |
|
Positive-parity spin-3/2 |
Expression System¶
Class |
Description |
|---|---|
|
A single term: coefficient times commutable and anti-commutable operators |
|
A sum of terms with optional description label |
Key Expr methods:
Method |
Description |
|---|---|
|
Sort operators within each term |
|
Full simplification pipeline |
|
Identify and form |
|
Merge terms with identical operator structures |
|
Simplify coefficients via sympy |
|
Normalize baryon propagator coefficients |
|
Numerically evaluate coefficients to |
Arithmetic operators (+, -, *) are supported. Adding a str sets the description.
Contraction¶
Function |
Description |
|---|---|
|
Perform Wick contractions on |
|
Contract a single term |
The contraction pushes Qv and Qb operators through the term, replacing
them with propagators S via:
\(Qv \cdot HbS \to S\) (with sign tracking for fermion ordering)
\(Qb \cdot SHv \to S\)
Simplification¶
Function |
Description |
|---|---|
|
Full simplification (isospin limit, traces, combine, scale, simplify coefficients) |
|
Identify |
|
Identify |
Utility Functions¶
Function |
Description |
|---|---|
|
Create a factor expression (delegates to |
|
Convert an |
|
Propagator shortcuts for light, strange, charm |
|
Wrap commutable operators in a |
|
Create a gamma matrix expression |
|
Vector ( |
|
Pre-built gamma expressions |
Examples¶
import qlat as q
q.begin_with_mpi([[1, 1, 1, 4]])
from qlat.auto_contractor.wick import (
Qb, Qv, G, S, Tr, Expr, Term,
contract_expr, simplified, mk_expr,
)
# Build a pion correlator: tr[g5 S_d(x,y) g5 S_u(y,x)]
expr = (
1
* Qb("d", "x1", "s1", "c1")
* G(5, "s1", "s2")
* Qv("u", "x1", "s2", "c1")
* Qb("u", "x2", "s3", "c2")
* G(5, "s3", "s4")
* Qv("d", "x2", "s4", "c2")
)
# Perform Wick contractions
c_expr = contract_expr(expr)
c_expr = simplified(c_expr, is_isospin_symmetric_limit=False)
print(c_expr.show())
q.end_with_mpi()