<commit_before>#!/usr/bin/env python
# This code extracts the necessary information from current VASP output folders (self, dielectric, phonon, nself_aMoBT etc)
# and run aMoBT to calculate the electronic properties: mobility, conductivity and thermopower at different temperatures
# Please contact <EMAIL> if you had any questions. Bug reports are very much appreciated.
# By: <NAME> and <NAME>

import os

# After high, the arguments are optional (see the function code for more details)
def generate_aMoBT_input(type, T_array, n_array, Bgap, LO, static, high, free_e = 'false', E_deformation_n = 0.0, E_deformation_p = 0.0, kcbm = '0', kvbm = '0'): 
	with file('INPUTS.m', 'w') as indata:
		indata.write('function [T_array, n_array, Bgap, N_dis, k_min0, k_max, k_trans0, k_step_fine0, k_step0, maximum_iterations_for_g_PO, ...\n')
		indata.write('E, dTdz, m, omega_LO, epsilon_s, epsilon_inf, E_deformation_n, E_deformation_p, P_piezo, C_long, C_trans, ...\n')
		indata.write('c_lattice, curve_fit_iteration, folder_of_plots, spin_orbit_coupling, LORBIT, iterate_over_N_dis, free_e, type, ...\n')
		indata.write('kcbm, kvbm, T_trans, bands_n, bands_p, charge, VBM_band_number_override] = INPUTS \n')

		indata.write('[Bgap, default_T, N_dis, k_min0, k_max, k_trans0, k_step_fine0, k_step0, maximum_iterations_for_g_PO, ...\n')
		indata.write('E, dTdz, m, P_piezo, C_long, C_trans, c_lattice, curve_fit_iteration, folder_of_plots, bands_n, bands_p, ...\n')
		indata.write('spin_orbit_coupling, LORBIT, iterate_over_N_dis, free_e, kcbm, kvbm, T_trans, charge, VBM_band_number_override] = ...\n')
		indata.write('initialize;\n')

		indata.write('%s %s; \n' % ('T_array =', T_array))
		indata.write('%s %s; \n' % ('n_array =', n_array))
		indata.write("""free_e = '%s'; \n""" % free_e)
		indata.write("""type = '%s'; \n""" % type)

		indata.write('omega_LO = %f*2*pi*1e12; \n' % LO)
		indata.write('%s %f; \n' % ('epsilon_s =', static))
		indata.write('%s %f; \n' % ('epsilon_inf =', high))
		indata.write('%s %f; \n' % ('E_deformation_n =', E_deformation_n))
		indata.write('%s %f; \n' % ('E_deformation_p =', E_deformation_p))

		if kcbm is not '0':
			indata.write('%s [%s]; \n' % ('kcbm =', kcbm))
		if kvbm is not '0':
			indata.write('%s [%s]; \n' % ('kvbm =', kvbm))

		indata.write('%s %f; \n' % ('Bgap =', Bgap))
		
	return

def find_reference(scripts_path):
	os.system("cp " + scripts_path + "find_eval_eband.m .")
	os.system("octave -q --eval find_eval_eband.m")
	count = 0
	with open('val_kpoint.mat', "rU") as f:
		for line in f:
			count += 1
			if count == 6:
				kpoint = line
				kpoint = kpoint.split()
				val_kpoint = " ".join(kpoint)
	count = 0
	with open('con_kpoint.mat', "rU") as f:
		for line in f:
			count += 1
			if count == 6:
				kpoint = line
				kpoint = kpoint.split()
				con_kpoint = " ".join(kpoint)
	count = 0
	with open('econ.mat', "rU") as f:
		for line in f:
			count += 1
			if count == 4:
				econ = float(line)
	count = 0
	with open('eval.mat', "rU") as f:
		for line in f:<commit_msg>low-gaps replaced by Bgap=1 in aMoBT INPUTS<commit_after>#!/usr/bin/env python
