Ejemplo n.º 1
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())
}
Ejemplo n.º 2
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;
}
Ejemplo n.º 3
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;
}