16   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    17   MPI_Comm_size(MPI_COMM_WORLD, &num_pes);
    20   int len4[] = {n,n,n,n};
    21   int len5[] = {n,n,n,n,n};
    22   int NNN[] = {
NS,
NS,NS};
    23   int HNNN[] = {
SH,
NS,
NS,NS};
    66   C_ans[
"ijab"] = A[
"ikal"]*B[
"kjlb"];
    68   A_rep[
"ijkal"] += A[
"ijal"];
    69   B_rep[
"ijklb"] += B[
"ijlb"];
    70   Z[
"ijkab"] += A_rep[
"ijkal"]*B_rep[
"ijklb"];
    71   C[
"ijab"] += Z[
"ijkab"];
    75   C[
"ijab"] -= ((double)n)*A[
"ijal"]*B[
"ijlb"];
    76   C[
"ijab"] -= A[
"ikal"]*B[
"iklb"];
    77   C[
"ijab"] -= A[
"ikal"]*B[
"ijlb"];
    78   C[
"ijab"] -= A[
"ijal"]*B[
"iklb"];
   114   Diff[
"ijab"] += C[
"ijab"];
   115   Diff[
"ijab"] -= C_ans[
"ijab"];
   116   double nrm = Diff.
norm2();
   117   int pass = (nrm <=1.E-10);
   120     MPI_Reduce(MPI_IN_PLACE, &pass, 1, MPI_INT, MPI_MIN, 0, MPI_COMM_WORLD);
   121     if (pass) printf(
"{ C[\"(ij)ab\"] = A[\"(ik)al\"]*B[\"(kj)lb\"] } passed\n");
   122     else      printf(
"{ C[\"(ij)ab\"] = A[\"(ik)al\"]*B[\"(kj)lb\"] } failed\n");
   124     MPI_Reduce(&pass, MPI_IN_PLACE, 1, MPI_INT, MPI_MIN, 0, MPI_COMM_WORLD);
   132   char ** itr = std::find(begin, end, option);
   133   if (itr != end && ++itr != end){
   140 int main(
int argc, 
char ** argv){
   142   int const in_num = argc;
   143   char ** input_str = argv;
   145   MPI_Init(&argc, &argv);
   146   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   147   MPI_Comm_size(MPI_COMM_WORLD, &np);
   150     n = atoi(
getCmdOption(input_str, input_str+in_num, 
"-n"));
   155     World dw(MPI_COMM_WORLD, argc, argv);
   157       printf(
"Computing C_(ij)ab = A_(ik)al*B_(kj)lb\n");
 char * getCmdOption(char **begin, char **end, const std::string &option)
an instance of the CTF library (world) on a MPI communicator 
dtype norm2()
computes the frobenius norm of the tensor (needs sqrt()!) 
void fill_random(dtype rmin, dtype rmax)
fills local unique tensor elements to random values in the range [min,max] works only for dtype in {f...
void print(FILE *fp, dtype cutoff) const 
prints tensor data to file using process 0 (modify print(...) overload in set.h if you would like a d...
int fast_sym_4D(int const n, World &ctf)
an instance of a tensor within a CTF world 
int main(int argc, char **argv)