SyTen

## ◆ prod_impl() [2/2]

template<Rank r>
 SDef syten::TensorProd::prod_impl ( SourceLocation location, Tensor< r > const & a, Tensor< r > const & b, std::array< int, r > const & c_a, std::array< int, r > const & c_b, Conj const conj = Conj::n(), HandleFermions const handle_ferms = HandleFermions::n(), ConstSpan< Index > ferm_a = ConstSpan(), ConstSpan< Index > ferm_b = ConstSpan(), ConstSpan< Bool > parity_a = ConstSpan(), ConstSpan< Bool > parity_b = ConstSpan() )
inline

Implementation of tensor-tensor-to-scalar product.

Parameters
 location location of the calling function a first tensor to be contracted b second tensor to be contracted c_a contraction spec for a, legs with positive indices here are contracted c_b contraction spec for b, legs with positive indices here are contracted conj if this is Conj::y(), b is complex-conjugated handle_ferms if this is true, fermionic commutation is handled in a bare-bones manner ferm_a effective fermionic order of a tensor ferm_b effective fermionic order of b tensor parity_a list of booleans specifying if additional parities are to be placed on a-tensor legs, initialised only if handle_ferms is yes parity_b list of booleans specifying if additional parities are to be placed on b-tensor legs, initialised only if handle_ferms is yes
Remarks
handle_ferms only takes care of minus signs from permutations of a and b to go from ferm_a and ferm_b to a fermionic order in which the contraction itself can happen without additional minus signs. It assumes that in the result tensor, legs of B come first in descending order (-2 first, then -4, then -5) and legs of A come second in descending order (-1 first, then -3). It also assumes that ferm_b matches the effective order of b taking into account conj. That is, when calling the method with conj = Conj::y(), you also need to reverse ferm_b.

For every bucket in a, find the matching bucket in b. Since the buckets are sorted in ascending order, we can use lower_bound nicely.

Here is the call graph for this function: