Beispiel #1
0
 def HSE_gap_with_shot(self,stru=None,output_dir='./',**kws):
     path = os.path.join(output_dir,self.name)
     incar_add={}
     if self.is_spin_polarized:
         incar_add["ISPIN"] = 2
     else:
         incar_add["ISPIN"] = 1
     incar_add["EDIFF"] = 1E-4
     incar_add["SYSTEM"] = self.name+"_HSE_StaticRun"
     incar_add["IBRION"] = -1
     incar_add["HFSCREEN"] = 0.2
     incar_add["PREC"] = "Accurate"
     incar_add["PRECFOCK"] = "Fast"
     incar_add["KPAR"] = 2
     if stru is None:
         dict_params = MPHSEBSSet(self.stru, user_incar_settings=incar_add,
                     reciprocal_density=100).all_input
     else:
         dict_params = MPHSEBSSet(stru, user_incar_settings=incar_add,
                 reciprocal_density=100).all_input
     incar=dict_params["INCAR"]
     kpoints = dict_params["KPOINTS"]
     ks=[]
     if self.kpbevbm is None:
         try:
             self.kpbevbm=np.array([float(i) for i in kws['kvbm']])
             self.kpbecbm=np.array([float(i) for i in kws['kcbm']])
         except:
             print 'Error: PBE bandstruct is a metal, please input kvbm and kcbm by hand!\n \
                    For example, kvbm=[0,0,0],kcbm=[0.5,0.5,0.0]'
             return
     if set(self.kpbevbm==self.kpbecbm)==set([True]):
         ks.append(self.kpbevbm)
     else:
         ks.append(self.kpbevbm);ks.append(self.kpbecbm)
     for k in ks:
         exist = False
         for k_host in kpoints.kpts:
             if (np.array(k)==np.array(k_host)).all():
                 exist=True
                 break
         if exist:
             continue
         kpoints.kpts.append(k)
         kpoints.kpts_weights.append(0)
         kpoints.labels.append('')
     kpoints.num_kpts = len(kpoints.kpts_weights)
     transf = {'history':[{'source':self.mpid,'unit_cell':'primitive'}],'defect_type':'HSE_gap'}
     os.mkdir(path)
     f=open(os.path.join(path,'transformations.json'),'w')
     f.write(json.dumps(jsanitize(transf)))
     incar.write_file(path+"/INCAR")
     dict_params["POTCAR"].write_file(path+"/POTCAR")
     dict_params["POSCAR"].write_file(path+"/POSCAR")
     kpoints.write_file(path+"/KPOINTS")
 def run_task(self, fw_spec):
     vis = MPHSEBSSet.from_prev_calc(self["prev_calc_dir"],
                                     mode=self.get("mode", "Uniform"),
                                     reciprocal_density=self.get(
                                         "reciprocal_density", 50),
                                     copy_chgcar=False)
     vis.write_input(".")
Beispiel #3
0
 def run_task(self, fw_spec):
     vis = MPHSEBSSet.from_prev_calc(self.get("prev_calc_dir", "."),
                                     mode=self.get("mode", "uniform"),
                                     reciprocal_density=self.get("reciprocal_density", 50),
                                     kpoints_line_density=self.get("kpoints_line_density", 10),
                                     copy_chgcar=False)
     vis.write_input(".")
Beispiel #4
0
 def run_task(self, fw_spec):
     vis = MPHSEBSSet.from_prev_calc(
         self.get("prev_calc_dir", "."),
         mode=self.get("mode", "uniform"),
         reciprocal_density=self.get("reciprocal_density", 50),
         kpoints_line_density=self.get("kpoints_line_density", 10),
         copy_chgcar=False,
     )
     potcar_spec = self.get("potcar_spec", False)
     vis.write_input(".", potcar_spec=potcar_spec)