I am trying to calculate second order force constants for GaAs (preparing input file for ShengBTE). I successfully ran pw.x, but after that when I ran ph.x, I got the following error.

ask # 0 from phq_readin : error # 1 no electric. field with metals

I have used epsil = .true. for phonon calculation to calculate born charge and dielectric constant.

I know that for metal if we select epsil = .true., we get the above error. But as GaAs is a semiconductor I am confused why I got this error. I am informed some possible solutions for that e.g, avoid using PBEsol type pseudopotential for semiconductor, choose occupations='fixed'. But still I am not sure the exact reasons since occupations='fixed' we use normally for metal.

Here is my scf.in (focusing main part)

degauss = 0.02
ecutrho = ...
ecutwfc  = ...
occupation = 'smearing'

Which occupations and potential should I prefer (under the system card) during the input preparation for semiconductors?


1 Answer 1


occupations='fixed' we use normally for metal

This is not correct. We use the exact opposite, i.e., occupations='fixed' for materials with band gap (insulator/semiconductor) and occupations='smearing' for metal. It is a common practice to use occupations='smearing' even for non-metallic systems to help them converge faster since it doesn't harm anything but 'smearing' is meant to be used for metals.

Now, if you use epsil=.true. in your ph.x input, you must have a semiconductor/an insulator. In your case, you have a semiconducting material, i.e., GaAs. However, since you used occupations='smearing', the code treats your system as a metallic one even if it is not a metal. So, you cannot use epsil=.true. anymore. That is the problem in your case, the problem is not with pseudopotentials.

Referring to the documentation, epsil=.true. requires a gamma-point only calculation and also no use of smearing is allowed (smearing means metallic).

So, what you can do as possible alternatives are:

  1. Try to converge the system without using smearing. Use occupations='fixed' and see if the system converges. Then you can continue with the subsequent steps just like you were doing previously.
  2. If you cannot converge the system without using occupations='smearing', then try converge the system by using smearing like you were doing now. Then use the resulting charge density and the resulting wavefunction as an initial guess (startingwfc='file' and startingpot='file') of a new scf calculation that uses occupations='fixed'. Then follow the subsequent ph.x steps.
  3. If the above procedure does not work and throws error such as charge is wrong, then repeat the second step but do not use startingwfc='file', instead use startingpot='file' only.
  4. If that does not work, then you first converge your system using 'occupations='smearing'. Use verbosity='high' to get information about your occupation matrix. After that, before running any ph.x calculation, rerun the scf calculation using the converged charge density startingpot='file' and occupations='from_input'. Here, you need to set the OCCUPATIONS card and should use nbnd variable (it is the number of Kohn-Sham states reported in your initial scf output). The syntax of the occupation card can be found here.

In theory, if your material is not metal, then you should be okay with the method described in (1). Try the other methods only if you must use smearing due to computational cost or something else. Method 1 is the most robust but can take a lot of time to converge. Method 2 and 3 will throw error if the smearing is too much and thus the charges do not match. Method 4 should be very robust, but requires manually setting the occupancy which requires some expertise reading the occupations from the output and then setting them in the input card.

  • $\begingroup$ I have run it considering step 1. And it converges. Thanks for your detail explanation. $\endgroup$ Commented May 26 at 15:59
  • $\begingroup$ @MuhammadHasan great! If the answer is helpful, you may consider upvoting the answer as well. $\endgroup$ Commented May 26 at 16:54
  • $\begingroup$ yes, I have done it! $\endgroup$ Commented May 27 at 16:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .