@@ -2694,7 +2694,7 @@ def get_dynamical_bubble(self, q, w, smearing = 1e-5):
26942694
26952695
26962696 def get_free_energy_hessian (self , include_v4 = False , get_full_hessian = True , verbose = False , \
2697- use_symmetries = True ):
2697+ use_symmetries = True , return_d3 = False ):
26982698 """
26992699 GET THE FREE ENERGY ODD CORRECTION
27002700 ==================================
@@ -2719,11 +2719,16 @@ def get_free_energy_hessian(self, include_v4 = False, get_full_hessian = True, v
27192719 use_symmetries : bool
27202720 If true, the d3 and d4 are symmetrized in real space.
27212721 It requires that spglib is installed to detect symmetries in the supercell correctly.
2722+ return_d3 : bool
2723+ If true, returns also the tensor of three phonon scattering.
27222724
27232725 Returns
27242726 -------
27252727 phi_sc : Phonons()
27262728 The dynamical matrix of the free energy hessian in (Ry/bohr^2)
2729+ d3 : ndarray (size = (3*nat_sc, 3*nat_sc, 3*nat_sc), Optional
2730+ Return the three-phonon-scattering tensor (in Ry atomic units).
2731+ Only if return_d3 is True.
27272732 """
27282733 # For now the v4 is not implemented
27292734 # if include_v4:
@@ -2859,6 +2864,8 @@ def get_free_energy_hessian(self, include_v4 = False, get_full_hessian = True, v
28592864 dyn_hessian .dynmats [iq ] = dynq_odd [iq , :, :]
28602865
28612866
2867+ if return_d3 :
2868+ return dyn_hessian , d3 * 2.0 # Ha to Ry
28622869 return dyn_hessian
28632870
28642871
0 commit comments