.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_qha_vzsisa.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_qha_vzsisa.py: Quasi-harmonic approximation with v-ZSISA ========================================= This example shows how to use the GSR.nc and PHDOS.nc files computed with different volumes to compute thermodynamic properties within the v-ZSISA method. .. GENERATED FROM PYTHON SOURCE LINES 9-29 .. code-block:: Python import os import abipy.data as abidata from abipy.dfpt.vzsisa import Vzsisa # Root points to the directory in the git submodule with the output results. root = os.path.join(abidata.dirpath, "data_v-ZSISA-QHA.git", "Si_v_ZSISA_approximation") strains = [96, 98, 100, 102, 104, 106] strains2 = [98, 100, 102, 104, 106] # EinfVib4(D) #strains2 = [96, 98, 100, 102, 104] # EinfVib4(S) #strains2 = [100, 102, 104] # EinfVib2(D) gsr_paths = [os.path.join(root, "scale_{:d}_GSR.nc".format(s)) for s in strains] ddb_paths = [os.path.join(root, "scale_{:d}_GSR_DDB".format(s)) for s in strains] phdos_paths = [os.path.join(root, "scale_{:d}_PHDOS.nc".format(s)) for s in strains2] qha = Vzsisa.from_ddb_phdos_files(ddb_paths, phdos_paths) tstart, tstop = 0, 800 .. GENERATED FROM PYTHON SOURCE LINES 30-31 Plot BO Energies as a function of volume for different T .. GENERATED FROM PYTHON SOURCE LINES 31-33 .. code-block:: Python qha.plot_bo_energies(tstop=tstop, tstart=tstart, num=11) .. image-sg:: /gallery/images/sphx_glr_plot_qha_vzsisa_001.png :alt: Energies as a function of volume for different T :srcset: /gallery/images/sphx_glr_plot_qha_vzsisa_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 34-35 Plot Volume as a function of T .. GENERATED FROM PYTHON SOURCE LINES 35-37 .. code-block:: Python qha.plot_vol_vs_t(tstop=tstop, tstart=tstart, num=101) .. image-sg:: /gallery/images/sphx_glr_plot_qha_vzsisa_002.png :alt: Volume as a function of T :srcset: /gallery/images/sphx_glr_plot_qha_vzsisa_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 38-39 Plot Lattice as a function of T .. GENERATED FROM PYTHON SOURCE LINES 39-41 .. code-block:: Python qha.plot_abc_vs_t(tstop=tstop, tstart=tstart, num=101) .. image-sg:: /gallery/images/sphx_glr_plot_qha_vzsisa_003.png :alt: Lattice as a function of T :srcset: /gallery/images/sphx_glr_plot_qha_vzsisa_003.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 42-43 Plot Lattice as a function of T") .. GENERATED FROM PYTHON SOURCE LINES 43-45 .. code-block:: Python qha.plot_abc_vs_t(tstop=tstop, tstart=tstart, num=101, lattice="b") .. image-sg:: /gallery/images/sphx_glr_plot_qha_vzsisa_004.png :alt: Lattice as a function of T :srcset: /gallery/images/sphx_glr_plot_qha_vzsisa_004.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 46-47 Plot Volumetric thermal expansion coefficient as a function of T .. GENERATED FROM PYTHON SOURCE LINES 47-49 .. code-block:: Python qha.plot_thermal_expansion_coeff(tstop=tstop, tstart=tstart ,num=101) .. image-sg:: /gallery/images/sphx_glr_plot_qha_vzsisa_005.png :alt: Volumetric thermal expansion coefficient as a function of T :srcset: /gallery/images/sphx_glr_plot_qha_vzsisa_005.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 50-51 Plot Thermal expansion coefficient as a function of T .. GENERATED FROM PYTHON SOURCE LINES 51-53 .. code-block:: Python qha.plot_thermal_expansion_coeff_abc(tstop=tstop, tstart=tstart ,num=101) .. image-sg:: /gallery/images/sphx_glr_plot_qha_vzsisa_006.png :alt: Thermal expansion coefficient as a function of T :srcset: /gallery/images/sphx_glr_plot_qha_vzsisa_006.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 54-55 Plot Angles as a function of T .. GENERATED FROM PYTHON SOURCE LINES 55-57 .. code-block:: Python qha.plot_angles_vs_t(tstop=tstop, tstart=tstart, num=101) .. image-sg:: /gallery/images/sphx_glr_plot_qha_vzsisa_007.png :alt: Angles as a function of T :srcset: /gallery/images/sphx_glr_plot_qha_vzsisa_007.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 58-59 Plot Volume as a function of T. 4th order polinomial .. GENERATED FROM PYTHON SOURCE LINES 60-62 .. code-block:: Python qha.plot_vol_vs_t_4th(tstop=tstop, tstart=tstart, num=101) .. image-sg:: /gallery/images/sphx_glr_plot_qha_vzsisa_008.png :alt: Volume as a function of T :srcset: /gallery/images/sphx_glr_plot_qha_vzsisa_008.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 63-64 Plot Lattice as a function of T. 4th order polinomial .. GENERATED FROM PYTHON SOURCE LINES 64-66 .. code-block:: Python qha.plot_abc_vs_t_4th(tstop=tstop, tstart=tstart, num=101, lattice="a") .. image-sg:: /gallery/images/sphx_glr_plot_qha_vzsisa_009.png :alt: Lattice as a function of T :srcset: /gallery/images/sphx_glr_plot_qha_vzsisa_009.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 67-68 Plot Lattice as a function of T. 4th order polinomial .. GENERATED FROM PYTHON SOURCE LINES 68-70 .. code-block:: Python qha.plot_abc_vs_t_4th(tstop=tstop, tstart=tstart) .. image-sg:: /gallery/images/sphx_glr_plot_qha_vzsisa_010.png :alt: Lattice as a function of T :srcset: /gallery/images/sphx_glr_plot_qha_vzsisa_010.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 71-72 Plot Volumetric thermal expansion coefficient as a function of T .. GENERATED FROM PYTHON SOURCE LINES 72-74 .. code-block:: Python qha.plot_thermal_expansion_coeff_4th(tref=293) .. image-sg:: /gallery/images/sphx_glr_plot_qha_vzsisa_011.png :alt: Volumetric thermal expansion coefficient as a function of T :srcset: /gallery/images/sphx_glr_plot_qha_vzsisa_011.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 75-76 Plot Thermal expansion coefficient as a function of T .. GENERATED FROM PYTHON SOURCE LINES 76-78 .. code-block:: Python qha.plot_thermal_expansion_coeff_abc_4th(tstop=tstop, tstart=tstart ,num=101, tref=293) .. image-sg:: /gallery/images/sphx_glr_plot_qha_vzsisa_012.png :alt: Thermal expansion coefficient as a function of T :srcset: /gallery/images/sphx_glr_plot_qha_vzsisa_012.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 79-80 Plot Angles as a function of T. .. GENERATED FROM PYTHON SOURCE LINES 80-83 .. code-block:: Python qha.plot_angles_vs_t_4th(tstop=tstop, tstart=tstart, num=101, angle=3) .. image-sg:: /gallery/images/sphx_glr_plot_qha_vzsisa_013.png :alt: Angles as a function of T :srcset: /gallery/images/sphx_glr_plot_qha_vzsisa_013.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 84-85 Create plotter to plot all the phonon DOS. .. GENERATED FROM PYTHON SOURCE LINES 85-87 .. code-block:: Python phdos_plotter = qha.get_phdos_plotter() phdos_plotter.combiplot() .. image-sg:: /gallery/images/sphx_glr_plot_qha_vzsisa_014.png :alt: plot qha vzsisa :srcset: /gallery/images/sphx_glr_plot_qha_vzsisa_014.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 7.633 seconds) .. _sphx_glr_download_gallery_plot_qha_vzsisa.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_qha_vzsisa.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_qha_vzsisa.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_qha_vzsisa.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_