Hot Line Profile of psi.c
  Line      % PID
   822   0.01 ALL
   823   0.01 ALL
   804   0.01 ALL
   619   0.01 ALL
   807   0.01 ALL
   633   0.01 ALL
   637   0.01 ALL
   635   0.01 ALL
   636   0.01 ALL
   806   0.01 ALL
   805   0.00 ALL
   629   0.00 ALL
   632   0.00 ALL
   631   0.00 ALL
   624   0.00 ALL
   643   0.00 ALL
   802   0.00 ALL
   641   0.00 ALL
   617   0.00 ALL
   639   0.00 ALL
   910   0.00 ALL
   931   0.00 ALL
   614   0.00 ALL
  1185   0.00 ALL
  1195   0.00 ALL
  1167   0.00 ALL
  1136   0.00 ALL
   928   0.00 ALL
   813   0.00 ALL
   900   0.00 ALL
   821   0.00 ALL
  1174   0.00 ALL
   581   0.00 ALL
   815   0.00 ALL
   422   0.00 ALL
  1202   0.00 ALL
  1198   0.00 ALL
   814   0.00 ALL
  1494   0.00 ALL
  1473   0.00 ALL
   839   0.00 ALL
  1173   0.00 ALL
  1163   0.00 ALL
  1212   0.00 ALL
  1367   0.00 ALL
   883   0.00 ALL
  1168   0.00 ALL
   838   0.00 ALL
   796   0.00 ALL
  1197   0.00 ALL
   879   0.00 ALL
  1535   0.00 ALL
  1531   0.00 ALL
   797   0.00 ALL
  1213   0.00 ALL
  1464   0.00 ALL
  1463   0.00 ALL
   425   0.00 ALL
  1184   0.00 ALL
   411   0.00 ALL
  1424   0.00 ALL
  1421   0.00 ALL
  1378   0.00 ALL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
	Total % for .fill_det_and_all_derivatives = 0.06
  Line      % Source
   581   0.00     if (RESCALE) {
   582      - 	* scale = * scale * DEFAULT_PSI_SCALE_FACTOR;
   583      -
   584      - 	for (orb=0; orb<det->size;orb++) {
   585      - 	    for (elec_idx=0; elec_idx < filled->phi->size2 ;elec_idx++) {
   586      - 		MO = gsl_matrix_get(det->matrix,orb,elec_idx);
   587      - 		dx = gsl_matrix_get(det->gradxorb,orb,elec_idx);
   588      - 		dy = gsl_matrix_get(det->gradyorb,orb,elec_idx);
   589      - 		dz = gsl_matrix_get(det->gradzorb,orb,elec_idx);
   590      - 		lap = gsl_matrix_get(det->laplacianorb,orb,elec_idx);
   591      -
   592      - 		gsl_matrix_set(det->matrix,orb,elec_idx,
   593      - 			       MO*DEFAULT_PSI_SCALE_FACTOR);
   594      - 		gsl_matrix_set(det->gradxorb,orb,elec_idx,
   595      - 			       dx*DEFAULT_PSI_SCALE_FACTOR);
   596      - 		gsl_matrix_set(det->gradyorb,orb,elec_idx,
   597      - 			       dy*DEFAULT_PSI_SCALE_FACTOR);
   598      - 		gsl_matrix_set(det->gradzorb,orb,elec_idx,
   599      - 			       dz*DEFAULT_PSI_SCALE_FACTOR);
   600      - 		gsl_matrix_set(det->laplacianorb,orb,elec_idx,lap*DEFAULT_PSI_SCALE_FACTOR);
   601      - 		//if ((orb==0) && (elec== 0)) {
   602      - 		    //m_message("Orb %d Elec %d Entries now are %e %e %e %e %e",orb, elec,
   603      - 		    //	       MO*DEFAULT_PSI_SCALE_FACTOR,
   604      - 		    //       dx*DEFAULT_PSI_SCALE_FACTOR, dy*DEFAULT_PSI_SCALE_FACTOR,
   605      - 		    //       dz*DEFAULT_PSI_SCALE_FACTOR, lap*DEFAULT_PSI_SCALE_FACTOR);
   606      - 		//}
   607      - 	    }// end elecs
   608      - 	}//end orb
   609      -     }
   610      -
   611      -     else {
   612      -
   613      -     // fortran array indexes start in ONE
   614   0.00     for (orb=0; orb<det->size;orb++) {
   615      - 	//m_message("MO: %d", gsl_vector_int_get(&(mos.vector),orb));
   616      -
   617   0.00 	for (elec_idx=0; elec_idx < filled->phi->size2; elec_idx++) {
   618      - 	    //m_message("Elec_idx: %d",elec_idx);
   619   0.01 	    orbfortran = gsl_vector_int_get(&(mos.vector),orb);
   620      -
   621      - 	    //mo_eval_orb( (MODepot *) orbitals, &x, &y, &z,
   622      - 	    //&orbfortran, &MO, &dx, &dy, &dz, &lap,
   623      - 	    //GRADIENT, LAPLACIAN);
   624   0.00 	    MO = gsl_matrix_get(filled->phi,orbfortran,elec_idx);
   625      - 	    //m_message("Setting orb %d elec_idx %d size_1 %d size_2 %d to %d",
   626      - 	    //	      orb, elec_idx, det->matrix->size1, det->matrix->size2, orbfortran);
   627      - 	    //	    mo_message("ORBITAL_CHECK: Electron %d Orbital %d Mo %e",
   628      - 	    //		       elec_idx,orb,MO);
   629   0.00 	    gsl_matrix_set(det->matrix,orb,elec_idx,*(scale)*MO);
   630      - 	    if (GRADIENT) {
   631   0.00 		dx = gsl_matrix_get(filled->gradx,orbfortran,elec_idx);
   632   0.00 		dy = gsl_matrix_get(filled->grady,orbfortran,elec_idx);
   633   0.01 		dz = gsl_matrix_get(filled->gradz,orbfortran,elec_idx);
   634      -
   635   0.01 		gsl_matrix_set(det->gradxorb,orb,elec_idx,*(scale)*dx);
   636   0.01 		gsl_matrix_set(det->gradyorb,orb,elec_idx,*(scale)*dy);
   637   0.01 		gsl_matrix_set(det->gradzorb,orb,elec_idx,*(scale)*dz);
   638      - 	    }
   639   0.00 	    if (LAPLACIAN) {
   640      -
   641   0.00 		lap = gsl_matrix_get(filled->laplacian,orbfortran,elec_idx);
   642      -
   643   0.00 		gsl_matrix_set(det->laplacianorb,orb,elec_idx,*(scale)*lap);
   644      - 	    }
   645      - 	    //gsl_matrix_fprintf(stdout,det->laplacianorb,"%f");
   646      - 	    // gsl_vector_fprintf(stdout,scale,"%f");
   647      - 	} //end elec(tron)
   648      -     }//end orb(ital)
   649      -
   650      -     }
   651      -     return TRUE;
   652      - }
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
	Total % for .get_det_derivatives_ln = 0.05
  Line      % Source
   786      -     double inverse=0.0; //temporary inverse of the matrix
   787      -     double dotprod=0.0;
   788      -     for (i=0;i<det->size;i++) {///along diagonal of the matrix
   789      - 	/*! c.f. Nichols and Romero, Eq. (22)
   790      - 	  note that there are nonzero columns (electrons) for the
   791      - 	  derivative in case of single particle orbitals, so the trace
   792      - 	  goes over one element only.
   793      - 	  Also see Eq. 32 of the same document to see what we are doing for the Laplacian
   794      - 	*/
   795      - 	derivx=0.0;
   796   0.00 	derivy=0.0;
   797   0.00 	derivz=0.0;
   798      - 	derivsqx=0.0;
   799      - 	derivsqy=0.0;
   800      - 	derivsqz=0.0;
   801      -
   802   0.00 	for (j=0;j<det->size;j++) {//along rows
   803      - 		//why i,j? Matrix multiplication
   804   0.01 		inverse = gsl_matrix_get(det->inverse,i,j);
   805   0.00 		dx = gsl_matrix_get(det->gradxorb,j,i);
   806   0.01 		dy = gsl_matrix_get(det->gradyorb,j,i);
   807   0.01 		dz = gsl_matrix_get(det->gradzorb,j,i);
   808      - 		derivx = derivx + dx*inverse;
   809      - 		derivy = derivy + dy*inverse;
   810      - 		derivz = derivz + dz*inverse;
   811      - 	}//end for along rows
   812      -
   813   0.00 	gsl_vector_set(det->gradln,i*3,derivx);
   814   0.00 	gsl_vector_set(det->gradln,i*3+1,derivy);
   815   0.00 	gsl_vector_set(det->gradln,i*3+2,derivz);
   816      -     }//end of along diagonal
   817      -
   818      -     if(GET_LAPLACIAN) {
   819      - 	//Formula BXX in WAL's QMC Blue book
   820      - 	det->lapln=0;
   821   0.00 	for (i=0;i<det->size;i++) {
   822   0.01 	    for (j=0;j<det->size;j++) {
   823   0.01 		det->lapln=det->lapln+gsl_matrix_get(det->laplacianorb,i,j)*
   824      - 		    gsl_matrix_get(det->inverse,j,i);
   825      - 	    }
   826      -
   827      - 	}
   828      - 	gsl_blas_ddot(det->gradln,
   829      - 		      det->gradln,
   830      - 		      &dotprod);
   831      -
   832      - 	//m_message("Dot prod is %f",dotprod);
   833      -
   834      - 	det->lapln = det->lapln - dotprod;
   835      -
   836      -     }
   837      -
   838   0.00        return TRUE;
   839   0.00 }
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
	Total % for .psi_adjust_column = 0.00
  Line      % Source
  1131      -       Columns *c=NULL;
  1132      -
  1133      -       U = (Universe *) psi;
  1134      -
  1135      -
  1136   0.00       c = COLUMN_PTR(depot,0);
  1137      -       if (NUM_ALPHA(U->psianti)>electron) {
  1138      - 	start = 0;
  1139      - 	filled = U->psianti.filledalpha;
  1140      - 	/*mo_message("Electron %d, Electron-Start %d c->det_bet->size1 %d
  1141      - filled->phi->size_1 %d filled->phi->size_2 %d",
  1142      - 		   electron, electron-start, c->det_bet->size, filled->phi->size1,
  1143      - 		   filled->phi->size2);*/
  1144      - 	  gsl_matrix_get_col (c->det_alp,filled->phi,electron);
  1145      - 	  gsl_matrix_get_col (c->dx_alp,filled->gradx,electron);
  1146      - 	  gsl_matrix_get_col (c->dy_alp,filled->grady,electron);
  1147      - 	  gsl_matrix_get_col (c->dz_alp,filled->gradz,electron);
  1148      - 	  gsl_matrix_get_col (c->lap_alp,filled->laplacian,electron);
  1149      -
  1150      -       }
  1151      -
  1152      -       else {
  1153      - 	  start = NUM_ALPHA(U->psianti);
  1154      - 	  filled = U->psianti.filledbeta;
  1155      - 	  /*mo_message("Electron %d, Electron-Start %d c->det_bet->size1 %d
  1156      - filled->phi->size_1 %d filled->phi->size_2 %d",
  1157      - 		     electron, electron-start, c->det_bet->size, filled->phi->size1,
  1158      - 		     filled->phi->size2);*/
  1159      - 	  //m_message("electron %d",electron-start);
  1160      - 	  gsl_matrix_get_col (c->det_bet,filled->phi,electron-start);
  1161      - 	  gsl_matrix_get_col (c->dx_bet,filled->gradx,electron-start);
  1162      - 	  gsl_matrix_get_col (c->dy_bet,filled->grady,electron-start);
  1163   0.00 	  gsl_matrix_get_col (c->dz_bet,filled->gradz,electron-start);
  1164      - 	  gsl_matrix_get_col (c->lap_bet,filled->laplacian,electron-start);
  1165      -       }
  1166      -
  1167   0.00       for (column=0; column < filled->columns->size; column ++) {
  1168   0.00 	  orb = gsl_vector_int_get(filled->columns, column);
  1169      - 	  //m_message("column %d, orb %d columns->size %d", column, orb, filled->columns->size);
  1170      - 	  //for (elec = start;elec < (filled->phi->size2 + start); elec++) {
  1171      - 	  elec = electron;
  1172      - 	  d_idx = elec*3;
  1173   0.00 	  x = gsl_vector_get(r, d_idx);
  1174   0.00 	  y = gsl_vector_get(r, d_idx+1);
  1175      - 	  z = gsl_vector_get(r, d_idx+2);
  1176      - #ifdef LIBORBITALS
  1177      - 	  orb = orb +1;
  1178      -
  1179      - 	  dametodo_(&x,&y,&z,
  1180      - 		    &orb,&MO,
  1181      - 		    &dx,&dy,&dz,
  1182      - 		    &lap);
  1183      - #else
  1184   0.00 	  ((MODepot*) U->psianti.orbitals)->current_electron = (size_t) electron;
  1185   0.00 	  mo_eval_orb( (MODepot *) U->psianti.orbitals,
  1186      - 		       &x, &y, &z,
  1187      - 		       &orb, &MO, &dx, &dy, &dz, &lap,
  1188      - 		       TRUE, TRUE);
  1189      -
  1190      - #endif
  1191      - 	  elec_idx = elec - start;
  1192      - 	  //m_message("elec %d elec_idx: %d orb %d size_2 %d size_1 %d columns_size %d",elec,
  1193      - 	  //	    elec_idx, orb,
  1194      - 	  //	    filled->phi->size2, filled->phi->size1, filled->columns->size);
  1195   0.00 	  gsl_matrix_set(filled->phi, orb,elec_idx,MO);
  1196      - 	  if (GRADIENT) {
  1197   0.00 	      gsl_matrix_set(filled->gradx, orb, elec_idx,dx);
  1198   0.00 	      gsl_matrix_set(filled->grady, orb, elec_idx,dy);
  1199      - 	      gsl_matrix_set(filled->gradz, orb, elec_idx,dz);
  1200      - 	  }
  1201      - 	  if (LAPLACIAN) {
  1202   0.00 	      gsl_matrix_set(filled->laplacian,orb,elec_idx,lap);
  1203      - 	  }
  1204      - 	  // }//end electron
  1205      -       }//end column
  1206      -       //}//end spin
  1207      -       /* 	 	for (orb=0; orb<det->size;orb++) { */
  1208      -       /* 	    	for (elec=start; elec<det->size+start;elec++) { */
  1209      -
  1210      -       /* 	    } */
  1211      -
  1212   0.00       return TRUE;
  1213   0.00 }
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
	Total % for .get_ci_derivatives = 0.00
  Line      % Source
   879   0.00     U = (Universe *) psi;
   880      -     U->psianti.det_psi=0;
   881      -     U->psianti.det_lap=0;
   882      -     gsl_vector_set_zero(U->psianti.det_grad);
   883   0.00     for (i=0;i<U->psianti.ndet;i++){
   884      - 	nalpha = gsl_vector_int_get(U->psianti.nalpha,i);
   885      - 	nbeta = gsl_vector_int_get(U->psianti.nbeta,i);
   886      - 	cicoef= gsl_vector_get(U->psianti.cicoef,i);
   887      - 	//getting Psi
   888      - 	U->psianti.det_psi = U->psianti.det_psi +
   889      - 	    cicoef*
   890      - 	    U->psianti.detalpha[i].det*
   891      - 	    U->psianti.detbeta[i].det;
   892      -
   893      - 	//FIXME: test for cross product (it is always zero)
   894      - 	//gsl_vector_set_zero(U->scratch.r_scratch);
   895      - 	//gsl_vector_set_zero(U->scratch.r_scratch2);
   896      -
   897      - 	// getting the gradient for alpha electrons
   898      - 	for (j=0;j<nalpha*3;j++) {
   899      - 	    k=j;
   900   0.00 	    gradln=gsl_vector_get(U->psianti.detalpha[i].gradln,j);
   901      - 	    //converting from the logarithmic gradient to the determinant
   902      - 	    //gradient
   903      - 	    grad=gradln*U->psianti.detalpha[i].det;
   904      - 	    /* m_message("Alpha coordinate %d det %f cicoef %f gradln %f, grad %f ",
   905      - 		      k,
   906      - 		      U->psianti.detalpha[i].det,
   907      - 		      cicoef,
   908      - 		      gradln,
   909      - 		      grad); */
   910   0.00 	    gsl_vector_set(U->psianti.det_grad, k,
   911      - 			   gsl_vector_get(U->psianti.det_grad,k) +
   912      - 			   U->psianti.detbeta[i].det*
   913      - 			   cicoef*
   914      - 			   grad);
   915      - 	    //TEST
   916      - 	    //gsl_vector_set(U->scratch.r_scratch, k,
   917      - 	    //	   gsl_vector_get(U->psianti.det_grad,k) +
   918      - 	    ///	   U->psianti.detbeta[i].det*
   919      - 	    //	   cicoef*
   920      - 	    //	   grad);
   921      -
   922      - 	}//end alpha coordinate
   923      - 	// getting the gradient for beta electrons
   924      - 	for (j=0;j<nbeta*3;j++) {
   925      - 	    k=3*nalpha+j;
   926      - 	    //converting from the logarithmic gradient to the determinant
   927      - 	    //gradient
   928   0.00 	    gradln=gsl_vector_get(U->psianti.detbeta[i].gradln,j);
   929      - 	    grad=gradln*U->psianti.detbeta[i].det;
   930      - 	    /*m_message("Beta coordinate %d ",k);*/
   931   0.00 	    gsl_vector_set(U->psianti.det_grad,k,
   932      - 			   gsl_vector_get(U->psianti.det_grad,k) +
   933      - 			       U->psianti.detalpha[i].det*
   934      - 			   cicoef*
   935      - 			   grad);
   936      - 	    //TEST
   937      - 	    //gsl_vector_set(U->scratch.r_scratch2,k,
   938      - 	    //		   gsl_vector_get(U->psianti.det_grad,k) +
   939      - 	    //	   U->psianti.detalpha[i].det*
   940      - 	    //	   cicoef*
   941      - 	    //	   grad);
   942      -
   943      - 	}//end beta coordinate
   944      - 	//GETTING THE LAPLACIAN
   945      - 	// alpha electrons
   946      - 	// note that the cross term 2gradAlpha*gradBeta cancels because the
   947      - 	// dot product is zero, and that we get the laplacian (lap) from
   948      - 	// the ln(Lap) following Nichols and Romero's formula # (9)
   949      - 	if (GET_LAPLACIAN) {
   950      - 	    //for (j=0; j<nalpha;j++) {
   951      - 		gsl_blas_ddot(U->psianti.detalpha[i].gradln,
   952      - 			      U->psianti.detalpha[i].gradln,
   953      - 			      &dotprod);
   954      - 		lap = U->psianti.detalpha[i].det*
   955      - 		    (U->psianti.detalpha[i].lapln +
   956      - 		     dotprod);
   957      -
   958      - 		U->psianti.det_lap = U->psianti.det_lap +
   959      - 		    cicoef * U->psianti.detbeta[i].det * lap;
   960      - 		//}
   961      - 	    //beta electrons
   962      - 		//for (j=0; j<nbeta;j++) {
   963      - 		gsl_blas_ddot(U->psianti.detbeta[i].gradln,
   964      - 			      U->psianti.detbeta[i].gradln,
   965      - 			      &dotprod);
   966      - 		lap = U->psianti.detbeta[i].det*
   967      - 		    (U->psianti.detbeta[i].lapln +
   968      - 		     dotprod);
   969      -
   970      -
   971      - 		U->psianti.det_lap = U->psianti.det_lap +
   972      - 		    cicoef * U->psianti.detalpha[i].det * lap;
   973      -
   974      - 		//gsl_blas_ddot(U->scratch.r_scratch,
   975      - 		//	      U->scratch.r_scratch2,
   976      - 		//	      &dotprod);
   977      -
   978      - 		//U->psianti.det_lap = U->psianti.det_lap +
   979      - 		//   2*cicoef*dotprod;
   980      - 		//}//end for
   981      - 	}//end Laplacian
   982      -
   983      -     }// end for determinants
   984      -
   985      -     return TRUE;
   986      - }
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
	Total % for .update_fill_dets = 0.00
  Line      % Source
  1450      -     gboolean rescale = FALSE;
  1451      -     ZoriDeterminant * d;
  1452      -
  1453      -     U = (Universe *) psi;
  1454      -
  1455      -     //Let's start filling the determinants with stuff
  1456      -     //FIXME: For now, fill every determinant with stuff
  1457      -     //Specially for derivatives, maybe we just need to fill the trace of them
  1458      -
  1459      -     //my_gsl_vector_fprintf(stdout,r,5,3,6);
  1460      -
  1461      -     psi_adjust_column(r,psi,electron,depot,TRUE,GRADIENT,LAPLACIAN,scale);
  1462      -
  1463   0.00     for (i=0;i<U->psianti.ndet;i++){
  1464   0.00 	n_alpha= gsl_vector_int_get(U->psianti.nalpha,i);
  1465      - 	//m_message("Determinant! %d alpha",i);
  1466      -
  1467      - 	det_not_zero = TRUE;
  1468      - 	rescale = FALSE;
  1469      - 	// First do the alphas, then the betas
  1470      - 	do {
  1471      - 	    //m_message("Scale is now %e Rescale is %d", *scale, rescale);
  1472      - 	    //m_message("Filling alpha det # %d", i);
  1473   0.00 	    fill_det_and_all_derivatives(r,
  1474      - 					 0,
  1475      - 					 gsl_matrix_int_row(U->psianti.moalpha,i),
  1476      - 					 &(U->psianti.detalpha[i]),
  1477      - 					 U->psianti.orbitals,
  1478      - 					 U->psianti.filledalpha,
  1479      - 					 GRADIENT, LAPLACIAN, scale, rescale);
  1480      - 	    /*	    update_fill_det_and_all_derivatives(r,
  1481      - 						0, electron,
  1482      - 					 gsl_matrix_int_row(U->psianti.moalpha,i),
  1483      - 					 &(U->psianti.detalpha[i]),
  1484      - 					 U->psianti.orbitals,
  1485      - 					 U->psianti.filledalpha,
  1486      - 					 GRADIENT, LAPLACIAN, scale, rescale);*/
  1487      - 	//m_message("Determinant! %d beta",i);
  1488      - 	    if(CALC_DET||GRADIENT||LAPLACIAN) {
  1489      - 		set_determinant_via_LU_decomp(&(U->psianti.detalpha[i]),
  1490      - 					      (GRADIENT||LAPLACIAN));
  1491      - 	    }
  1492      - 	    d = &(U->psianti.detalpha[i]);
  1493      - 	    //m_message("Determinant (alpha) %e", d->det);
  1494   0.00 	    if (fabs(d->det) < 1.0) {
  1495      - 		rescale  = TRUE;
  1496      - 		det_not_zero = FALSE;
  1497      - 		//m_message("Alpha was zero!");
  1498      - 	    }
  1499      - 	    else {
  1500      - 		rescale = FALSE;
  1501      - 		det_not_zero = TRUE;
  1502      - 		//m_message("Done!");
  1503      - 	    }
  1504      -
  1505      - 	}//end do
  1506      - //	while (!det_not_zero && U->psianti.autoscale);
  1507      - 	while (!det_not_zero && U->psianti.autoscale);
  1508      -
  1509      - 	// NOW, the Beta electrons
  1510      -
  1511      - 	det_not_zero = TRUE;
  1512      - 	rescale = FALSE;
  1513      - 	do {
  1514      - 	    //m_message("Filling beta det # %d", i);
  1515      - 	    fill_det_and_all_derivatives(r,
  1516      - 					 n_alpha,
  1517      - 					 gsl_matrix_int_row(U->psianti.mobeta,i),
  1518      - 					 &(U->psianti.detbeta[i]),
  1519      - 					 U->psianti.orbitals,
  1520      - 					 U->psianti.filledbeta,
  1521      - 					 GRADIENT, LAPLACIAN, scale, rescale);
  1522      - 	    /*update_fill_det_and_all_derivatives(r,
  1523      - 					 n_alpha, electron-n_alpha,
  1524      - 					 gsl_matrix_int_row(U->psianti.mobeta,i),
  1525      - 					 &(U->psianti.detbeta[i]),
  1526      - 					 U->psianti.orbitals,
  1527      - 					 U->psianti.filledbeta,
  1528      - 					 GRADIENT, LAPLACIAN, scale, rescale);*/
  1529      - 	    if(CALC_DET||GRADIENT||LAPLACIAN) {
  1530      - 		set_determinant_via_LU_decomp(&(U->psianti.detbeta[i]),
  1531   0.00 					      (GRADIENT||LAPLACIAN));
  1532      -
  1533      - 	    }
  1534      -
  1535   0.00 	    d = &(U->psianti.detbeta[i]);
  1536      - 	    //m_message("Determinant (beta) %e", d->det);
  1537      - 	    if (fabs(d->det) <= (1.0)) {
  1538      - 		rescale = TRUE;
  1539      - 		det_not_zero = FALSE;
  1540      - 		//m_message("Beta was zero!");
  1541      - 	    }
  1542      - 	    else {
  1543      - 		rescale = FALSE;
  1544      - 		det_not_zero = TRUE;
  1545      - 		//m_message("Beta done!");
  1546      - 	    }
  1547      -
  1548      -
  1549      - 	}//end do
  1550      - 	while (!det_not_zero && U->psianti.autoscale);
  1551      -
  1552      -
  1553      -
  1554      -     }//end for determinants (i)
  1555      -
  1556      -     return TRUE;
  1557      - }
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
	Total % for .fill_orbitals = 0.00
  Line      % Source
   375      -       U = (Universe *) psi;
   376      -       depot = (MODepot *) U->psianti.orbitals;
   377      - #endif
   378      -
   379      -
   380      -       for (spin = 0 ; spin < 2 ; spin++) {
   381      - 	  if (spin==0) {
   382      - 	      //m_message("ALPHA!");
   383      - 	      start = 0;
   384      - 	      filled = U->psianti.filledalpha;
   385      - 	  }
   386      - 	  else {
   387      - 	      //m_message("BETA!");
   388      - 	      start = NUM_ALPHA(U->psianti);
   389      - 	      filled = U->psianti.filledbeta;
   390      - 	  }
   391      - 	  //m_message("column %d, orb %d columns->size %d", column, orb, filled->columns->size);
   392      - 	  for (elec = start;elec < (filled->phi->size2 + start); elec++) {
   393      -
   394      - 	      for (column=0; column < filled->columns->size; column ++) {
   395      - 		  orb = gsl_vector_int_get(filled->columns, column);
   396      -
   397      - 		  d_idx = elec*3;
   398      - 		  x = gsl_vector_get(r, d_idx);
   399      - 		  y = gsl_vector_get(r, d_idx+1);
   400      - 		  z = gsl_vector_get(r, d_idx+2);
   401      - #ifdef LIBORBITALS
   402      - 		  orb = orb +1;
   403      -
   404      - 		  dametodo_(&x,&y,&z,
   405      - 		      &orb,&MO,
   406      - 		      &dx,&dy,&dz,
   407      - 			    &lap);
   408      - #else
   409      -
   410      - 		  depot->current_electron = (size_t) elec;
   411   0.00 		  mo_eval_orb( depot,
   412      - 			       &x, &y, &z,
   413      - 			       &orb, &MO, &dx, &dy, &dz, &lap,
   414      - 			       GRADIENT, LAPLACIAN);
   415      -
   416      - #endif
   417      - 		  elec_idx = elec - start;
   418      - 		  //printf("elec %d elec_idx: %d orb %d size_2 %d size_1 %d columns_size %d\n",elec,
   419      - 		  //	    elec_idx, orb,
   420      - 		  //	    filled->phi->size2, filled->phi->size1, filled->columns->size);
   421      -
   422   0.00 		  gsl_matrix_set(filled->phi, orb,elec_idx,MO);
   423      - 		  if (GRADIENT) {
   424      - 		      gsl_matrix_set(filled->gradx, orb, elec_idx,dx);
   425   0.00 		      gsl_matrix_set(filled->grady, orb, elec_idx,dy);
   426      - 		      gsl_matrix_set(filled->gradz, orb, elec_idx,dz);
   427      - 		  }
   428      - 		  if (LAPLACIAN) {
   429      - 		      gsl_matrix_set(filled->laplacian,orb,elec_idx,lap);
   430      - 		  }
   431      - #ifdef DEBUG_PSI_MO_VALUES
   432      - 		  mo_message("electron %d elec_idx %d orb %d MO %20.15e",
   433      - 			     elec, elec_idx,
   434      - 			     orb,
   435      - 			     MO);
   436      - #endif
   437      - 	      }//end column
   438      - 	  }//end electron
   439      -       }//end spin
   440      -       /* 	 	for (orb=0; orb<det->size;orb++) { */
   441      - /* 	    	for (elec=start; elec<det->size+start;elec++) { */
   442      -
   443      - /* 	    } */
   444      -
   445      -     return TRUE;
   446      - }
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
	Total % for .update_psi = 0.00
  Line      % Source
  1364      -     U = (Universe *) s->psi;
  1365      -     //assemble the wave function
  1366      -
  1367   0.00     if(!OPTIMIZE) {
  1368      - 	//if (!(w->flags & CURRENT_DETS)) {
  1369      - 	update_fill_dets(w->r,s->psi,electron,depot,TRUE,GRADIENT,LAPLACIAN,&(w->orb_scale));
  1370      -
  1371      - 	    //}
  1372      - 	if (GRADIENT||LAPLACIAN||THIRD_DERIVATIVE) {
  1373      - 	    get_dets_derivatives_ln(s->psi,(LAPLACIAN||THIRD_DERIVATIVE));
  1374      - 	    get_ci_derivatives(s->psi, (LAPLACIAN||THIRD_DERIVATIVE));
  1375      - 	}
  1376      -     }
  1377      -     //compose correlation
  1378   0.00     x=gsl_vector_get(w->r,(electron*3)+0);
  1379      -     y=gsl_vector_get(w->r,(electron*3)+1);
  1380      -     z=gsl_vector_get(w->r,(electron*3)+2);
  1381      -     compose_correlation_update (w,s, electron,&x,&y,&z);
  1382      -     //assemble the wave function:
  1383      -
  1384      -     if (!OPTIMIZE) {
  1385      - 	w->psi_t = U->psianti.det_psi * U->psianti.corr_psi;
  1386      - 	//the gradient
  1387      - 	if (GRADIENT||LAPLACIAN||THIRD_DERIVATIVE)
  1388      - 	    gsl_vector_memcpy(U->scratch.r_scratch, U->psianti.det_grad);
  1389      -     }
  1390      -     else {
  1391      - 	//use stored info in the walker
  1392      - 	w->psi_t = w->psi_t_det->f * U->psianti.corr_psi;
  1393      - 	//the gradient
  1394      - 	if (GRADIENT||LAPLACIAN||THIRD_DERIVATIVE)
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<