Function sequant::mbpt::open_shell_spintrace

Function Documentation

std::vector<ExprPtr> sequant::mbpt::open_shell_spintrace(const ExprPtr &expr, const container::svector<container::svector<Index>> &ext_index_groups, std::optional<int> target_spin_case = std::nullopt)

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 an open-shell Fermi vacuum.

Note

this performs full expansion of the antisymmetrizer

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

  • target_spin_case – if non-null specifies the target spin case of the external indices, else produces equations for all spin cases

Returns:

vector of spin-traced expressions for each spincase