Page 1 of 1

gap_distribution_FS routine/problem of spiky gap distribution

Posted: Tue Jun 09, 2020 9:56 am
by CHILLL
Dear experts and users,

It has happened to me several times already that even with very decent interpolation grids I obtain gap distributions that are very spiky (an example where it looks quite disturbing: https://ibb.co/SPWLwfk).
I was wondering if that is in fact not an interpolation problem, and I tried to look for an answer in the corresponding routine called gap_distribution_FS. I think it all boils down to this double loop from io_eliashberg.f90:

Code: Select all

    delta_max = 1.1d0 * maxval(Agap(:,:,itemp))
    nbin = NINT(delta_max / eps5) + 1
    dbin = delta_max / dble(nbin)
    IF ( .not. ALLOCATED(delta_k_bin) ) ALLOCATE( delta_k_bin(nbin) )
    delta_k_bin(:) = zero
    !
    DO ik = 1, nkfs
       DO ibnd = 1, nbndfs
          IF ( abs( ekfs(ibnd,ik) - ef0 ) .lt. fsthick ) THEN
            ibin = nint( Agap(ibnd,ik,itemp) / dbin ) + 1
            weight = w0g(ibnd,ik)
            delta_k_bin(ibin) = delta_k_bin(ibin) + weight
          ENDIF
       ENDDO
    ENDDO
    !
Could you please tell me what is this weight variable there? I found it being defined in the read_eigenvalues routine where it is just a gaussian weight for the electronic eigenvalues. It seems that for every k-point and band, we check the value of the gap and then add the weight of this point to the corresponding delta_k_bin variable. So, in fact we only sum weights right?
In that case, am I right to assume that an alternative to a better interpolation grid in this case would be just increasing degaussw?
Would you probably recommend something else to try?

Is it actually bad to have a spiky distribution? In most of the cases I encounter it, a better interpolation smoothens it out a bit, but there is nearly no difference in the gap distribution character itself. The whole problem just gives a slight impression that the results are not very well converged. Could you please give your opinion?

Thank you very much!
Mikhail

Re: gap_distribution_FS routine/problem of spiky gap distribution

Posted: Tue Jul 21, 2020 3:50 pm
by roxana
Hi,

This step is only meant indeed for visualization purposes. If you increase the smearing value you should get a smother curve.

Best,
Roxana

Re: gap_distribution_FS routine/problem of spiky gap distribution

Posted: Thu Jul 23, 2020 9:38 am
by CHILLL
Thank you very much for the answer!
Could you please tell me, if it is possible to make the smearing degaussw more than 1/4 of the fsthick? When I increase the smearing more than 1/4, the code crashes saying that the smearing is too close to fsthick. I don't really want a larger window since it does not change results, but only makes the calculation much longer. I just want to reduce the spikes (improve visualisation).

Best, Mikhail

Re: gap_distribution_FS routine/problem of spiky gap distribution

Posted: Thu Jul 23, 2020 3:32 pm
by roxana
You can comment the line in the code that checks that the smearing degaussw is not more than 1/4 of fsthick and recompile the code. However, I would not recommend doing that since degaussw is used in other parts of the code as well. Instead you can define weight based on the smearing value you would like to have locally when delta_k_bin is calculated.

Best,
Roxana

Re: gap_distribution_FS routine/problem of spiky gap distribution

Posted: Mon Aug 03, 2020 4:59 pm
by roxana
Hi,

Another way to get smoother curves is to decrease the number of bins. To do that you can change "eps5" to "eps4" in "SUBROUTINE gap_distribution_FS".

Best,
Roxana

Re: gap_distribution_FS routine/problem of spiky gap distribution

Posted: Tue Aug 04, 2020 4:39 pm
by CHILLL
Hello,

Thank you for the advise.
I cannot easily recompile the code because it is installed on a cluster globally, but I have a script that calculates the distribution from "gap_FS" file, and your solution helped a lot (much better than the smearing in fact). Are these eps4 and eps5 values different for different temperatures?

Best, Mikhail

Re: gap_distribution_FS routine/problem of spiky gap distribution

Posted: Wed Aug 05, 2020 9:32 pm
by roxana
Hi,

If you look at the expression for nbin, eps4 or eps5 defines the number of bins. In other words, smaller the eps larger the number of bins so you will get a more spiky distribution if you don't have many k-points that have close values of the gap, i.e. delta_nk. It is pretty similar to when you plot DOS. In the end depends on the width of the superconducting gap, i.e. min and max value of the gap.

Best,
Roxana

Re: gap_distribution_FS routine/problem of spiky gap distribution

Posted: Sat Aug 08, 2020 4:45 am
by CHILLL
Hello,

Ok, that is pretty straightforward indeed. Thank you!

Best,
Mikhail