.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_potentials.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_potentials.py: Potentials ========== This example shows how to plot the potentials stored in netcdf files. Use the input variables `prtpot`, `prtvha`, `prtvhxc`, `prtvxc` with `iomode 3` to produce these files at the end of the SCF-GS run. .. GENERATED FROM PYTHON SOURCE LINES 10-46 .. rst-class:: sphx-glr-horizontal * .. image:: /gallery/images/sphx_glr_plot_potentials_001.png :alt: $V_{hartree}(r)$ :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_potentials_002.png :alt: $V_{xc}(r)$ :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_potentials_003.png :alt: $V_{hxc}(r)$ :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_potentials_004.png :alt: $V_{loc}(r)$ :class: sphx-glr-multi-img .. code-block:: default from abipy.abilab import abiopen import abipy.data as abidata # VKS = Hartree + XC potential + sum of local part of pseudos. with abiopen(abidata.ref_file("ni_666k_POT.nc")) as ncfile: vks = ncfile.vks #vks.plot_line(point1=[0, 0, 0], point2=[0, 4, 0], num=400, title="$V_{ks}(r)$") # Hartree potential. with abiopen(abidata.ref_file("ni_666k_VHA.nc")) as ncfile: vh = ncfile.vh vh.plot_line(point1=[0, 0, 0], point2=[0, 4, 0], num=400, title="$V_{hartree}(r)$") # XC potential. with abiopen(abidata.ref_file("ni_666k_VXC.nc")) as ncfile: vxc = ncfile.vxc vxc.plot_line(point1=[0, 0, 0], point2=[0, 4, 0], num=400, title="$V_{xc}(r)$") # Hartree + XC potential. with abiopen(abidata.ref_file("ni_666k_VHXC.nc")) as ncfile: vhxc = ncfile.vhxc vhxc.plot_line(point1=[0, 0, 0], point2=[0, 4, 0], num=400, title="$V_{hxc}(r)$") vloc = vks - vhxc vloc.plot_line(point1=[0, 0, 0], point2=[0, 4, 0], num=400, title="$V_{loc}(r)$") foo = vhxc - vh - vxc #foo.plot_line(point1=[0, 0, 0], point2=[0, 4, 0], num=400, title="$V_{hxc - h - xc}(r)$") # To plot the wavefunction along the lines connect the firt atom in the structure # and all the neighbors within a sphere of radius 3 Angstrom: #vxc.plot_line_neighbors(site_index=0, radius=3) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.450 seconds) .. _sphx_glr_download_gallery_plot_potentials.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_potentials.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_potentials.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_potentials.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_