Wick’s Theorem¶
To get started let’s use SeQuant to apply Wick’s theorem to a simple product of elementary (creation and annihilation) fermionic operators:
This is achieved by the following SeQuant program:
Index p1(L"p_1"), p2(L"p_2"), p3(L"p_3"), p4(L"p_4");
auto cp1 = fcrex(p1), cp2 = fcrex(p2);
auto ap3 = fannx(p3), ap4 = fannx(p4);
std::wcout << to_latex(ap3 * ap4 * cp1 * cp2) << " = "
<< to_latex(FWickTheorem{ap3 * ap4 * cp1 * cp2}
.full_contractions(false)
.compute())
<< std::endl;
Hint
All core user-facing SeQuant code lives in C++ namespace sequant
, and the shown code assumes this namespace has been imported via
using namespace sequant
.
Running this program should produce a LaTeX expression for this formula:
where the tensor notation is used to denote elementary and composite normal-ordered (or, shortly, normal) operators:
\(s^p_q \equiv \langle q | p \rangle\) denotes inner products (“overlaps”) of 1-particle states. Wick’s theorem can of course be applied directly to products of normal composite operators, e.g,
auto nop1 = ex<FNOperator>(cre(p1, p2), ann(p3, p4));
// OR
// auto nop1 = ex<FNOperator>(cre({p1, p2}), ann({p3, p4}));
// OR
// auto nop1 = ex<FNOperator>(cre(std::vector{p1, p2}),
// ann(std::array{L"p3", L"p4"}));
// OR
// auto nop1 = ex<FNOperator>(cre(std::set{"p1", "p2"}),
// ann(std::vector{L"p3", L"p4"}));
auto nop2 = ex<FNOperator>(cre({L"p_5"}), ann({L"p_6", L"p_7"}));
std::wcout
<< to_latex(nop1 * nop2) << " = "
<< to_latex(FWickTheorem{nop1 * nop2}.full_contractions(false).compute())
<< std::endl;
produces
where \(␣\) is used in number-nonconserving operators to point out the empty “slots”.
Same algebra can be performed for bosons:
auto nop3 = ex<BNOperator>(cre({p1, p2}), ann({p3, p4}));
auto nop4 = ex<BNOperator>(cre({L"p_5", L"p_6"}), ann({L"p_7"}));
std::wcout
<< to_latex(nop3 * nop4) << " = "
<< to_latex(BWickTheorem{nop3 * nop4}.full_contractions(false).compute())
<< std::endl;
where \(b\) denotes normal bosonic operators constructed analogously with the normal fermionic operators \(a\)