示例#1
0
void SIAM::get_G()
{
    if (UseLatticeSpecificG)
        #pragma omp parallel for
        for (int i=0; i<N; i++)
        {   complex<double> com = r->omega[i] + r->mu - r->Sigma[i];
            r->G[i] = LS_get_G(LatticeType, t, com);
        }
    else
    {


        #pragma omp parallel for
        for (int i=0; i<N; i++)
        {
            r->G[i] =  1.0
                       / (r->omega[i] + r->mu - epsilon - r->Delta[i] - r->Sigma[i]) ;

            if (ClipOff(r->G[i])) Clipped = true;
        }

        if (Clipped) printf("    !!!!Clipping G!!!!\n");

    }
}
示例#2
0
void SIAM::get_SOCSigma()
{
    double** s = new double*[N];
    #pragma omp parallel for
    for (int i=0; i<N; i++)
    {   //printf("tid: %d i: %d\n",omp_get_thread_num(),i);
        s[i] = new double[N];
        for (int j=0; j<N; j++)
        {   //printf("tid: %d j: %d\n",omp_get_thread_num());
            s[i][j] =   grid->interpl(r->Ap, r->omega[i] - r->omega[j]) * r->P2[j]
                        + grid->interpl(r->Am, r->omega[i] - r->omega[j]) * r->P1[j];
        }

        //integrate

        r->SOCSigma[i] = complex<double>(0.0, - U*U * TrapezIntegral(N, s[i], r->omega) );

        if (ClipOff( r->SOCSigma[i] )) Clipped = true ;
        delete [] s[i];
    }
    delete [] s;
    //int i;
    //cin >> i;
    if (Clipped) printf("    !!!Clipping SOCSigma!!!!\n");
    grid->KramarsKronig( r->SOCSigma );
}
示例#3
0
void SIAM::get_G()
{
  
  for (int i=0; i<N; i++)
  {    
    G[i] =               complex<double>(1.0)
           / (omega[i] + mu /*+ complex<double>(0,eta)*/ - epsilon - Delta[i] - Sigma[i]) ;
    
    if (ClipOff(G[i])) Clipped = true;
  }
  if (Clipped) printf("    !!!!Clipping G!!!!\n");
}
示例#4
0
void SIAM::get_G_CHM()
{

    get_Sigma();

    if (UseLatticeSpecificG)
        #pragma omp parallel for
        for (int i=0; i<N; i++)
        {   complex<double> com = r->omega[i] + r->mu - r->Sigma[i];
            r->G[i] = LS_get_G(LatticeType, t, com);
        }
    else
    {

        complex<double>** g = new complex<double>*[N];
        #pragma omp parallel for
        for (int i=0; i<N; i++)
        {

            //treat integrand carefully
            double D = 0.0;
            complex<double> LogTerm = 0.0;
            if (abs(imag(r->Sigma[i]))<0.1)
            {
                D = grid->interpl(r->NIDOS, r->mu + r->omega[i] - real(r->Sigma[i]));
                LogTerm = complex<double>(D, 0.0) * log( (r->mu + r->omega[i] - r->Sigma[i] + r->omega[N-1])
                          /(r->mu + r->omega[i] - r->Sigma[i] - r->omega[N-1]) );
            }

            //create integrand array
            g[i] = new complex<double>[N];
            for (int j=0; j<N; j++)
                g[i][j] = complex<double>(r->NIDOS[j] - D, 0.0)
                          / ( r->mu + r->omega[i] - r->omega[j] - r->Sigma[i] );


            //integrate to get G
            r->G[i] = TrapezIntegral(N, g[i], r->omega) + LogTerm ;

            if (ClipOff(r->G[i])) Clipped = true;
            delete [] g[i];
        }

        delete [] g;

        if (Clipped) printf("    !!!!Clipping G!!!!\n");

    }
}
示例#5
0
void SIAM::get_G_CHM()
{
  get_Sigma();   
  
  for (int i=0; i<N; i++)
  {
      
    //treat integrand carefully
    double D = 0.0;
    complex<double> LogTerm = 0.0;
    if (abs(imag(Sigma[i]))<0.1) 
    {
      D = grid->interpl(Dos,mu + omega[i]-real(Sigma[i]));/*DOS(DOStype_CHM, t_CHM, mu + omega[i]-real(Sigma[i]));*/
      LogTerm = complex<double>(D, 0.0) * log( (mu + omega[i] - Sigma[i] + omega[N-1])
                                             /(mu + omega[i] - Sigma[i] - omega[N-1]) );
    }

    //create integrand array
    complex<double>* g = new complex<double>[N];
    for (int j=0; j<N; j++)
      g[j] = complex<double>(/*DOS( DOStype_CHM, t_CHM, omega[j] )*/Dos[j] - D, 0.0) 
                           / ( mu + omega[i] - omega[j] - Sigma[i] ); 
    
  

/*   //treat integrand less carefully
   complex<double>* g = new complex<double>[N];
   for (int j=0; j<N; j++)
      g[j] = complex<double>(DOS( DOStype_CHM, t_CHM, omega[j] )) 
                           / ( complex<double>(mu,eta) + omega[i] - omega[j] - Sigma[i] );
   
*/    
    //integrate to get G 
    G[i] = TrapezIntegral(N, g,omega) + LogTerm ; 

    if (ClipOff(G[i])) Clipped = true;
    delete [] g;    
  }
  if (Clipped) printf("    !!!!Clipping G!!!!\n");

}
示例#6
0
void SIAM::get_SOCSigma()
{
  int i,j;

  for (i=0; i<N; i++)
  { 
    //get integrand array
    double* s = new double[N];
    for (j=0; j<N; j++)      
       s[j] =   grid->interpl(Ap,omega[i]-omega[j])*P2[j] 
              + grid->interpl(Am,omega[i]-omega[j])*P1[j];
                         
    //integrate
    SOCSigma[i] = complex<double>(0.0, - U*U * TrapezIntegral(N, s,omega) );    
     
    if (ClipOff(SOCSigma[i])) Clipped = true ;
    delete [] s;
  }
  if (Clipped) printf("    !!!Clipping SOCSigma!!!!\n");
  grid->KramarsKronig(SOCSigma);
}
示例#7
0
bool SIAM::Run_CHM(double n, complex<double>* Delta, //input
                   complex<double>* G_out, complex<double>* Sigma_out, double &mu_out) //output
{  
  if (!Initialized) exit(1);
  Clipped = false;
  for (int i=0; i<N; i++) if (ClipOff(Delta[i])) Clipped = true;
  if (Clipped) printf("    !!! Clipping Delta !!!\n");

  this->n = n;
  this->Delta = Delta;
  //PrintFunc("DeltaSiam",N,Delta,omega);
  this->epsilon = 0;

  if (n==0.5) HalfFilling = true; 
  else HalfFilling = false;
  
  printf("    ------- SIAM for CHM: n=%.3f, U=%.3f, T=%.3f, epsilon=%.3f -------\n", n, U, T, epsilon);
  
  if (HalfFilling) 
  {
    mu = 0.5*U;
    mu0 = 0.0;
    MPT_B = 0.0;
    MPT_B0 = 0.0;
    SymmetricCase = true;
  }

  //------initial guess---------//
  complex<double>* V = new complex<double>[1];
  V[0] = mu0; //initial guess is always the last mu0. in first DMFT iteration it is 0
  //---------------------------//

  printf("     MPT: B = %fe, B0 = %fe\n", MPT_B, MPT_B0);  

  //----------------- CALCULATION ----------------------//
  if (HalfFilling)//and (SymmetricCase))
    get_G0();
  else
    UseBroyden<SIAM>(1, MAX_ITS, Accr, &SIAM::get_G0, this, V);  

  printf("    mu0 = %f\n", mu0);

  printf("Integral G0: %.6f\n",imag(TrapezIntegral(N,G0,omega)));

  get_As();
  get_Ps();
  get_SOCSigma();

  V[0] = mu;
  
  if (HalfFilling)//and (SymmetricCase))
  { if (IsBethe)
    { get_Sigma();
      get_G();  //get_G() !!!! samo proba
  //    printf("        Integral G = %.6f\n",imag(TrapezIntegral(N,G,omega)));
    }
    else
      get_G_CHM();
  }
  else
  { if (IsBethe)
      UseBroyden<SIAM>(1, MAX_ITS, Accr, &SIAM::get_G, this, V);  
    else
      UseBroyden<SIAM>(1, MAX_ITS, Accr, &SIAM::get_G_CHM, this, V);
  }
  MPT_B = get_MPT_B();
  MPT_B0 = get_MPT_B0();

  printf("    mu = %f\n", mu);

  delete [] V;
  //-----------------------------------------------------//

  //output spectral weight if optioned
  if (CheckSpectralWeight)
  {
    printf("        Spectral weight G: %fe\n", -imag(TrapezIntegral(N,G,omega))/pi);
    printf("        Spectral weight G0: %fe\n", -imag(TrapezIntegral(N,G0,omega))/pi);
  }

  //-------- OUTPUT ---------//
  for (int i=0; i<N; i++)
  {
    G_out[i] = G[i];
    Sigma_out[i] = Sigma[i];
  }
  mu_out = mu;
  //-------------------------//
//  printf("     PROVERA: n = %f, U = %f \n",n, U); 
  return Clipped;
}