src/simulators/tensor_network/svd.cpp
//-------------------------------------------------------------
// function name: num_of_SV
// Description: Computes the number of none-zero singular values
//				in S
// Parameters: rvector_t S - vector of singular values from the
//			   SVD decomposition
// Returns: number of elements in S that are greater than 0
//			(actually greater than threshold)
//-------------------------------------------------------------
function name: num_of_SV
Description: Computes the number of none-zero singular values
in S
Parameters: rvector_t S - vector of singular values from the
SVD decomposition
Returns: number of elements in S that are greater than 0
(actually greater than threshold)
function name : num_of_SV Description : Computes the number of none - zero singular values in S Parameters : rvector_t S - vector of singular values from the SVD decomposition Returns : number of elements in S that are greater than 0 ( actually greater than threshold )
uint_t num_of_SV(rvector_t S, double threshold)
{
	uint_t sum = 0;
	for(uint_t i = 0; i < S.size(); ++i)
	{
	  if(std::norm(S[i]) > threshold)
		sum++;
	}
	if (sum == 0)
	  cout << "SV_Num == 0"<< '\n';
	return sum;
}
uint_t num_of_SV ( rvector_t S , double threshold ) { uint_t sum = 0 ; for ( uint_t i = 0 ; i < S . size ( ) ; ++ i ) { if ( std :: norm ( S [ i ] ) > threshold ) sum ++ ; } if ( sum == 0 ) cout << " " << ' \n ' ; return sum ; }
function name: num_of_SV
Description: Computes the number of none-zero singular values
in S
Parameters: rvector_t S - vector of singular values from the
SVD decomposition
Returns: number of elements in S that are greater than 0
(actually greater than threshold)
function name : num_of_SV Description : Computes the number of none - zero singular values in S Parameters : rvector_t S - vector of singular values from the SVD decomposition Returns : number of elements in S that are greater than 0 ( actually greater than threshold )