.. 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 :ref:`Go to the end ` to download the full example code. .. 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-sg:: /gallery/images/sphx_glr_plot_scr_matrix_001.png :alt: inverse_dielectric_function, kpoint: [+0.500, +0.000, +0.000] :srcset: /gallery/images/sphx_glr_plot_scr_matrix_001.png :class: sphx-glr-multi-img * .. image-sg:: /gallery/images/sphx_glr_plot_scr_matrix_002.png :alt: inverse_dielectric_function, kpoint: [+0.500, +0.000, +0.000] :srcset: /gallery/images/sphx_glr_plot_scr_matrix_002.png :class: sphx-glr-multi-img * .. image-sg:: /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$ :srcset: /gallery/images/sphx_glr_plot_scr_matrix_003.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none ======================== inverse_dielectric_function ======================== K-point: [+0.500, +0.000, +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:: Python 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.r.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.531 seconds) .. _sphx_glr_download_gallery_plot_scr_matrix.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_scr_matrix.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_scr_matrix.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_scr_matrix.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_