5
$\begingroup$

How do I modify the input file below to calculate the charge density (DENS) using Quantum Espresso?

Input file:

&CONTROL
  title='Compound 4:bulk:(Si 2)(Ca)(P 3)(O 14):hP(4):P3 (143):primitive:230.81', 
  calculation='scf', 
  pseudo_dir='./', 
  outdir='./tmp', 
  verbosity='high',
  tprnfor=.true., 
  tstress=.true., 
  forc_conv_thr=1.0d-4, 
  nstep=100,
/
&SYSTEM
  ibrav= 0, nat= 20, ntyp= 4, 
  occupations = 'smearing', smearing = 'gauss', degauss = 1.0d-2,
  ecutwfc = 50, ecutrho = 500,
/
&ELECTRONS
  conv_thr = 1.0d-8
  mixing_beta = 0.7d0
/
&IONS
/
&CELL
  press_conv_thr=0.1
/
ATOMIC_SPECIES
Si     28.08550  Si.pbe-n-rrkjus_psl.1.0.0.UPF
Ca     40.07800  Ca.pbe-spn-rrkjus_psl.1.0.0.UPF
P      30.97376  P.pbe-n-rrkjus_psl.1.0.0.UPF
O      15.99940  O.pbe-n-rrkjus_psl.1.0.0.UPF

CELL_PARAMETERS (angstrom)
   4.7132930000  0.0000000000  0.0000000000
  -2.3566465000  4.0818314735  0.0000000000
   0.0000000000  0.0000000000 11.9970890000

ATOMIC_POSITIONS (crystal)
Si            0.0000000000        0.0000000000       -0.0157540426
O             0.3299136474        0.0545324986        0.0595401725
O             0.9454675014        0.2753811489        0.0595401725
O             0.7246188511        0.6700863526        0.0595401725
P             0.6666670000        0.3333330000        0.0987976560
O             0.6666670000        0.3333330000        0.2113501434
Ca            0.6666670000        0.3333330000        0.3706146451
O             0.1992673103       -0.1108239995        0.4380418511
O             1.1108239995        0.3100913098        0.4380418511
O             0.6899086902        0.8007326897        0.4380418511
Si           -0.0000000000       -0.0000000000        0.5320360071
O             0.2891646956        0.3289811702        0.6093561073
O             0.0398164747        0.7108353044        0.6093561073
O             0.6710188298        0.9601835253        0.6093561073
P             0.3333330000        0.6666670000        0.6406709519
O             0.3333330000        0.6666670000        0.7561974923
P             0.3333330000        0.6666670000        0.8748653332
O             0.2739498732        0.3264620877        0.9034691403
O             0.0525122146        0.7260501268        0.9034691403
O             0.6735379123        0.9474877854        0.9034691403
K_POINTS {automatic}
  6 6 2 0 0 0
$\endgroup$
3
  • $\begingroup$ What version of Quantum ESPRESSO are you using? This may change the answer. $\endgroup$
    – elutionary
    Nov 14, 2023 at 2:50
  • $\begingroup$ I'm using version 7.2 $\endgroup$ Nov 28, 2023 at 17:12
  • $\begingroup$ Ah, good, so do I; my answer was based on that assumption. $\endgroup$
    – elutionary
    Nov 28, 2023 at 17:25

1 Answer 1

4
$\begingroup$

In recent versions of Quantum ESPRESSO (I'm looking at 7.2), you likely already have a charge density file written. Inside your outdir, there should be a directory with a name like ${title}.save/, with a file called charge-density.dat. This is the density $\rho(\mathbf{G})$, stored in reciprocal space. Now, it's a binary file, so you can't look at it directly, but the file Modules/io_base.f90 has a subroutine called write_rhog() that describes the format with which it's written, and another one called read_rhog() that you could use to re-obtain it.

If you don't want to futz around with the source code, you can also use the pp.x executable to print the (valence pseudo-)density to a file, using plot_num = 0 in the input file. If you need the all-electron density, you can technically get it by using projector augmented-waves instead of normal pseudopotentials, an enormous kinetic energy cutoff, and plot_num = 17 (for the valence all-electron density) or 21 (if you need the core as well).*


* But at that point you'd be better off using an all-electron code, because the whole point of pseudopotentials is to avoid dealing with the core density in the first place.

$\endgroup$

You must log in to answer this question.

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