small improvements in tensor/tucker

This commit is contained in:
2025-10-23 17:29:09 +02:00
parent 4bd2761cc5
commit 346ce5bc3a
3 changed files with 34 additions and 8 deletions

View File

@@ -47,6 +47,7 @@
//@@@ will not be particularly efficient
//
//@@@conversions to/from fourindex, optional negarive range for beta spin handling
//@@@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
//
@@ -173,6 +174,7 @@ public:
bool is_flat() const {for(int i=0; i<shape.size(); ++i) if(shape[i].number>1) return false; return true;};
bool is_compressed() const {for(int i=0; i<shape.size(); ++i) if(shape[i].number>1&&shape[i].symmetry!=0) return true; return false;};
bool has_symmetry() const {for(int i=0; i<shape.size(); ++i) if(shape[i].symmetry!=0) return true; return false;};
void clear() {data.clear();};
int rank() const {return myrank;};
int calcrank(); //is computed from shape