src/Matrix/matrix.cc
// Input	mx	: A matrix (this)
// Output	vect    : A vector of the column norms
//			  of mx
// Note			: I use this to look at unitary
//			  arrays resulting from Hermitian
//			  matrix diagonalizations
Input  mx      : A matrix (this)
Output vect    : A vector of the column norms
of mx
Note                   : I use this to look at unitary
arrays resulting from Hermitian
matrix diagonalizations
Input mx : A matrix ( this ) Output vect : A vector of the column norms of mx Note : I use this to look at unitary arrays resulting from Hermitian matrix diagonalizations
std::vector<double> matrix::ColumnNorms() const
  {
  int i,j,dim=cols();
  double ColNorm, cn;                   
  std::vector<double> ColNorms(dim);		
  for(j=0; j<dim; j++)                  
    {
    ColNorm = 0;                        
    for(i=0; i<dim; i++)                
      {  
      cn = norm(get(i,j));		
      ColNorm += cn*cn;                 
      }  
    ColNorms[j] = sqrt(ColNorm);        
    }
  return ColNorms;
  }
std :: vector < double > matrix :: ColumnNorms ( ) const { int i , j , dim = cols ( ) ; double ColNorm , cn ; std :: vector < double > ColNorms ( dim ) ; for ( j = 0 ; j < dim ; j ++ ) { ColNorm = 0 ; for ( i = 0 ; i < dim ; i ++ ) { cn = norm ( get ( i , j ) ) ; ColNorm += cn * cn ; } ColNorms [ j ] = sqrt ( ColNorm ) ; } return ColNorms ; }
Input  mx      : A matrix (this)
Output vect    : A vector of the column norms
of mx
Note                   : I use this to look at unitary
arrays resulting from Hermitian
matrix diagonalizations
Input mx : A matrix ( this ) Output vect : A vector of the column norms of mx Note : I use this to look at unitary arrays resulting from Hermitian matrix diagonalizations
// For column norms // Allocate column norms array // Loop over the columns // Begin with norm of zero // Loop over the columns // Get norm of <i|U|j> // Add to column sum // Store the column norm