Function sequant::mbpt::closed_shell_spintrace(const ExprPtr&, const container::svector<container::svector<Index>>&, bool)¶
Defined in File spin.cpp
Function Documentation¶
-
ExprPtr sequant::mbpt::closed_shell_spintrace(const ExprPtr &expr, const container::svector<container::svector<Index>> &ext_index_groups = {}, bool full_expansion = false)¶
Traces out spin degrees of freedom from fermionic operator moments.
This function is designed for integrating spin out of expressions obtained as (k,k)-moment of a fermionic operator: A_{p_1 .. p_k}^{q_1 .. q_k} <a^{p_1 .. p_k}_{q_1 .. q_k} op> with A antisymmetric tensor, op an arbitrary fermionic operator, and the expectation value is with respect to a closed-shell Fermi vacuum.
Warning
the “antisymmetrizer” tensor A is assumed to be at the front of each tensor network, hence must use “complete” canonicalization to produce the input expression.
- Parameters:
expr – an input expression
ext_index_groups – groups of external indices
full_expansion – if true, we first fully expand the antisymmetrizer, which makes spintracing expensive because of the large number of terms. If false, we expand it in terms of the symmetrizer, which results in a partial expansion.
- Returns:
the spin-free form of expr