.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_scr_matrix.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_plot_scr_matrix.py: SCR matrix ========== This examples shows how to plot the matrix elements of the inverse dielectric function stored in the SCR file (optdriver 3) See also `plot_scr.py` for the optical spectrum. .. GENERATED FROM PYTHON SOURCE LINES 10-37 .. rst-class:: sphx-glr-horizontal * .. image:: /gallery/images/sphx_glr_plot_scr_matrix_001.png :alt: inverse_dielectric_function, kpoint: [+0.500, +0.000, +0.000], weight: 0.000 :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_scr_matrix_002.png :alt: inverse_dielectric_function, kpoint: [+0.500, +0.000, +0.000], weight: 0.000 :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_scr_matrix_003.png :alt: (abs) $||\epsilon^{-1}||$ $\omega=0.1741265921124269j$, (abs) $||\epsilon^{-1}||$ $\omega=0.4505353276073309j$, (abs) $||\epsilon^{-1}||$ $\omega=0.8893068451051416j$, (abs) $||\epsilon^{-1}||$ $\omega=1.585813213554849j$, (abs) $||\epsilon^{-1}||$ $\omega=2.6914481555344656j$ :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none ======================== inverse_dielectric_function ======================== K-point: [+0.500, +0.000, +0.000], weight: 0.000 Number of G-vectors: 9 Total number of frequencies: 35 (real: 30, imaginary: 5) Real frequencies up to 0.73 (eV) Imaginary frequencies up to 2.69 (eV) | .. code-block:: default import abipy.data as abidata from abipy.abilab import abiopen with abiopen(abidata.ref_file("sio2_SCR.nc")) as ncfile: #print(ncfile) # The SCR file contains a structure and electron bands in the IBZ. # We can thus use the ebands object to plot bands + DOS. #ncfile.ebands.plot() # Read e^{-1}_{G1, G2}(k, omega) kpoint = [0.5, 0, 0] em1 = ncfile.reader.read_wggmat(kpoint) print(em1) gvec1 = [1, 0, 0] gvec2 = [-1, 0, 0] # Plot matrix element as function of frequency along the real axis em1.plot_freq(gvec1=gvec1, gvec2=gvec2, waxis="real") # Plot data along the imaginary axis # Note that gvectors can also be specifined in terms of their index. em1.plot_freq(gvec1=0, gvec2=0, waxis="imag") # Plot e^{-1}_{G1, G2} along the imaginary axis. em1.plot_gg(wpos="imag") .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.708 seconds) .. _sphx_glr_download_gallery_plot_scr_matrix.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/abinit/abipy/gh-pages?filepath=notebooks/gallery/plot_scr_matrix.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_scr_matrix.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_scr_matrix.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_