|
inline |
Implementation of tensor-tensor-to-scalar product.
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 |
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.
References syten::DenseProduct::check_dense_dims(), std::clock(), syten::SourceLocation::column(), syten::conj(), std::chrono::duration::count(), syten::dense(), syten::Tensor< rank >::dirs, syten::SourceLocation::file_name(), std::array< T >::fill(), syten::Inc, syten::is_perm_fermionic(), syten::isFermionic(), syten::SourceLocation::line(), std::lower_bound(), std::make_pair(), syten::minus_on_swap(), std::chrono::high_resolution_clock::now(), syten::EnvVars::prod_check_early, std::vector< T >::push_back(), syten::LimVec< Type, max, MaxType, type >::push_back(), std::vector< T >::reserve(), syten::Tensor< rank >::size(), std::vector< T >::size(), SYTEN_ASSERT_MSG, syten::EnvVars::tensor_time, syten::tensorSortBuckets(), std::to_string(), syten::MemoryUsage::totalSize(), and syten::DenseProduct::validateProductSpecifier().