working on fourindex conversions in tensor class

This commit is contained in:
Jiri Pittner 2025-10-23 18:09:21 +02:00
parent 346ce5bc3a
commit 91d8f4cc46
2 changed files with 21 additions and 4 deletions

View File

@ -1417,9 +1417,6 @@ else
template class Tensor<double>;
template class Tensor<std::complex<double> >;
template std::ostream & operator<<(std::ostream &s, const Tensor<double> &x);

View File

@ -46,7 +46,7 @@
//@@@ will need to store vector of INDEX to the original tensor for the result's flatindex
//@@@ will not be particularly efficient
//
//@@@conversions to/from fourindex, optional negarive range for beta spin handling
//@@@conversions to/from fourindex, optional negative range for beta spin handling in some cases
//@@@use the fact that fourindex_dense is inherited from Mat/SMat and construct tensor from the (unsymmetrized) NRMat sharing data, just rewrite then the shape
//
//@@@?general permutation of individual indices - check the indices in sym groups remain adjacent, calculate result's shape, loopover the result and permute using unwind_callback
@ -265,6 +265,26 @@ public:
};
//due to template nesting and specialization limitation, this cannot be class member - the S parameter has to be the outer one
template<fourindexsymtype S, typename T, typename I>
Tensor<T> fourindex2tensor(const fourindex_dense<S,T,I> &f);
template<fourindexsymtype S, typename T, typename I>
void tensor2fourindex(const Tensor<T> &t, fourindex_dense<S,T,I> &f);
//conversions from/to fourindex specialized by symmetry type
template<typename T, typename I>
Tensor<T> fourindex2tensor(const fourindex_dense<nosymmetry,T,I> &f)
{
}
template<typename T, typename I>
void tensor2fourindex(const Tensor<T> &t, fourindex_dense<nosymmetry,T,I> &f)
{
}
template <typename T>
std::ostream & operator<<(std::ostream &s, const Tensor<T> &x);