SyTen

◆ reduce()

template<Rank rank>
void syten::Tensor< rank >::reduce ( EliminateZeros const  ezeros = EliminateZeros::Yes,
bool const  add_cgc = false,
bool const  no_para = false,
bool const  no_zero_check_dense = false 
)

Reduce the number of blocks in the tensor by adding parallel blocks together.

Discards zero-blocks (i.e. blocks where norm(reduced) or norm(cgc) is smaller than SYTEN_ZNORM_THRESHOLD).

When building a tensor from many blocks, first push_back() all blocks and then call reduce() to minimise the overhead from comparisons.

Parameters
ezerosif EliminateZeros::Yes, small tensors arising from large tensors will be removed
add_cgcif true, CGC spaces will be added together if the dense spaces are parallel
no_paraif true, tensor-level parallelisation will be disabled
no_zero_check_denseif true, assumes that dense tensors are never zero unless isZero is set on the block (true e.g. for products)

Finally, in every bin, check all blocks left over. If they are sufficiently large, move them into *this, otherwise drop them.

Referenced by syten::addScaled(), syten::Deparallelise::cols(), syten::Delinearise::cols(), syten::MPS::Lat::U1U1::genFermiBoseLattice(), syten::MPS::Lat::U1U1::genFermiHubbard(), syten::MPS::Lat::U1U1Z::genFermiHubbardKNS(), syten::MPS::Lat::U1U1::genKondoModel(), syten::MPS::Lat::U1U1::gentJ(), syten::Tensor< 6 >::hasCGC(), syten::BTT::operator*=(), syten::IPEPS::ATwoOp::operator+(), syten::operator+=(), syten::IPEPS::SumOp::operator+=(), syten::operator-=(), syten::project(), syten::QR::qr(), syten::Deparallelise::rows(), and syten::SVD::svd().

+ Here is the caller graph for this function: