pymatgen_diffusion/neb/full_path_mapper.py
def _get_avg_chg_at_max(
        self, migration_path, radius=None, chg_along_path=False, output_positions=False
    ):
        """obtain the maximum average charge along the path

        Args:
            migration_path (MigrationPath): MigrationPath object that represents a given hop
            radius (float, optional): radius of sphere to perform the average.
                    Defaults to None, which used the _tube_radius instead
            chg_along_path (bool, optional): If True, also return the entire list of average
                    charges along the path for plotting.
                    Defaults to False.
            output_positions (bool, optional): If True, also return the entire list of average
                    charges along the path for plotting.
                    Defaults to False.

        Returns:
            [float]: maximum of the charge density, (optional: entire list of charge density)
        """
        if radius is None:
            rr = self._tube_radius
        if not rr > 0:
            raise ValueError("The integration radius must be positive.")

        npf = self._get_pathfinder_from_hop(migration_path)
        # get the charge in a sphere around each point
        centers = [image.sites[0].frac_coords for image in npf.images]
        avg_chg = []
        for ict in centers:
            dist_mat = self._dist_mat(ict)
            mask = dist_mat < rr
            vol_sphere = self.base_aeccar.structure.volume * (
                mask.sum() / self.base_aeccar.ngridpts
            )
            avg_chg.append(
                np.sum(self.base_aeccar.data["total"] * mask)
                / self.base_aeccar.ngridpts
                / vol_sphere
            )
        if output_positions:
            return max(avg_chg), avg_chg, centers
        elif chg_along_path:
            return max(avg_chg), avg_chg
        else:
            return max(avg_chg)
obtain the maximum average charge along the path

        Args:
            migration_path (MigrationPath): MigrationPath object that represents a given hop
            radius (float, optional): radius of sphere to perform the average.
                    Defaults to None, which used the _tube_radius instead
            chg_along_path (bool, optional): If True, also return the entire list of average
                    charges along the path for plotting.
                    Defaults to False.
            output_positions (bool, optional): If True, also return the entire list of average
                    charges along the path for plotting.
                    Defaults to False.

        Returns:
            [float]: maximum of the charge density, (optional: entire list of charge density)
        
obtain the maximum average charge along the path
obtain the maximum average charge along the path
def _get_avg_chg_at_max(
        self, migration_path, radius=None, chg_along_path=False, output_positions=False
    ):
        if radius is None:
            rr = self._tube_radius
        if not rr > 0:
            raise ValueError("The integration radius must be positive.")
        npf = self._get_pathfinder_from_hop(migration_path)
        centers = [image.sites[0].frac_coords for image in npf.images]
        avg_chg = []
        for ict in centers:
            dist_mat = self._dist_mat(ict)
            mask = dist_mat < rr
            vol_sphere = self.base_aeccar.structure.volume * (
                mask.sum() / self.base_aeccar.ngridpts
            )
            avg_chg.append(
                np.sum(self.base_aeccar.data["total"] * mask)
                / self.base_aeccar.ngridpts
                / vol_sphere
            )
        if output_positions:
            return max(avg_chg), avg_chg, centers
        elif chg_along_path:
            return max(avg_chg), avg_chg
        else:
            return max(avg_chg)
def _get_avg_chg_at_max ( self , migration_path , radius = None , chg_along_path = False , output_positions = False ) : if radius is None : rr = self . _tube_radius if not rr > 0 : raise ValueError ( "The integration radius must be positive." ) npf = self . _get_pathfinder_from_hop ( migration_path ) centers = [ image . sites [ 0 ] . frac_coords for image in npf . images ] avg_chg = [ ] for ict in centers : dist_mat = self . _dist_mat ( ict ) mask = dist_mat < rr vol_sphere = self . base_aeccar . structure . volume * ( mask . sum ( ) / self . base_aeccar . ngridpts ) avg_chg . append ( np . sum ( self . base_aeccar . data [ "total" ] * mask ) / self . base_aeccar . ngridpts / vol_sphere ) if output_positions : return max ( avg_chg ) , avg_chg , centers elif chg_along_path : return max ( avg_chg ) , avg_chg else : return max ( avg_chg )
obtain the maximum average charge along the path
obtain the maximum average charge along the path
"""obtain the maximum average charge along the path

        Args:
            migration_path (MigrationPath): MigrationPath object that represents a given hop
            radius (float, optional): radius of sphere to perform the average.
                    Defaults to None, which used the _tube_radius instead
            chg_along_path (bool, optional): If True, also return the entire list of average
                    charges along the path for plotting.
                    Defaults to False.
            output_positions (bool, optional): If True, also return the entire list of average
                    charges along the path for plotting.
                    Defaults to False.

        Returns:
            [float]: maximum of the charge density, (optional: entire list of charge density)
        """ # get the charge in a sphere around each point
maximum of the charge density, (optional: entire list of charge density)
maximum of the charge density ( optional : entire list of charge density )
[float]
self
migration_path
MigrationPath object that represents a given hop
MigrationPath object that represents a given hop
radius
radius of sphere to perform the average.
Defaults to None, which used the _tube_radius instead
radius of sphere to perform the average . Defaults to None which used the _tube_radius instead
chg_along_path
If True, also return the entire list of average
charges along the path for plotting.
Defaults to False.
If True also return the entire list of average charges along the path for plotting . Defaults to False .
output_positions
If True, also return the entire list of average
charges along the path for plotting.
Defaults to False.
If True also return the entire list of average charges along the path for plotting . Defaults to False .