Beispiel #1
0
void SIAM::get_G0(complex<double>* V)
{
  mu0 = real(V[0]);

  get_G0();

  V[0] = mu0 + get_n(G0) - n;
} 
Beispiel #2
0
void IASIAM::get_G0(complex<double>* V)
{
  mu0 = real(V[0]);

  get_G0();
  
  r->n0 = get_n(r->G0);
  
  V[0] = mu0 + r->n0 - r->n;
  printf("get_G0: V[0] = %.5f\n",real(V[0]));
} 
Beispiel #3
0
void SIAM::SolveSiam(complex<double>* V)
{
  mu0 = real(V[0]);
  MPT_B = real(V[1]);

  //--------------------//
  get_G0();

  n = get_n(G0);
  MPT_B0 = get_MPT_B0();  

  get_As();
  get_Ps();
  get_SOCSigma();
  get_Sigma();   
  get_G();
  //--------------------//

  V[0] = mu0 + (get_n(G) - n); //we need to satisfy (get_n(G) == n) and 
  V[1] = get_MPT_B();          //                (MPT_B == get_MPT_B())
}
Beispiel #4
0
void IASIAM::SolveSiam(complex<double>* V)
{
  mu0 = real(V[0]);

  //--------------------//
  //printf("IASIAM: about to get G0\n");
  get_G0();
  //printf("IASIAM: about to get n\n");
  r->n0 = get_n(r->G0); 
  r->n = r->n0;

  //printf("IASIAM: about to get n\n");
  fft->FtoT(r->G0, r->G0_tau);
  get_SOCSigma_tau();
  fft->TtoF(r->SOCSigma_tau, r->SOCSigma);

  get_G();
   
  r->n = get_n(r->G);
  //--------------------//

  V[0] = mu0 + (r->n - r->n0); //we need to satisfy (get_n(G) == n) and 
}
Beispiel #5
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;
}
Beispiel #6
0
bool IASIAM::Run_CHM(IAResult* r) //output
{  
  this->r = r;
  N = r->iagrid->get_N();
  iagrid = r->iagrid;

  epsilon = 0;
 
  printf("    ------- IASIAM for CHM: n=%.3f, U=%.3f, T=%.3f, epsilon=%.3f -------\n", r->n, U, T, epsilon);
  
  //----------------- CALCULATION ----------------------//
  if (PHSymmetricCase)
  {
    mu0 = 0.0;
    get_G0();
  }
  else
  { 
    complex<double>* V = new complex<double>[1];
    //------initial guess---------//
    V[0] = r->mu0; //initial guess is always the last mu0. in first DMFT iteration it is 0
    //---------------------------//

    printf("         IASIAM: about to calc mu0. at the moment: mu0 = %.3f mu=%.3f\n",r->mu0, r->mu);
    double initGuesses [] = {-1.0, 1.0, 0.3, -0.3, 0.1, -0.1, 
                             -0.8, 0.8, -0.6, 0.6, -0.7, 0.7,
                             -3.0, 3.0, 0.9, -0.9, 0.05, -0.05, 
                              0.5, -0.5, 0.2, -0.2, 2.0, -2.0};
    
    bool converged = false; 

    int i;
    for (i=0; ( (i<sizeof(initGuesses)/sizeof(double)) and (i<max_tries) ); i++)
    {  printf("------ IASIAM: trying with init guess: %f\n",real(V[0]));
       converged = UseBroyden<IASIAM>(1, 50, 1e-8, &IASIAM::get_G0, this, V);  
     if (converged) break;
     else V[0] = initGuesses[i];
    }
    if ((i==max_tries)and(!converged))
    {  V[0] = initGuesses[0]; 
       Amoeba(Accr, V, &IASIAM::get_G0); 
    }
    delete [] V;
  }
  r->mu0 = mu0;
  //PrintFunc("G0", N, r->G0, r->omega);
  printf("    mu0 = %f\n", mu0);
  
  fft->FtoT(r->G0, r->G0_tau);
  get_SOCSigma_tau();
  fft->TtoF(r->SOCSigma_tau, r->SOCSigma);

  if (PHSymmetricCase)
  { r->mu = 0.5*U;
    r->n=0.5;
    get_G();
  }
  else
  { 
    complex<double>* V = new complex<double>[1];
    V[0] = r->mu;

    double initGuesses [] = {-1.0, 1.0, -0.8, 0.8, -0.6, 0.6, 0.2, -0.2, 2.0, -2.0};
    
    bool converged = false; 

    int i;
    for (i=0; ( (i<sizeof(initGuesses)/sizeof(double)) and (i<max_tries) ); i++)
    {  printf("------ IASIAM: trying with init guess: %f\n",real(V[0]));
       converged = UseBroyden<IASIAM>(1, MAX_ITS, 1e-8, &IASIAM::get_G, this, V);
       if (converged){ break; }
       else V[0] = initGuesses[i];
       
    }
    if ((i==max_tries)and(!converged))
    {  V[0] = initGuesses[0]; 
       Amoeba(Accr, V, &IASIAM::get_G); 
    }
    delete [] V;
  }
  printf("    mu = %f\n", r->mu);

  //-----------------------------------------------------//

  return false;
}
Beispiel #7
0
bool SIAM::Run_CHM(Result* r) //output
{
    this->r = r;
    N = r->grid->get_N();
    grid = r->grid;
    get_fermi();

    Clipped = false;

    epsilon = 0;

    if (r->n==0.5) HalfFilling = true;
    else HalfFilling = false;

    printf("    ------- SIAM for CHM: n=%.3f, U=%.3f, T=%.3f, epsilon=%.3f -------\n", r->n, U, T, epsilon);

    if (HalfFilling)
    {
        r->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);

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

    V[0] = r->mu;

    if (HalfFilling)//and (SymmetricCase))
    {   if (isBethe)
        {
            get_Sigma();
            get_G();
        }
        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", r->mu);

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

    //output spectral weight if optioned
    if (CheckSpectralWeight)
    {
        printf("    n0: %.6f\n", get_n(r->G0));
        printf("    n:  %.6f\n", get_n(r->G));
    }

    // fill in DOS
    #pragma omp parallel for
    for (int i=0; i<N; i++)
        r->DOS[i] = - imag(r->G[i]) / pi;

    r->mu0 = mu0;

    return false;
}