def MAPI_soc_data_object_with_DOSCAR( MAPI_settings_object ): # MAPI spin orbit coupling calculation data with doscar loaded data = inputs.DataVasp(os.path.join(os.path.dirname(__file__), 'data_vasp/MAPI_soc_OUTCAR'), os.path.join(os.path.dirname(__file__), 'data_vasp/MAPI_soc_PROCAR'), ignore=216) data.parse_DOSCAR( os.path.join(os.path.dirname(__file__), 'data_vasp/MAPI_soc_DOSCAR')) return data
def toy_data_object(): data_object = inputs.DataVasp(os.path.join(os.path.dirname(__file__), 'data_vasp/MAPI_soc_OUTCAR'), os.path.join(os.path.dirname(__file__), 'data_vasp/MAPI_soc_PROCAR'), ignore=0) data_object.number_of_kpoints = 5 data_object.number_of_bands = 2 data_object.number_of_ions = 1 data_object.kpoints = np.array([[0, 0, 0], [0.25, 0, 0], [0.5, 0, 0], [0.5, 0.25, 0], [0.5, 0.5, 0]]) data_object.energies = np.array([[1, 0.5], [2, 1], [1, 0.49124914462], [2, 1.04], [1, 0.4649965785], [2, 1.07], [1, 0.48], [2, 1.04], [1, 0.46], [2, 1.0005]])[:, 1:].reshape( data_object.number_of_kpoints, data_object.number_of_bands).T data_object.occupancy = np.array([[1, 1], [2, 0], [1, 1], [2, 0], [1, 1], [2, 0], [1, 1], [2, 0], [1, 1], [2, 0]])[:, 1:].reshape( data_object.number_of_kpoints, data_object.number_of_bands).T data_object.reciprocal_lattice = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) data_object.CBM = 1 data_object.VBM = 0.5 data_object.fermi_energy = 0.75 data_object.dos = np.array([[0.42, 0], [0.46, 7], [0.47, 3], [0.48, 5], [0.49, 3], [0.5, 24], [0.6, 0], [0.7, 0], [0.8, 0], [0.9, 0], [1.0, 3.1], [1.02, 0.2], [1.04, 3.20], [1.06, 1.215]]) data_object.integrated_dos = np.array([[0.42, 3], [0.46, 3.02], [0.47, 3.04], [0.48, 3.08], [0.49, 3.08], [0.5, 3.16], [0.6, 3.16], [0.7, 3.16], [0.8, 3.16], [0.9, 3.16], [1.0, 3.17], [1.02, 3.19], [1.04, 3.20], [1.06, 3.215]]) return data_object
def cli(): print("Welcome to effmass 2.0.0 \U0001F388") ignore, seedname, fermi_level = None, None, None random_int = randint(10000, 99999) DFT_code = questionary.select( "Which DFT code have you used to generate the bandstructure?", choices=['Vasp', 'FHI-aims', 'Castep']).ask() pathname = questionary.path( "What's the path to your {} output files?".format(DFT_code), default="./", only_directories=True).ask() if DFT_code == 'Vasp': ignore = questionary.text( "How many k-points should I ignore at the start of the file? (useful for hybrid calculations)", default="0").ask() if DFT_code == 'Castep': seedname = questionary.text( "What's the seedname of your Castep files? (e.g. Si.bands and Si.castep have the seedname Si)", ).ask() fermi_level = questionary.text( "I will infer the position of the CBM and VBM from the calculated Fermi level." + " If you know this value to be incorrect, please input a more accurate value:", ).ask() extrema_search_depth = questionary.text( "How far (in eV) from the CBM (VBM) would you like me to search for minima (maxima)?", default="0.05").ask() energy_range = questionary.text( "What would you like the energy range (in eV) of each segment to be?", default="0.5").ask() which_values = questionary.checkbox( "Which values would you like me to calculate?", choices=[ questionary.Choice("parabolic m* (least squares)", checked=True), questionary.Choice("parabolic m* (finite difference)", checked=True) ]).ask() # need to select oe save_plot = questionary.confirm( "Would you like me to save a plot of the band segments?", default=True, auto_enter=False).ask() save_summary = questionary.confirm( "Would you like me to save a summary file?", default=True, auto_enter=False).ask() settings = inputs.Settings( extrema_search_depth=float(extrema_search_depth), energy_range=float(energy_range)) print("Reading in data...") if DFT_code == "Vasp": data = inputs.DataVasp(pathname + "/OUTCAR", pathname + "/PROCAR", ignore=int(ignore)) elif DFT_code == "FHI-aims": data = inputs.DataAims(pathname) else: data = inputs.DataCastep(pathname + "/", seedname) if fermi_level: data.fermi_level = fermi_level data.find_cbm_vbm() print("Finding extrema...") print("Generating segments...") segments = extrema.generate_segments(settings, data) print("Calculating effective masses...") table = outputs.make_table(segments, which_values) outputs.print_terminal_table(table) if save_plot: print("Plotting segments...") outputs.plot_segments(data, settings, segments, savefig=True, random_int=random_int) print("Plot of segments saved to effmass_{}.png".format(random_int)) if save_summary: print("Writing summary file...") outputs.print_summary_file(random_int, DFT_code, pathname, ignore, seedname, fermi_level, extrema_search_depth, energy_range, table) print("Summary file saved as effmass_{}.txt".format(random_int))
def MAPI_cl_data_object(): # MAPI cl calculation data return inputs.DataVasp(os.path.join(os.path.dirname(__file__), 'data_vasp/MAPI_cl_OUTCAR'), os.path.join(os.path.dirname(__file__), 'data_vasp/MAPI_cl_PROCAR'), ignore=216)
def Ge_SP_data_object(): # Ge spin-polarised calculation from Adam Jackson return inputs.DataVasp( os.path.join(os.path.dirname(__file__), 'data_vasp/Ge_SP_OUTCAR'), os.path.join(os.path.dirname(__file__), 'data_vasp/Ge_SP_PROCAR'))