def generate_defect_structure(self, supercell=(1, 1, 1)):
        """
        Returns Defective Vacancy structure, decorated with charge
        Args:
            supercell (int, [3x1], or [[]] (3x3)): supercell integer, vector, or scaling matrix
        """
        defect_structure = self.bulk_structure.copy()
        defect_structure.make_supercell(supercell)

        #create a trivial defect structure to find where supercell transformation moves the lattice
        struct_for_defect_site = Structure( self.bulk_structure.copy().lattice,
                                             [self.site.specie],
                                             [self.site.frac_coords],
                                             to_unit_cell=True)
        struct_for_defect_site.make_supercell(supercell)
        defect_site = struct_for_defect_site[0]

        poss_deflist = sorted(
            defect_structure.get_sites_in_sphere(defect_site.coords, 2, include_index=True), key=lambda x: x[1])
        defindex = poss_deflist[0][2]
        defect_structure.remove_sites([defindex])
        defect_structure.set_charge(self.charge)
        return defect_structure
def generate_defect_structure ( self , supercell = ( 1 , 1 , 1 ) ) : defect_structure = self . bulk_structure . copy ( ) defect_structure . make_supercell ( supercell ) struct_for_defect_site = Structure ( self . bulk_structure . copy ( ) . lattice , [ self . site . specie ] , [ self . site . frac_coords ] , to_unit_cell = True ) struct_for_defect_site . make_supercell ( supercell ) defect_site = struct_for_defect_site [ 0 ] poss_deflist = sorted ( defect_structure . get_sites_in_sphere ( defect_site . coords , 2 , include_index = True ) , key = lambda x : x [ 1 ] ) defindex = poss_deflist [ 0 ] [ 2 ] defect_structure . remove_sites ( [ defindex ] ) defect_structure . set_charge ( self . charge ) return defect_structure
Returns Defective Vacancy structure, decorated with charge
        Args:
            supercell (int, [3x1], or [[]] (3x3)): supercell integer, vector, or scaling matrix