pyscf/lib/shciscf/libSHCITools.c
// Only for 8-fold symmetry
Only for 8-fold symmetry
Only for 8 - fold symmetry
void writeERI ( FILE* fOut, double * eri, size_t norb, double tol)
{
  size_t ij = 0;
  size_t kl = 0;
  size_t ijkl = 0;
  size_t n2 = norb*norb;
  size_t n3 = n2*norb;
  size_t i,j,k,l;
  for ( i=0; i<norb; ++i ) {
    for( j=0; j<i+1; ++j ) {
      kl = 0;
      for ( k=0; k<i+1; ++k ) {
	for (l=0; l<k+1; ++l ) {
	  if ( ij >= kl ) { 
	    if ( fabs(eri[ijkl]) > tol ) {
	    fprintf(fOut,  "%20.12e    %zu  %zu  %zu  %zu\n",eri[ ijkl ],i+1,j+1,k+1,l+1);
	    }
	    ++ijkl;
	  }
	  ++kl;
	}
      }
      ++ij;
    }
  }  
}
void writeERI ( FILE * fOut , double * eri , size_t norb , double tol ) { size_t ij = 0 ; size_t kl = 0 ; size_t ijkl = 0 ; size_t n2 = norb * norb ; size_t n3 = n2 * norb ; size_t i , j , k , l ; for ( i = 0 ; i < norb ; ++ i ) { for ( j = 0 ; j < i + 1 ; ++ j ) { kl = 0 ; for ( k = 0 ; k < i + 1 ; ++ k ) { for ( l = 0 ; l < k + 1 ; ++ l ) { if ( ij >= kl ) { if ( fabs ( eri [ ijkl ] ) > tol ) { fprintf ( fOut , " \n " , eri [ ijkl ] , i + 1 , j + 1 , k + 1 , l + 1 ) ; } ++ ijkl ; } ++ kl ; } } ++ ij ; } } }
Only for 8-fold symmetry
Only for 8 - fold symmetry