Exemple #1
0
    def plot_full_rad(self, step, rotation=0):
        x, y, z = self._ranges
        Z, Y = np.meshgrid(z, y)
        density_slide = self.fn_electronic_density(np.array([[rotations.rotate_align_z([0, j, k],
                                                                                       rotation,
                                                                                       center=self._center,
                                                                                       align=self._align,
                                                                                       radial=self._radial
                                                                                       ) for k in z] for j in y]))

        for val in np.arange(self._ranges[0][0]+step, self._ranges[0][-1], step):
            density_slide += self.fn_electronic_density(np.array([[rotations.rotate_align_z([i, j, val],
                                                                                            rotation,
                                                                                            center=self._center,
                                                                                            align=self._align,
                                                                                            radial=self._radial
                                                                                            ) for j in y] for i in x]))
        density_slide *=step

        plt.contourf(Y, Z, density_slide)
        if self._radial:
            plt.xlabel("Angle (Radian)")
            plt.ylabel("Radius (Bohr)")
        else:
            plt.xlabel("Bohr")
            plt.ylabel("Bohr")
        plt.colorbar().set_label("Electronic density (e-/Bohr^3)")
        plt.show()
Exemple #2
0
 def get_density(self):
     if self._density is None:
         x, y, z = self._ranges
         self._density = self.fn_electronic_density(np.array([[[rotations.rotate_align_z([i, j, k],
                                                                               0,
                                                                               center=self._center,
                                                                               align=self._align,
                                                                               radial=self._radial,
                                                                               ) for k in z] for j in y] for i in x]))
     return self._density
Exemple #3
0
    def plot_full(self, step, rotation=0):
        x, y, z = self._ranges_cart

        Y, X = np.meshgrid(y, x)

        density_slide = self.fn_electronic_density(np.array([[rotations.rotate_align_z([i, j, 0],
                                                                                       rotation,
                                                                                       center=self._center,
                                                                                       align=self._align
                                                                                       ) for j in y] for i in x]))

        for val in np.arange(self._ranges[0][0]+step, self._ranges[0][-1], step):
            density_slide += self.fn_electronic_density(np.array([[rotations.rotate_align_z([i, j, val],
                                                                                            rotation,
                                                                                            center=self._center,
                                                                                            align=self._align
                                                                                            ) for j in y] for i in x]))
        density_slide *=step
    #    levels = np.linspace(0, 0.5, 40)
        plt.xlabel("Bohr")
        plt.ylabel("Bohr")
        plt.contourf(X, Y, density_slide)
        plt.colorbar().set_label("Electronic density (e-/Bohr^2)")
        plt.show()
Exemple #4
0
    def get_total_overlap(self):
        if self._total_overlap is None:
       #     print('getting_overlap')
            x, y, z = self._ranges
            overlappings = []
            for i in range(self._order):
  #              print('overlap: {0}'.format(i))
                angle = 2*np.pi/self._order * i
                dens_rot = self.fn_electronic_density(np.array([[[rotations.rotate_align_z([i, j, k],
                                                                                 angle, center=self._center,
                                                                                 align=self._align,
                                                                                 radial=self._radial
                                                                                 ) for k in z] for j in y] for i in x]))

                overlappings.append(np.multiply(self.get_density(), dens_rot))

            self._total_overlap = sum(overlappings)/self._order
        return self._total_overlap
Exemple #5
0
    def plot_slide_rad(self, val, rotation=0):
        x, y, z = self._ranges
        Z, Y = np.meshgrid(z, y)
        density_slide = self.fn_electronic_density(np.array([[rotations.rotate_align_z([val, j, k],
                                                                                        rotation,
                                                                                        center=self._center,
                                                                                        align=self._align,
                                                                                        radial=self._radial
                                                                                        ) for k in z] for j in y]))

        plt.contourf(Y, Z, density_slide)
        if self._radial:
            plt.xlabel("Angle (Radian)")
            plt.ylabel("Radius (Bohr)")
        else:
            plt.xlabel("Bohr")
            plt.ylabel("Bohr")
        plt.colorbar().set_label("Electronic density (e-/Bohr^3)")
        plt.show()