예제 #1
0
double exact_exchange(int func_id) {
  // Default - no exact exchange.
  double f=0.0;

  if(func_id>0) {
    xc_func_type func;
    if(xc_func_init(&func, func_id, XC_UNPOLARIZED) != 0){
      ERROR_INFO();
      std::ostringstream oss;
      oss << "Functional "<<func_id<<" not found!";
      throw std::runtime_error(oss.str());
    }

    switch(func.info->family)
      {
      case XC_FAMILY_HYB_GGA:
      case XC_FAMILY_HYB_MGGA:
	// libxc prior to 2.0.0
	// f=xc_hyb_gga_exx_coef(func.gga);
	// libxc 2.0.0
	f=xc_hyb_exx_coef(&func);
	break;
      }

    xc_func_end(&func);
  }

  //  printf("Fraction of exact exchange is %f.\n",f);

  return f;
}
예제 #2
0
파일: libxc_itrf.c 프로젝트: yidapa/pyscf
double VXChybrid_coeff(int xc_id, int spin)
{
        xc_func_type func;
        double factor;
        if(xc_func_init(&func, xc_id, spin) != 0){
                fprintf(stderr, "XC functional %d not found\n", xc_id);
                exit(1);
        }
        switch(func.info->family)
        {
                case XC_FAMILY_HYB_GGA:
                case XC_FAMILY_HYB_MGGA:
                        factor = xc_hyb_exx_coef(&func);
                        break;
                default:
                        factor = 0;
        }

        xc_func_end(&func);
        return factor;
}
예제 #3
0
 DFTFunctional(int FUNC_IDENT) { 
   xc_func_init(&functional_,FUNC_IDENT,XC_POLARIZED);
   xHFX = xc_hyb_exx_coef(&functional_);
   //std::cerr << "HYB " << xHFX << std::endl;
 };