Part 2: Mobility of Al
In the last example, we learnt the basic process of a KG calculation. In this example, we will briefly introduce the ab initio KG workflow by calculating the DC electron mobility \(\mu (\omega \to 0)\) of simple 16-atom metallic Al supercell with ensemble average.
By definition, the conductivity \(\sigma\) and mobility \(\mu\) are connected by the carrier density \(n\):
The advantage of calculating mobility instead of conductivity alone will be discussed in detail in the next example Part 3.
Warning
This is a very simple showcase with no careful parameter convergence, designed to complete within tens of minutes. Therefore, the results should not be compared with any experimental data! For a more realistic example, please refer to Part 3.
Prepare input files
Geometries
In a first step, it is necessary to obtain representative geometric configurations, so-called samples that cover the phase-space at the thermodynamic conditions of interest. These samples can be generated by stochastic methods at deseired temperature \(T\) such as harmonic sampling, ab initio molecular dynamics (aiMD), etc. In FHI-aims, the harmonic sampling can be performed via FHI-vibes; aiMD simulation can be performed via FHI-vibes or i-PI. Please refer to those tutorials if you are interested.
In this example, we simply picked 10 samples from harmonic sampling at \(T=1000\) K. For details of harmonic sampling with FHI-aims, please refer to: FHI-vibes tutorial. These 10 geometries are under folder calculation\samples_1000K\
.
In order to take into account electron-vibrational interaction in real sapce, we need to use large supercells to include the nuclei vibration. In this example, we use a \(2\times 2\times 2\) supercell with 16 atoms which is relatively small, in production calculation the supercell size should be significantly larger.
Control tags
For each geometry, we can use the same input file control.in
from the first Part.
xc pbe
k_grid 6 6 6
dos_kgrid_factors 1 1 1
# type[letter] temperature[eV]
occupation_type fermi 1
# kubo_broadening[eV] , Fermi-Temperature[eV] , E_min[eV] , E_max[eV] , w_min[eV] , w_max[eV] , n_w_points[1] , spatial directions[letter]
compute_kubo_greenwood 0.020 1 -20.57 9.44 0.0 5.0 2000 a a
kg_width 0.01 0.10 10
[Add light species defaults for Al]
Warning
Here, we use \(2\times 2\times 2\) supercell, but the same control.in
file as for the 4-atom Al primitive cell in Part 1. Thus, the \(\bf k\)-grid is denser then for the primitive cell in part 1.
In general, to maintain the same \(\bf k\)-grid density between a primitive cell and an \(N \times N \times N\) supercell, the \(\bf k\)-grid in the supercell need to be \(\frac{1}{N} \times \frac{1}{N} \times \frac{1}{N}\) sparser. Keep this relation in mind when making fair comparisons of \(\bf k\)-grid convergence between different supercell sizes.
For a more detailed discussion on the systematic convergence of the \(\bf k\)-grid density and supercell size, please refer to the next example in Part 3 and this paper.
Run the calculation
On your laptop
A parallel simulation with N
processes can be launced by:
your_aims.x
should be replaced by your FHI-aims binary file.
The estimated runtime for one single calculation with 4 CPU cores is approximately 15 minutes. Using more cores can further speed up the calculation.
(If you don't want to wait for the calculations, we also provide all output files in the repository, you can use these results for the following analysis.)
Optional: On HPC
The calculations in this example can also be submitted to a HPC cluster.
Use the provided submit script to submit all 10 jobs onto HPC resources by executing the following bash script:
Warning
Please modify the job submit script job_que.sh
according to your HPC settings, such as --ntasks-per-node
, --nodes
, --time
and path to your FHI-aims executable
, etc.
Post-processing
Collect results
In the repository, we prepared a bash script called pp_all.sh
to collect all output files.
Run
kg_result_e.txt
and kg_result_h.txt
which contains carrier densities and electron/hole conductivities for all the 10 samples and 10 broadening parameters.
The resulting text file kg_result_e.txt
has the following content:
#
# 0.179505314282E+23 0.180362079085E+23 0.181043813377E+23 0.180027736242E+23 0.181852508509E+23 0.181445140065E+23 0.180577348314E+23 0.182572276313E+23 0.182107982559E+23 0.180805474730E+23
# 0.159479405674E+23 0.158403845963E+23 0.157680253335E+23 0.158947832445E+23 0.157083621546E+23 0.157378916563E+23 0.158092117597E+23 0.156749394161E+23 0.156812098001E+23 0.158320244012E+23
2.500000E-003 8.495217E+003 8.148546E+003 5.477885E+003 6.523649E+003 8.907962E+003 1.002064E+004 1.079687E+004 1.194417E+004 7.120126E+003 9.894707E+003
5.000000E-003 6.438347E+003 6.216643E+003 4.246308E+003 5.056675E+003 6.687284E+003 7.604281E+003 7.964200E+003 9.010525E+003 5.473586E+003 7.124721E+003
7.500000E-003 6.269923E+003 6.124878E+003 4.251543E+003 5.060463E+003 6.503440E+003 7.437250E+003 7.631502E+003 8.780709E+003 5.463632E+003 6.655162E+003
1.000000E-002 6.642949E+003 6.582644E+003 4.648832E+003 5.520270E+003 6.926764E+003 7.917551E+003 8.036046E+003 9.344086E+003 5.975679E+003 6.824271E+003
1.250000E-002 7.285391E+003 7.328216E+003 5.274650E+003 6.230062E+003 7.672778E+003 8.709798E+003 8.836728E+003 1.031304E+004 6.790578E+003 7.299702E+003
1.500000E-002 8.102780E+003 8.268527E+003 6.076987E+003 7.113780E+003 8.641595E+003 9.684485E+003 9.925713E+003 1.154581E+004 7.832061E+003 7.965532E+003
1.750000E-002 9.049047E+003 9.358129E+003 7.033583E+003 8.129578E+003 9.779089E+003 1.077039E+004 1.125458E+004 1.296343E+004 9.059736E+003 8.761529E+003
2.000000E-002 1.009304E+004 1.057062E+004 8.131056E+003 9.247546E+003 1.104167E+004 1.192230E+004 1.278730E+004 1.450439E+004 1.044424E+004 9.643257E+003
2.250000E-002 1.120693E+004 1.188978E+004 9.357430E+003 1.044367E+004 1.238555E+004 1.311395E+004 1.448353E+004 1.611133E+004 1.196129E+004 1.057158E+004
2.500000E-002 1.236266E+004 1.330530E+004 1.069870E+004 1.169796E+004 1.376527E+004 1.433665E+004 1.629443E+004 1.772874E+004 1.359091E+004 1.151316E+004
2.750000E-002 1.353291E+004 1.480857E+004 1.213720E+004 1.299298E+004 1.513734E+004 1.559706E+004 1.816669E+004 1.930572E+004 1.531696E+004 1.244566E+004
3.000000E-002 1.469468E+004 1.638775E+004 1.365142E+004 1.431202E+004 1.646694E+004 1.691184E+004 2.005173E+004 2.080140E+004 1.712510E+004 1.336347E+004
...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ......
#
# 0.179505314282E+23 0.180362079085E+23 0.181043813377E+23 0.180027736242E+23 0.181852508509E+23 0.181445140065E+23 0.180577348314E+23 0.182572276313E+23 0.182107982559E+23 0.180805474730E+23
# 0.159479405674E+23 0.158403845963E+23 0.157680253335E+23 0.158947832445E+23 0.157083621546E+23 0.157378916563E+23 0.158092117597E+23 0.156749394161E+23 0.156812098001E+23 0.158320244012E+23
2.500000E-003 3.967877E+004 4.326409E+004 3.516766E+004 3.722001E+004 4.360884E+004 4.681503E+004 5.288660E+004 5.534676E+004 4.408378E+004 3.802817E+004
5.000000E-003 2.421576E+004 2.656323E+004 2.180372E+004 2.286227E+004 2.665970E+004 2.857890E+004 3.245301E+004 3.365266E+004 2.723434E+004 2.311534E+004
7.500000E-003 1.953317E+004 2.155115E+004 1.786369E+004 1.855277E+004 2.153858E+004 2.306288E+004 2.632272E+004 2.703186E+004 2.222660E+004 1.858925E+004
1.000000E-002 1.757627E+004 1.949874E+004 1.632197E+004 1.678692E+004 1.940852E+004 2.076484E+004 2.381622E+004 2.421005E+004 2.022248E+004 1.669358E+004
1.250000E-002 1.673281E+004 1.865796E+004 1.577270E+004 1.606199E+004 1.850035E+004 1.978296E+004 2.279533E+004 2.292873E+004 1.945142E+004 1.587761E+004
1.500000E-002 1.646387E+004 1.844356E+004 1.574588E+004 1.587504E+004 1.822234E+004 1.948159E+004 2.254438E+004 2.243146E+004 1.931964E+004 1.562471E+004
1.750000E-002 1.653688E+004 1.860195E+004 1.603829E+004 1.600841E+004 1.831879E+004 1.958631E+004 2.275336E+004 2.239064E+004 1.956857E+004 1.571356E+004
2.000000E-002 1.683388E+004 1.900350E+004 1.654614E+004 1.635118E+004 1.865964E+004 1.995780E+004 2.326359E+004 2.263922E+004 2.006456E+004 1.603338E+004
2.250000E-002 1.728763E+004 1.957337E+004 1.720931E+004 1.683967E+004 1.917046E+004 2.051637E+004 2.398306E+004 2.308140E+004 2.072881E+004 1.652230E+004
2.500000E-002 1.785602E+004 2.026398E+004 1.798915E+004 1.743380E+004 1.980438E+004 2.121191E+004 2.485258E+004 2.365696E+004 2.150949E+004 1.714263E+004
2.750000E-002 1.851048E+004 2.104257E+004 1.885831E+004 1.810633E+004 2.052939E+004 2.201016E+004 2.583042E+004 2.432510E+004 2.236923E+004 1.786957E+004
3.000000E-002 1.923016E+004 2.188507E+004 1.979577E+004 1.883760E+004 2.132200E+004 2.288598E+004 2.688480E+004 2.505640E+004 2.327899E+004 1.868544E+004
...... ...... ...... ...... ...... ...... ...... ...... ...... ...... ......
This file is divided into blocks by the lines started with #
, these commented lines are the electron, hole carrier density of the 10 samples. There are number of broadening width
blocks in total, in this example 10. And each block is in shape (n_freqency, n_samples)
, in this example \((1999, 10)\) stored all electron conductivity data of 10 samples at 1999 frequency points for each broadening width. The file kg_result_h.txt
have exactlly the same structure.
(P.S. we requested 2000 frequency points in the input tag but remember that we skipped the first frequency point \(\omega = 0\) to avoid potential numerical issues in the denominator.)
Ensemble average
The total mobility \(\mu(\omega)\) is calculated by:
where \(\langle \cdots \rangle = \frac{1}{N}\sum_{I}\) is averaging over all samples.
A simple post-processing and visualization script is available as a Jupyter Notebook in the repository using kg_result_e.txt
and kg_result_h.txt
as input files. The averaged mobility \(\mu (\omega)\) with broadening \(\eta=0.03\) eV should look like the following figure:
Divergence can be observed in the DC limit \(\omega \to 0\), which arises from the \(1/\omega\) term in the Kubo-Greenwood formula. This divergence is eliminated only in the thermodynamics limit (infinitely large supercell), but will always exist in our finite-size simulation.
Drude fitting
From the averaged electron mobility spectra, we can also observe that in the low frequency region (before the numerical divergence), when the frequency decreases, the mobility shows a peak and then quickly drops down when \(\omega \to 0\), which is due to the finite-size effect of the simulation cell.
In practical calculations, the 'infinite supercell' limit cannot be reached, thus it is important to employ strategies to extrapolate to the DC limit. Here we use the Drude fitting approach. In the low-frequency limit, the mobility can be fitted by a Drude function:
whereby \(\mu_0\) and \(\tau\) are two parameters to be fitted.
- In practice, the Drude function should be fitted using frequency data from the first peak and usually extending through a small frequency window beyond it.
Please refer to this paper for more details about the finite size effect and Drude fitting.
Warning
The Drude fitting must be performed after ensemble average! The individual spectra of one sample may not look like a Drude function, but a converged ensemble will show a Drude-like behaviour.
A simple Drude fitting code is also provided in the same Jupyter Notebook, by fitting with the electron mobility data between the first peak and 0.5 eV. The resulting fit is displayed in the figure below:
In this case, the extrapolated DC mobility is \(\mu_0 \sim 28\) \(cm^2/(Vs)\).
Warning
The above result is not converged. In production calculation, to get reliable vibrational-limited mobility one should carefully converge all parameters including:
-
supercell size
-
number of samples
-
k-grid density
-
broadening width.
Convergence test
In this example, we only use a small 16-atom supercell, sparse \(6\times 6\times 6\) k-grid and 10 samples for simplicity. These settings are insufficient for production calculations. A detailed discussion on convergence tests for all these parameters can be found in this paper.
The next example, which uses a 40-atom SrTiO\(_3\) supercell, also provides insights on the convergence behavior of these parameters.
Solutions
You find all the solution to all the above exercises by clicking on the button below.