Performing SCF calculations for crystal structures using Quantum Espresso sometimes gives me this error.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error in routine electrons (1): charge is wrong: smearing is needed %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% stopping ...
I was able to resolve this by setting the value of the parameter nspin
to 2
and specifying the tot_magnetization
value obtained from the Materials Project database. If the crystal is metallic, it works if I set the occupation
to smearing
instead of fixed
. In general, for crystals that are entirely unknown/synthetic and not present in any database, is there a way to determine if they have a spin, total magnetization, net charge and whether they are metallic or not? Will using software like USPEX (or any other tools) help in this regard? Just to clarify, I know the structure and composition of the unknown crystals. It is only the properties mentioned above which are not known.
EDIT:
An example of an input file that gives the above charge is wrong
error when I perform SCF calculation. It's the Li₃(NiO₂)₄ crystal (mp-755972). The crystal is metallic in this case, but in general, I am not sure if there is a way to determine the metallicity, charge, and total magnetization
&CONTROL
calculation = 'scf'
verbosity = 'high'
nstep = 1
tstress = .false.
tprnfor = .false.
outdir = 'out'
prefix = 'myprefix'
pseudo_dir = 'SSSP'
/
&SYSTEM
ntyp = 3
nbnd = 256
ecutwfc = 30
ecutrho = 240
occupations = 'fixed'
degauss = 0.001
smearing = 'gaussian'
nspin = 1
nat = 15
ibrav = 0
/
&ELECTRONS
electron_maxstep = 1000
mixing_mode = 'plain'
mixing_beta = 0.7
diagonalization = 'david'
/
&IONS
/
&CELL
/
ATOMIC_SPECIES
Li 6.94 li_pbe_v1.4.uspp.F.UPF
Ni 58.6934 ni_pbe_v1.4.uspp.F.UPF
O 15.999 O.pbe-n-kjpaw_psl.0.1.UPF
K_POINTS automatic
3 3 3 0 0 0
CELL_PARAMETERS angstrom
5.61196941000000 0.00000000000000 0.00000000000000
-2.80568521479842 5.09575857245564 0.00000000000000
0.00017151044003 -3.27389010244342 4.79031051982104
ATOMIC_POSITIONS angstrom
Li -1.4027568522 0.9109342350 2.3951552599
Li 0.0000857552 -1.6369450512 2.3951552599
Li 2.8060704602 -1.6369450512 2.3951552599
Ni 0.0001687046 -3.2738817328 4.7903057295
Ni 2.8061534096 -3.2738817328 4.7903057295
Ni 4.2091268020 2.5478690947 0.0000000000
Ni 1.4031477097 2.5478760123 0.0000047903
O -1.4025356006 2.5206534950 3.7297501417
O 4.2089913062 -0.6987850249 1.0605603782
O 4.2089946010 -2.3279785879 3.8047616141
O -1.4025332834 4.1498470579 0.9855489057
O -0.0249960414 -0.0151120810 3.7377787021
O -0.0250827853 1.8368680471 1.0524503824
O 2.8315328789 -0.0149995771 3.7378601374
O 2.8314517468 1.8369838249 1.0525270274
code
block? Also, you can usesmearing
for unknown materials. It is needed for metallic materials but does no/very little harm if you use it in a small amount for insulators. $\endgroup$smearing
is that I cannot get the highest occupied and lowest unoccupied energies in the output file to compute the band gap. Is there a way to determine that withsmearing
option? $\endgroup$pw.x
calculation withcalculation='bands'
and abands.x
calculation after completing the scf calculation to check the band gap visually. You can also extract the exact band gap by inspecting the energy values at the corresponding k-points. $\endgroup$occupations='fixed'
only works for insulators with a band gap. Otherwise, you should useoccupations='smearing'
in this case. $\endgroup$