def parse_gw_results_two(gw_root: str, directories: list) -> dict: """ QP direct-gap (relative to the KS gap) and self-energies of the band edges at Gamma. Almost easier to just path full directive strings. :return: dictionary containing the above. """ # Data to parse and return delta_E_qp = np.empty(shape=(len(directories))) re_self_energy_VBM = np.empty(shape=delta_E_qp.shape) re_self_energy_CBm = np.empty(shape=delta_E_qp.shape) # Directory extension for ienergy, directory in enumerate(directories): file_path = gw_root + '/' + directory gw_data = parse_gw_info(file_path) qp_data = parse_gw_evalqp(file_path) print('Reading data from ', file_path) results = process_gw_gamma_point(gw_data, qp_data) delta_E_qp[ienergy] = results['E_qp'] - results['E_ks'] re_self_energy_VBM[ienergy] = results['re_sigma_VBM'] re_self_energy_CBm[ienergy] = results['re_sigma_CBm'] return { 'delta_E_qp': delta_E_qp, 're_self_energy_VBM': re_self_energy_VBM, 're_self_energy_CBm': re_self_energy_CBm }
def process_gw_calculation(path: str) -> dict: """ :param str path: Path to GW files :return: dict Processed GW data """ print('Reading data from ', path) gw_data = parse_gw_info(path) qp_data = parse_gw_evalqp(path) results = process_gw_gamma_point(gw_data, qp_data) if not results: return { 'delta_E_qp': [], 're_self_energy_VBM': [], 're_self_energy_CBm': [] } X_point = [0., 0.5, 0.5] Gamma_point = [0., 0., 0.] # Specific to the A1 system X (valence) -> Gamma (conduction) results_x_gamma = process_gw_gap(gw_data, qp_data, X_point, Gamma_point) results_x_x = process_gw_gap(gw_data, qp_data, X_point, X_point) return { 'E_qp': np.array(results['E_qp']), 'E_ks': np.array(results['E_ks']), 'E_qp_X_Gamma': np.array(results_x_gamma['E_qp']), 'E_ks_X_Gamma': np.array(results_x_gamma['E_ks']), 'E_qp_X_X': np.array(results_x_x['E_qp']), 'E_ks_X_X': np.array(results_x_x['E_ks']), 'delta_E_qp': np.array(results['E_qp'] - results['E_ks']), 're_self_energy_VBM': np.array(results['re_sigma_VBM']), 're_self_energy_CBm': np.array(results['re_sigma_CBm']) }
def parse_gw_results(root:str, settings:dict) -> dict: """ QP direct-gap (relative to the KS gap) and self-energies of the band edges at Gamma. Almost easier to just path full directive strings. :return: dictionary containing the above. """ # Basis settings rgkmax = settings['rgkmax'] l_max_values = settings['l_max_values'] max_energy_exts = settings['max_energy_cutoffs'] # GW settings n_empty_ext = settings['n_empty_ext'] q_grid = settings['q_grid'] n_img_freq = settings['n_img_freq'] # Data to parse and return delta_E_qp = np.empty(shape=(len(max_energy_exts), len(l_max_values))) re_self_energy_VBM = np.empty(shape=delta_E_qp.shape) re_self_energy_CBm = np.empty(shape=delta_E_qp.shape) q_str = "".join(str(q) for q in q_grid) # Lmax in LO basis for i, l_max in enumerate(l_max_values): basis_root = root + '/' + directory_string(l_max) + 'rgkmax' + str(rgkmax) gw_root = basis_root + "/gw_q" + q_str + "_omeg" + str(n_img_freq) + "_nempty" + str(n_empty_ext[i]) # Max energy cut-off of LOs in each l-channel for ienergy, energy in enumerate(max_energy_exts): file_path = gw_root + '/max_energy_' + str(energy) gw_data = parse_gw_info(file_path) qp_data = parse_gw_evalqp(file_path) print('Reading data from ', file_path) results = process_gw_gamma_point(gw_data, qp_data) delta_E_qp[ienergy, i] = results['E_qp'] - results['E_ks'] re_self_energy_VBM[ienergy, i] = results['re_sigma_VBM'] re_self_energy_CBm[ienergy, i] = results['re_sigma_CBm'] return {'delta_E_qp': delta_E_qp, 're_self_energy_VBM': re_self_energy_VBM, 're_self_energy_CBm': re_self_energy_CBm }
def process_gw_calculation(path: str) -> dict: """ This could be a more generic routine # TODO(Alex) Check parse_gw_evalqp parser is valid (and replace with one from exciting tools) :param str path: Path to GW files :return: dict Processed GW data """ print('Reading data from ', path) gw_data = parse_gw_info(path) qp_data = parse_gw_evalqp(path) results = process_gw_gamma_point(gw_data, qp_data) if not results: return { 'delta_E_qp': [], 're_self_energy_VBM': [], 're_self_energy_CBm': [] } X_point = [0., 0.5, 0.5] Gamma_point = [0., 0., 0.] # Specific to the A1 system X (valence) -> Gamma (conduction) results_x_gamma = process_gw_gap(gw_data, qp_data, X_point, Gamma_point) results_x_x = process_gw_gap(gw_data, qp_data, X_point, X_point) return { 'E_qp': np.array(results['E_qp']), 'E_ks': np.array(results['E_ks']), 'E_qp_X_Gamma': np.array(results_x_gamma['E_qp']), 'E_ks_X_Gamma': np.array(results_x_gamma['E_ks']), 'E_qp_X_X': np.array(results_x_x['E_qp']), 'E_ks_X_X': np.array(results_x_x['E_ks']), 'delta_E_qp': np.array(results['E_qp'] - results['E_ks']), 're_self_energy_VBM': np.array(results['re_sigma_VBM']), 're_self_energy_CBm': np.array(results['re_sigma_CBm']) }