.. 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 approximation. .. GENERATED FROM PYTHON SOURCE LINES 9-30 .. 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, f"scale_{s:d}_GSR.nc") for s in strains] ddb_paths = [os.path.join(root, f"scale_{s:d}_GSR_DDB") for s in strains] phdos_paths = [os.path.join(root, f"scale_{s:d}_PHDOS.nc") for s in strains2] qha = Vzsisa.from_ddb_phdos_files(ddb_paths, phdos_paths) tstart, tstop, num = 0, 800, 101 .. GENERATED FROM PYTHON SOURCE LINES 31-32 Plot BO Energies as a function of volume for different T .. GENERATED FROM PYTHON SOURCE LINES 32-34 .. code-block:: Python qha.plot_bo_energies(tstart=tstart, tstop=tstop, 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 35-36 Plot Volume as a function of T .. GENERATED FROM PYTHON SOURCE LINES 36-38 .. code-block:: Python qha.plot_vol_vs_t(tstart=tstart, tstop=tstop, num=num) .. 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 39-40 Plot Lattice as a function of T .. GENERATED FROM PYTHON SOURCE LINES 40-42 .. code-block:: Python qha.plot_abc_vs_t(tstart=tstart, tstop=tstop, num=num) .. 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 43-44 Plot Lattice as a function of T .. GENERATED FROM PYTHON SOURCE LINES 44-46 .. code-block:: Python qha.plot_abc_vs_t(tstart=tstart, tstop=tstop, num=num, 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 47-48 Plot Volumetric thermal expansion coefficient as a function of T .. GENERATED FROM PYTHON SOURCE LINES 48-50 .. code-block:: Python qha.plot_thermal_expansion_coeff(tstart=tstart, tstop=tstop, num=num) .. 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 51-52 Plot Thermal expansion coefficient as a function of T .. GENERATED FROM PYTHON SOURCE LINES 52-54 .. code-block:: Python qha.plot_thermal_expansion_coeff_abc(tstop=tstop, tstart=tstart, num=num) .. 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 55-56 Plot Angles as a function of T .. GENERATED FROM PYTHON SOURCE LINES 56-58 .. code-block:: Python qha.plot_angles_vs_t(tstart=tstart, tstop=tstop, num=num) .. 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 59-60 Plot Volume as a function of T. 4th order polinomial .. GENERATED FROM PYTHON SOURCE LINES 61-63 .. code-block:: Python qha.plot_vol_vs_t_4th(tstart=tstart, tstop=tstop, num=num) .. 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 64-65 Plot Lattice as a function of T. 4th order polinomial .. GENERATED FROM PYTHON SOURCE LINES 65-67 .. code-block:: Python qha.plot_abc_vs_t_4th(tstart=tstart, tstop=tstop, num=num, 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 68-69 Plot Lattice as a function of T. 4th order polinomial .. GENERATED FROM PYTHON SOURCE LINES 69-71 .. code-block:: Python qha.plot_abc_vs_t_4th(tstart=tstart, tstop=tstop) .. 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 72-73 Plot Volumetric thermal expansion coefficient as a function of T .. GENERATED FROM PYTHON SOURCE LINES 73-75 .. 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 76-77 Plot Thermal expansion coefficient as a function of T .. GENERATED FROM PYTHON SOURCE LINES 77-79 .. code-block:: Python qha.plot_thermal_expansion_coeff_abc_4th(tstart=tstart, tstop=tstop, num=num, 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 80-81 Plot Angles as a function of T. .. GENERATED FROM PYTHON SOURCE LINES 81-83 .. code-block:: Python qha.plot_angles_vs_t_4th(tstart=tstart, tstop=tstop, num=num, 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.540 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 `_