Yambopy tutorial: electron-phonon coupling: Difference between revisions

From The Yambo Project
Jump to navigation Jump to search
(Created page with "In this tutorial we will see some examples on how to read and analyse the data contained in the Yambo netCDF databases, which are not readily available as human readable outputs. * Electron-phonon matrix elements (Yambo databases: <code>ndb.elph_gkkp*</code>, Yambopy class: <code>YamboElectronPhononDB</code>).")
 
No edit summary
Line 2: Line 2:


* Electron-phonon matrix elements (Yambo databases: <code>ndb.elph_gkkp*</code>, Yambopy class: <code>YamboElectronPhononDB</code>).
* Electron-phonon matrix elements (Yambo databases: <code>ndb.elph_gkkp*</code>, Yambopy class: <code>YamboElectronPhononDB</code>).
=== Electron-phonon intro: plots of el-ph matrix elements on k-BZ and q-BZ ===
In this section we will use the script <code>elph_plot.py</code> and read the electron-phonon databases that you generated in the previous section.
In order to read the <code>ndb.elph_gkkp_expanded*</code> databases in python we use the Yambopy class <code>YamboElectronPhononDB</code>, which can be instanced like this:
yelph = YamboElectronPhononDB(ylat,folder_gkkp='path/to/elph/folder',save='path/to/SAVE')
(notice that it requires a previous instance of <code>YamboLatticeDB</code>).
Now, the <code>yelph</code> object contains phonon frequencies, phonon eigenvectors, qpoint information and, of course, the electron-phonon matrix elements g_{nm\nu}(k,q) where n, m are electron band states, \nu is a phonon branch, and k and q are the electronic and transfer momenta.
We can print the docstring of the <code>YamboElectronPhononDB</code> class with
print(yelph.__doc__)
to get an idea of the information stored and of its capabilities.
Now check the <code>elph_plot.py</code> script. You will see that it performs two plots:
* Plot of |g(k)| in the k-BZ for selected n,m,\nu and q [<code>Kspace_Plot=True</code>].
* Plot of |g(q)| in the q-BZ for selected n,m,\nu and k [<code>Qspace_Plot=True</code>].
You can change the electronic, phononic and momentum indices to see what happens.
[[File:Elph hbn.jpg|YamboElectronPhononDB plot from yambopy tutorial|500px]]

Revision as of 09:33, 10 March 2026

In this tutorial we will see some examples on how to read and analyse the data contained in the Yambo netCDF databases, which are not readily available as human readable outputs.

  • Electron-phonon matrix elements (Yambo databases: ndb.elph_gkkp*, Yambopy class: YamboElectronPhononDB).

Electron-phonon intro: plots of el-ph matrix elements on k-BZ and q-BZ

In this section we will use the script elph_plot.py and read the electron-phonon databases that you generated in the previous section.

In order to read the ndb.elph_gkkp_expanded* databases in python we use the Yambopy class YamboElectronPhononDB, which can be instanced like this:

yelph = YamboElectronPhononDB(ylat,folder_gkkp='path/to/elph/folder',save='path/to/SAVE')

(notice that it requires a previous instance of YamboLatticeDB).

Now, the yelph object contains phonon frequencies, phonon eigenvectors, qpoint information and, of course, the electron-phonon matrix elements g_{nm\nu}(k,q) where n, m are electron band states, \nu is a phonon branch, and k and q are the electronic and transfer momenta.

We can print the docstring of the YamboElectronPhononDB class with

print(yelph.__doc__)

to get an idea of the information stored and of its capabilities.

Now check the elph_plot.py script. You will see that it performs two plots:

  • Plot of |g(k)| in the k-BZ for selected n,m,\nu and q [Kspace_Plot=True].
  • Plot of |g(q)| in the q-BZ for selected n,m,\nu and k [Qspace_Plot=True].

You can change the electronic, phononic and momentum indices to see what happens.

YamboElectronPhononDB plot from yambopy tutorial