Exemplo n.º 1
0
 def __init__(self,
              interaction,
              symmetry,
              sigmas=[0.1],
              asigma_step =1,
              temperatures=None,
              mesh_divisors=None,
              coarse_mesh_shifts=None,
              grid_points=None,
              cutoff_lifetime=1e-4,  # in second
              diff_kappa = 1e-3,  #  W/m-K
              nu=None,  # is Normal or Umklapp
              no_kappa_stars=False,
              gv_delta_q=1e-4,  # finite difference for group velocity
              log_level=0,
              write_tecplot=False,
              kappa_write_step=None,
              is_thm=False,
              filename=None):
     Conductivity.__init__(self,
                           interaction,
                           symmetry,
                           grid_points=grid_points,
                           temperatures=temperatures,
                           sigmas=sigmas,
                           mesh_divisors=mesh_divisors,
                           coarse_mesh_shifts=coarse_mesh_shifts,
                           no_kappa_stars=no_kappa_stars,
                           gv_delta_q=gv_delta_q,
                           log_level=log_level,
                           write_tecplot=write_tecplot)
     self._ise = ImagSelfEnergy(self._pp, nu, is_thm=is_thm, cutoff_lifetime= cutoff_lifetime)
     self._max_sigma_step=asigma_step
     self._is_asigma = False if asigma_step==1 else True
     self._sigma_iteration_step = 0
     self._nu=nu
     self._filename = filename
     if asigma_step > 1:
         if self._filename is not None:
             self._filename ="-adapt" + self._filename
         else:
             self._filename = "-adapt"
     self._cutoff_lifetime = cutoff_lifetime
     self._diff_kappa = diff_kappa
     self._is_converge = None
     if self._no_kappa_stars:
         self._kpoint_operations = np.eye(3,dtype="intc")
     else:
         self._kpoint_operations = get_pointgroup_operations(
             self._pp.get_point_group_operations())
     self._gamma_N = [None] * len(sigmas)
     self._gamma_U = [None]*len(sigmas)
     self._read_f = False
     self._read_gv = False
     self._cv = None
     self._wstep=kappa_write_step
     self._sum_num_kstar = 0
     self._scale_bar = 0
     if temperatures is not None:
         self._allocate_values()
Exemplo n.º 2
0
 def _allocate_values(self):
     num_band0 = len(self._pp.get_band_indices())
     num_band = self._primitive.get_number_of_atoms() * 3
     num_grid_points = len(self._grid_points)
     self._kappa = np.zeros((len(self._sigmas), len(self._temperatures), 6),
                            dtype='double')
     self._mode_kappa = np.zeros((len(self._sigmas), len(
         self._temperatures), num_grid_points, num_band0, 6),
                                 dtype='double')
     if not self._read_gamma:
         self._gamma = np.zeros((len(self._sigmas), len(
             self._temperatures), num_grid_points, num_band0),
                                dtype='double')
     self._gv = np.zeros((num_grid_points, num_band0, 3), dtype='double')
     self._cv = np.zeros(
         (len(self._temperatures), num_grid_points, num_band0),
         dtype='double')
     if self._isotope is not None:
         self._gamma_iso = np.zeros(
             (len(self._sigmas), num_grid_points, num_band0),
             dtype='double')
     if self._is_full_pp or self._use_ave_pp:
         self._averaged_pp_interaction = np.zeros(
             (num_grid_points, num_band0), dtype='double')
     self._num_ignored_phonon_modes = np.zeros(
         (len(self._sigmas), len(self._temperatures)), dtype='intc')
     self._collision = ImagSelfEnergy(
         self._pp, unit_conversion=self._gamma_unit_conversion)
Exemplo n.º 3
0
 def get_linewidth(self,
                   grid_points,
                   sigmas=[0.1],
                   temperatures=None,
                   read_amplitude=False,
                   nu=None,
                   scattering_class=None,
                   band_paths=None,
                   filename=None):
     self._interaction.set_is_disperse(True)
     ise = ImagSelfEnergy(self._interaction, nu=nu)
     if temperatures is None:
         temperatures = np.arange(0, 1000.0 + 10.0 / 2.0, 10.0)
     self._temperatures = temperatures
     self._read_amplitude = read_amplitude
     if grid_points is not None:
         self.get_linewidth_at_grid_points(ise, sigmas, temperatures,
                                           grid_points, nu,
                                           scattering_class, filename)
     elif band_paths is not None:
         self.get_linewidth_at_paths(ise, sigmas, temperatures, band_paths,
                                     nu, scattering_class, filename)
Exemplo n.º 4
0
 def _allocate_values(self):
     num_band = self._primitive.get_number_of_atoms() * 3
     num_grid_points = len(self._grid_points)
     self._kappa = np.zeros((len(self._sigmas), len(self._temperatures), 6),
                            dtype='double')
     self._mode_kappa = np.zeros((len(self._sigmas), len(
         self._temperatures), num_grid_points, num_band, 6),
                                 dtype='double')
     if not self._read_gamma:
         self._gamma = np.zeros((len(self._sigmas), len(
             self._temperatures), num_grid_points, num_band),
                                dtype='double')
     self._gv = np.zeros((num_grid_points, num_band, 3), dtype='double')
     self._cv = np.zeros(
         (num_grid_points, len(self._temperatures), num_band),
         dtype='double')
     if self._isotope is not None:
         self._gamma_iso = np.zeros(
             (len(self._sigmas), num_grid_points, num_band), dtype='double')
     self._mean_square_pp_strength = np.zeros((num_grid_points, num_band),
                                              dtype='double')
     self._collision = ImagSelfEnergy(self._pp)
Exemplo n.º 5
0
    def get_imag_self_energy(self,
                             grid_points,
                             frequency_step=1.0,
                             sigmas=[None],
                             temperatures=[0.0],
                             filename=None):
        ise = ImagSelfEnergy(self._interaction, is_thm=self._is_thm)
        for gp in grid_points:
            ise.set_grid_point(gp)
            ise.run_interaction()
            for sigma in sigmas:
                ise.set_sigma(sigma)
                for t in temperatures:
                    ise.set_temperature(t)
                    max_freq = (
                        np.amax(self._interaction.get_phonons()[0]) * 2 +
                        sigma * 4)
                    fpoints = np.arange(0, max_freq + frequency_step / 2,
                                        frequency_step)
                    ise.set_fpoints(fpoints)
                    ise.run()
                    gamma = ise.get_imag_self_energy()

                    for i, bi in enumerate(self._band_indices):
                        pos = 0
                        for j in range(i):
                            pos += len(self._band_indices[j])

                        write_damping_functions(
                            gp,
                            bi,
                            self._mesh,
                            fpoints,
                            gamma[:, pos:(pos + len(bi))].sum(axis=1) /
                            len(bi),
                            sigma=sigma,
                            temperature=t,
                            filename=filename)