# This code extracts the necessary information from current VASP output folders (self, dielectric, phonon, nself_aMoBT etc)
# and run aMoBT to calculate the electronic properties: mobility, conductivity and thermopower at different temperatures
# Please contact <EMAIL> if you had any questions. Bug reports are very much appreciated.
# By: <NAME> and <NAME>

import os

# After high, the arguments are optional (see the function code for more details)
def generate_aMoBT_input(type, T_array, n_array, Bgap, LO, static, high, free_e = 'false', E_deformation_n = 0.0, E_deformation_p = 0.0, kcbm = '0', kvbm = '0'): 
	with file('INPUTS.m', 'w') as indata:
		indata.write('function [T_array, n_array, Bgap, N_dis, k_min0, k_max, k_trans0, k_step_fine0, k_step0, maximum_iterations_for_g_PO, ...\n')
		indata.write('E, dTdz, m, omega_LO, epsilon_s, epsilon_inf, E_deformation_n, E_deformation_p, P_piezo, C_long, C_trans, ...\n')
		indata.write('c_lattice, curve_fit_iteration, folder_of_plots, spin_orbit_coupling, LORBIT, iterate_over_N_dis, free_e, type, ...\n')
		indata.write('kcbm, kvbm, T_trans, bands_n, bands_p, charge, VBM_band_number_override] = INPUTS \n')

		indata.write('[Bgap, default_T, N_dis, k_min0, k_max, k_trans0, k_step_fine0, k_step0, maximum_iterations_for_g_PO, ...\n')
		indata.write('E, dTdz, m, P_piezo, C_long, C_trans, c_lattice, curve_fit_iteration, folder_of_plots, bands_n, bands_p, ...\n')
		indata.write('spin_orbit_coupling, LORBIT, iterate_over_N_dis, free_e, kcbm, kvbm, T_trans, charge, VBM_band_number_override] = ...\n')
		indata.write('initialize;\n')

		indata.write('%s %s; \n' % ('T_array =', T_array))
		indata.write('%s %s; \n' % ('n_array =', n_array))
		indata.write("""free_e = '%s'; \n""" % free_e)
		indata.write("""type = '%s'; \n""" % type)

		indata.write('omega_LO = %f*2*pi*1e12; \n' % LO)
		indata.write('%s %f; \n' % ('epsilon_s =', static))
		indata.write('%s %f; \n' % ('epsilon_inf =', high))
		indata.write('%s %f; \n' % ('E_deformation_n =', E_deformation_n))
		indata.write('%s %f; \n' % ('E_deformation_p =', E_deformation_p))

		if kcbm is not '0':
			indata.write('%s [%s]; \n' % ('kcbm =', kcbm))
		if kvbm is not '0':
			indata.write('%s [%s]; \n' % ('kvbm =', kvbm))

		
		indata.write('%s %f; \n' % ('Bgap =', Bgap))
		if Bgap < 1:
			indata.write('%s %f; \n' % ('Bgap =', 1))
		
	return

def find_reference(scripts_path):
	os.system("cp " + scripts_path + "find_eval_eband.m .")
	os.system("octave -q --eval find_eval_eband.m")
	count = 0
	with open('val_kpoint.mat', "rU") as f:
		for line in f:
			count += 1
			if count == 6:
				kpoint = line
				kpoint = kpoint.split()
				val_kpoint = " ".join(kpoint)
	count = 0
	with open('con_kpoint.mat', "rU") as f:
		for line in f:
			count += 1
			if count == 6:
				kpoint = line
				kpoint = kpoint.split()
				con_kpoint = " ".join(kpoint)
	count = 0
	with open('econ.mat', "rU") as f:
		for line in f:
			count += 1
			if count == 4:
				econ = float(line)
	count = 0
	with open('eval.mat', "rU") as f:
		for line in f:
{'fraction_non_alphanumeric': 0.16918822189686025, 'fraction_numerical': 0.010248901903367497, 'mean_word_length': 4.188185654008439, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1619985', 'n_tokens_mistral': 2739, 'n_tokens_neox': 2510, 'n_words': 641}