Exemplo n.º 1
0
    def _run_py(self):
        for gp in self._grid_points:
            self._run_phonon_solver_py(gp)

        if self._sigma is None:
            self._set_integration_weights()

        t_inv = []
        for bi in self._band_indices:
            vec0 = self._eigenvectors[self._grid_point][:, bi].conj()
            f0 = self._frequencies[self._grid_point][bi]
            ti_sum = 0.0
            for i, gp in enumerate(self._grid_points):
                for j, (f, vec) in enumerate(
                        zip(self._frequencies[i], self._eigenvectors[i].T)):
                    if f < self._cutoff_frequency:
                        continue
                    ti_sum_band = np.sum(
                        np.abs((vec * vec0).reshape(-1, 3).sum(axis=1)) ** 2
                        * self._mass_variances)
                    if self._sigma is None:
                        ti_sum += ti_sum_band * self._integration_weights[
                            i, bi, j]
                    else:
                        ti_sum += ti_sum_band * gaussian(f0 - f, self._sigma)
            t_inv.append(np.pi / 2 / np.prod(self._mesh) * f0 ** 2 * ti_sum)

        self._gamma = np.array(t_inv, dtype='double') / 2
Exemplo n.º 2
0
 def _ise_at_bands(self, i, bi, freqs, interaction, weight):
     sum_g = 0
     for (j, k) in list(np.ndindex(interaction.shape[1:])):
         if (freqs[1][j] > self._cutoff_frequency
                 and freqs[2][k] > self._cutoff_frequency):
             n2 = occupation(freqs[1][j], self._temperature)
             n3 = occupation(freqs[2][k], self._temperature)
             g1 = gaussian(freqs[0, bi] - freqs[1, j] - freqs[2, k],
                           self._sigma)
             g2 = gaussian(freqs[0, bi] + freqs[1, j] - freqs[2, k],
                           self._sigma)
             g3 = gaussian(freqs[0, bi] - freqs[1, j] + freqs[2, k],
                           self._sigma)
             sum_g += ((n2 + n3 + 1) * g1 + (n2 - n3) *
                       (g2 - g3)) * interaction[i, j, k] * weight
     return sum_g
Exemplo n.º 3
0
    def _ise_at_bands_0K(self, i, bi, freqs, interaction, weight):
        sum_g = 0
        for (j, k) in list(np.ndindex(interaction.shape[1:])):
            g1 = gaussian(freqs[0, bi] - freqs[1, j] - freqs[2, k],
                          self._sigma)
            sum_g += g1 * interaction[i, j, k] * weight

        return sum_g
Exemplo n.º 4
0
    def _ise_with_frequency_points(self, freqs, interaction, weight):
        for j, k in list(np.ndindex(interaction.shape[1:])):
            if (freqs[0][j] > self._cutoff_frequency
                    and freqs[1][k] > self._cutoff_frequency):
                n2 = occupation(freqs[0][j], self._temperature)
                n3 = occupation(freqs[1][k], self._temperature)
                g1 = gaussian(
                    self._frequency_points - freqs[0][j] - freqs[1][k],
                    self._sigma)
                g2 = gaussian(
                    self._frequency_points + freqs[0][j] - freqs[1][k],
                    self._sigma)
                g3 = gaussian(
                    self._frequency_points - freqs[0][j] + freqs[1][k],
                    self._sigma)
            else:
                continue

            for i in range(len(interaction)):
                self._imag_self_energy[:, i] += (
                    (n2 + n3 + 1) * g1 + (n2 - n3) *
                    (g2 - g3)) * interaction[i, j, k] * weight
Exemplo n.º 5
0
 def _ise_with_frequency_points_0K(self, freqs, interaction, weight):
     for (i, j, k) in list(np.ndindex(interaction.shape)):
         g1 = gaussian(self._frequency_points - freqs[0][j] - freqs[1][k],
                       self._sigma)
         self._imag_self_energy[:, i] += g1 * interaction[i, j, k] * weight