def __init__(self, lattice, miller_list, e_surf_list, symprec=1e-5):
        """
        Args:
            lattice: Lattice object of the conventional unit cell
            miller_list ([(hkl), ...]: list of hkl or hkil for hcp
            e_surf_list ([float]): list of corresponding surface energies
            symprec (float): for recp_operation, default is 1e-5.
        """

        if any([se < 0 for se in e_surf_list]):
            warnings.warn("Unphysical (negative) surface energy detected.")

        self.color_ind = list(range(len(miller_list)))

        self.input_miller_fig = [hkl_tuple_to_str(x) for x in miller_list]
        # store input data
        self.structure = Structure(lattice, ["H"], [[0, 0, 0]])
        self.miller_list = tuple([tuple(x) for x in miller_list])
        self.hkl_list = tuple([(x[0], x[1], x[-1]) for x in miller_list])
        self.e_surf_list = tuple(e_surf_list)
        self.lattice = lattice
        self.symprec = symprec

        # 2. get all the data for wulff construction
        # get all the surface normal from get_all_miller_e()
        self.facets = self._get_all_miller_e()
        logger.debug(len(self.facets))

        # 3. consider the dual condition
        dual_pts = [x.dual_pt for x in self.facets]
        dual_convex = ConvexHull(dual_pts)
        dual_cv_simp = dual_convex.simplices
        # simplices	(ndarray of ints, shape (nfacet, ndim))
        # list of [i, j, k] , ndim = 3
        # i, j, k: ind for normal_e_m
        # recalculate the dual of dual, get the wulff shape.
        # conner <-> surface
        # get cross point from the simplices of the dual convex hull
        wulff_pt_list = [self._get_cross_pt_dual_simp(dual_simp)
                         for dual_simp in dual_cv_simp]

        wulff_convex = ConvexHull(wulff_pt_list)
        wulff_cv_simp = wulff_convex.simplices
        logger.debug(", ".join([str(len(x)) for x in wulff_cv_simp]))

        # store simplices and convex
        self.dual_cv_simp = dual_cv_simp
        self.wulff_pt_list = wulff_pt_list
        self.wulff_cv_simp = wulff_cv_simp
        self.wulff_convex = wulff_convex

        self.on_wulff, self.color_area = self._get_simpx_plane()

        miller_area = []
        for m, in_mill_fig in enumerate(self.input_miller_fig):
            miller_area.append(
                in_mill_fig + ' : ' + str(round(self.color_area[m], 4)))
        self.miller_area = miller_area
def __init__ ( self , lattice , miller_list , e_surf_list , symprec = 1e-5 ) : if any ( [ se < 0 for se in e_surf_list ] ) : warnings . warn ( "Unphysical (negative) surface energy detected." ) self . color_ind = list ( range ( len ( miller_list ) ) ) self . input_miller_fig = [ hkl_tuple_to_str ( x ) for x in miller_list ] self . structure = Structure ( lattice , [ "H" ] , [ [ 0 , 0 , 0 ] ] ) self . miller_list = tuple ( [ tuple ( x ) for x in miller_list ] ) self . hkl_list = tuple ( [ ( x [ 0 ] , x [ 1 ] , x [ - 1 ] ) for x in miller_list ] ) self . e_surf_list = tuple ( e_surf_list ) self . lattice = lattice self . symprec = symprec self . facets = self . _get_all_miller_e ( ) logger . debug ( len ( self . facets ) ) dual_pts = [ x . dual_pt for x in self . facets ] dual_convex = ConvexHull ( dual_pts ) dual_cv_simp = dual_convex . simplices wulff_pt_list = [ self . _get_cross_pt_dual_simp ( dual_simp ) for dual_simp in dual_cv_simp ] wulff_convex = ConvexHull ( wulff_pt_list ) wulff_cv_simp = wulff_convex . simplices logger . debug ( ", " . join ( [ str ( len ( x ) ) for x in wulff_cv_simp ] ) ) self . dual_cv_simp = dual_cv_simp self . wulff_pt_list = wulff_pt_list self . wulff_cv_simp = wulff_cv_simp self . wulff_convex = wulff_convex self . on_wulff , self . color_area = self . _get_simpx_plane ( ) miller_area = [ ] for m , in_mill_fig in enumerate ( self . input_miller_fig ) : miller_area . append ( in_mill_fig + ' : ' + str ( round ( self . color_area [ m ] , 4 ) ) ) self . miller_area = miller_area
Args:
            lattice: Lattice object of the conventional unit cell
            miller_list ([(hkl), ...]: list of hkl or hkil for hcp
            e_surf_list ([float]): list of corresponding surface energies
            symprec (float): for recp_operation, default is 1e-5.