SyTen

◆ prodD() [3/4]

template<Rank summed, Rank frank, Rank srank, typename Scalar , std::enable_if_t<(int(frank)+int(srank) - 2 *int(summed) > 0), int > = 0>
GenericDenseTensor<frank + srank - 2 * summed, Scalar> syten::GenericDenseTensorImpl::prodD ( GenericDenseTensor< frank, Scalar > const &  a,
GenericDenseTensor< srank, Scalar > const &  b,
std::array< int, frank > const &  c_a,
std::array< int, srank > const &  c_b,
bool  conjugate = false,
EliminateZeros const  ezeros = EliminateZeros::No,
DenseProduct::TemporaryTransposeStorage< Scalar, frank, srank > *  tts = nullptr 
)
inline

Product wrapper for generic dense tensors.

Forwards to the appropriate implementation.

Parameters
athe first tensor
bthe second tensor
c_athe product specification for the first tensor
c_bthe product specification for the second tensor
conjugateif true, complex-conjugate the elements of b
ezerosif equal to EliminateZeros::Yes, small zeros arising from not-small columns and rows will be eliminated.
ttsif non-nullptr, used to temporarily store transposed arrays
Template Parameters
summednumber of contracted indices
frankrank of first tensor
srankrank of second tensor
Scalarscalar type of the tensors, usually std::complex<double>

If a value c_a[i-1] is positive, the i-th leg of a will be contracted with the leg j of b for which c_b[j] = c_a[i]. If the value is negative, the leg will be taken as the -c_a[i-1]-th output leg. Positive numbers have to include all numbers (inclusive) between 1 and summed. Negative numbers have to include all numbers (inclusive) between -1 and -frank - srank + 2 * summed.

Example\n
prodD<2>(a, b, {-3, 1, -1, 2}, {2, -2, 1}) is equivalent to \( R_{ijk} = \sum_{lm} A_{klim} B_{mjl} \)

References syten::GenericDenseTensorImpl::GenericDenseTensor< rank, Scalar >::storage.