Ejemplo n.º 1
0
 def _allocate_values(self):
     num_band0 = len(self._pp.get_band_indices())
     num_grid_points = len(self._grid_points)
     num_temp = len(self._temperatures)
     self._kappa = np.zeros((len(self._sigmas), num_temp, 6),
                            order='C', dtype='double')
     self._mode_kappa = np.zeros((len(self._sigmas),
                                  num_temp,
                                  num_grid_points,
                                  num_band0,
                                  6),
                                 order='C', dtype='double')
     if not self._read_gamma:
         self._gamma = np.zeros((len(self._sigmas),
                                 num_temp,
                                 num_grid_points,
                                 num_band0),
                                order='C', dtype='double')
         if self._is_gamma_detail or self._is_N_U:
             self._gamma_N = np.zeros_like(self._gamma)
             self._gamma_U = np.zeros_like(self._gamma)
     self._gv = np.zeros((num_grid_points, num_band0, 3),
                         order='C', dtype='double')
     self._gv_sum2 = np.zeros((num_grid_points, num_band0, 6),
                              order='C', dtype='double')
     self._cv = np.zeros((num_temp, num_grid_points, num_band0),
                         order='C', dtype='double')
     if self._isotope is not None:
         self._gamma_iso = np.zeros(
             (len(self._sigmas), num_grid_points, num_band0),
             order='C', dtype='double')
     if self._is_full_pp or self._use_ave_pp or self._use_const_ave_pp:
         self._averaged_pp_interaction = np.zeros(
             (num_grid_points, num_band0),
             order='C', dtype='double')
     self._num_ignored_phonon_modes = np.zeros(
         (len(self._sigmas), num_temp), order='C', dtype='intc')
     self._collision = ImagSelfEnergy(
         self._pp,
         with_detail=(self._is_gamma_detail or self._is_N_U),
         unit_conversion=self._gamma_unit_conversion)
Ejemplo n.º 2
0
    def __init__(
        self,
        interaction: Interaction,
        grid_points=None,
        temperatures=None,
        sigmas=None,
        sigma_cutoff=None,
        is_isotope=False,
        mass_variances=None,
        boundary_mfp=None,  # in micrometre
        use_ave_pp=False,
        is_kappa_star=True,
        gv_delta_q=None,
        is_full_pp=False,
        read_pp=False,
        store_pp=False,
        pp_filename=None,
        is_N_U=False,
        is_gamma_detail=False,
        is_frequency_shift_by_bubble=False,
        log_level=0,
    ):
        """Init method."""
        self._is_N_U = is_N_U
        self._is_gamma_detail = is_gamma_detail
        self._is_frequency_shift_by_bubble = is_frequency_shift_by_bubble

        self._gamma_N = None
        self._gamma_U = None
        self._gamma_detail_at_q = None
        self._use_ave_pp = use_ave_pp
        self._use_const_ave_pp = None
        self._averaged_pp_interaction = None
        self._num_ignored_phonon_modes = None

        super().__init__(
            interaction,
            grid_points=grid_points,
            temperatures=temperatures,
            sigmas=sigmas,
            sigma_cutoff=sigma_cutoff,
            is_isotope=is_isotope,
            mass_variances=mass_variances,
            boundary_mfp=boundary_mfp,
            is_kappa_star=is_kappa_star,
            gv_delta_q=gv_delta_q,
            is_full_pp=is_full_pp,
            log_level=log_level,
        )

        self._use_const_ave_pp = self._pp.get_constant_averaged_interaction()
        self._read_pp = read_pp
        self._store_pp = store_pp
        self._pp_filename = pp_filename

        if self._temperatures is not None:
            self._allocate_values()

        self._collision = ImagSelfEnergy(
            self._pp, with_detail=(self._is_gamma_detail or self._is_N_U)
        )