schrodinger.application.matsci.qexsd.qespresso.converters module

Data format converters for Quantum Espresso

class schrodinger.application.matsci.qexsd.qespresso.converters.NebInputConverter(**kwargs)

Bases: schrodinger.application.matsci.qexsd.qespresso.converters.RawInputConverter

Convert to/from Fortran input for Phonon.

NEB_TEMPLATE_MAP = {'path': {'totChargeLast': 'PATH[fcp_tot_charge_last]', 'elasticConstMin': 'PATH[k_min]', 'temperature': 'PATH[temp_req]', 'stringMethod': 'PATH[string_method]', 'pathNstep': 'PATH[nstep_path]', 'pathThreshold': 'PATH[path_thr]', 'useFreezingFlag': 'PATH[use_freezing]', 'targetFermiEnergy': 'PATH[fcp_mu]', 'useMassesFlag': 'PATH[use_masses]', 'elasticConstMax': 'PATH[k_max]', 'constantBiasFlag': 'PATH[lfcpopt]', 'totChargeFirst': 'PATH[fcp_tot_charge_first]', 'endImagesOptimizationFlag': 'PATH[first_last_opt]', 'restartMode': 'PATH[restart_mode]', 'climbingImageIndex': ('CLIMBING_IMAGES', <function get_climbing_images>, None), 'optimizationStepLength': 'PATH[ds]', 'optimizationScheme': 'PATH[opt_scheme]', 'numOfImages': 'PATH[num_of_images]', 'climbingImage': ['PATH[CI_scheme]', ('CLIMBING_IMAGES', <function get_climbing_images>, None)]}}
get_qe_input()

Overrides method in RawInputConverter because few lines in between the namelists are requested for the NEB input. :return: a string containing the text input for NEB calculations

class schrodinger.application.matsci.qexsd.qespresso.converters.PhononInputConverter(**kwargs)

Bases: schrodinger.application.matsci.qexsd.qespresso.converters.RawInputConverter

Convert to/from Fortran input for Phonon.

PHONON_TEMPLATE_MAP = {'files': {'fildvscf': 'INPUTPH[fildvscf]', 'fildyn': 'INPUTPH[fildyn]', 'prefix': 'INPUTPH[prefix]', 'fildrho': 'INPUTPH[fildrho]', 'outdir': 'INPUTPH[outdir]', 'lqdir': 'INPUTPH[lqdir]'}, 'scf_ph': {'tr2_ph': 'INPUTPH[tr2_ph]', 'niter_ph': 'INPUTPH[niter_ph]', 'nmix_ph': 'INPUTPH[nmix_ph]', 'alpha_mix': 'INPUTPH[alpha_mix]'}, 'control_qplot': {'q_in_band_form': 'INPUTPH[q_in_band_form]', 'qplot': [('qPointsSpecs', <function get_qpoints_card>, None), 'INPUTPH[qplot]'], 'q2d': 'INPUTPH[q2d]'}, 'miscellanea': {'amass': {'_text': ('INPUTPH[amass]', <function setOneAmassLine>, None)}, 'verbosity': 'INPUTPH[verbosity]', 'low_directory_check': 'INPUTPH[low_directory_check]', 'nscf_MPgrid': {'k2': 'INPUTPH[k2]', 'k1': 'INPUTPH[k1]', 'k3': 'INPUTPH[k3]', 'nk1': 'INPUTPH[nk1]', 'nk2': 'INPUTPH[nk2]', 'nk3': 'INPUTPH[nk3]'}, 'reduce_io': 'INPUTPH[reduce_io]', 'nogg': 'INPUTPH[nogg]'}, 'xq': ('qPointsSpecs', <function get_qpoints_card>, None), 'irr_repr': {'last_irr': 'INPUTPH[last_irr]', 'nat_todo': 'INPUTPH[nat_todo]', 'only_init': 'INPUTPH[only_init]', 'ldiag': 'INPUTPH[ldiag]', 'last_q': 'INPUTPH[last_q]', 'modenum': 'INPUTPH[modenum]', 'start_irr': 'INPUTPH[start_irr]', 'start_q': 'INPUTPH[start_q]'}, 'control_diel': {'lnoloc': 'INPUTPH[lnoloc]', 'lrpa': 'INPUTPH[lrpa]'}, 'electron_phonon_options': {'electron_phonon': 'INPUTPH[electron_phonon]', 'drho_star': {'pat': 'INPUTPH[drho_star%pat]', 'ext': 'INPUTPH[drho_star%ext]', 'open': 'INPUTPH[drho_star%open]', 'dir': 'INPUTPH[drho_star%dir]', 'basis': 'INPUTPH[drho_star%basis]'}, 'dvscf_star': {'pat': 'INPUTPH[dvscf_star%pat]', 'ext': 'INPUTPH[dvscf_star%ext]', 'open': 'INPUTPH[dvscf_star%open]', 'dir': 'INPUTPH[dvscf_star%dir]', 'basis': 'INPUTPH[dvscf_star%basis]'}}, 'control_ph': {'epsil': 'INPUTPH[epsil]', 'search_sym': 'INPUTPH[search_sym]', 'fpol': 'INPUTPH[fpol]', 'elop': 'INPUTPH[elop]', 'zeu': 'INPUTPH[zeu]', 'trans': 'INPUTPH[trans]', 'ldisp': ['INPUTPH[ldisp]', ('qPointsSpecs', <function get_qpoints_card>, None)], 'lraman': 'INPUTPH[lraman]', 'zue': 'INPUTPH[zue]'}, 'control_job': {'recover': 'INPUTPH[recover]', 'max_seconds': 'INPUTPH[max_seconds]'}, 'q_points': {'q_points_list': ('qPointsSpecs', <function get_qpoints_card>, None), 'grid': {'nq2': 'INPUTPH[nq2]', 'nq3': 'INPUTPH[nq3]', 'nq1': 'INPUTPH[nq1]'}, 'nqs': ('qPointsSpecs', <function get_qpoints_card>, None)}, 'lraman_options': {'eth_rps': 'INPUTPH[eth_rps]', 'eth_ns': 'INPUTPH[eth_ns]', 'dek': 'INPUTPH[dek]'}}
class schrodinger.application.matsci.qexsd.qespresso.converters.PwInputConverter(**kwargs)

Bases: schrodinger.application.matsci.qexsd.qespresso.converters.RawInputConverter

Builds a Fortran’s namelist input for PWscf.

PW_TEMPLATE_MAP = {'boundary_conditions': {'esm': {'nfit': 'SYSTEM[esm_nfit]', 'efield': 'SYSTEM[esm_efield]', 'w': 'SYSTEM[esm_w]', 'bc': 'SYSTEM[esm_bc]'}, 'assume_isolated': 'SYSTEM[assume_isolated]', 'fcp_mu': 'SYSTEM[fcp_mu]', 'fcp_opt': 'CONTROL[lfcpopt]'}, 'symmetry_flags': {'force_symmorphic': 'SYSTEM[force_symmorphic]', 'nosym_evc': 'SYSTEM[nosym_evc]', 'noinv': 'SYSTEM[noinv]', 'use_all_frac': 'SYSTEM[use_all_frac]', 'nosym': 'SYSTEM[nosym]', 'no_t_rev': 'SYSTEM[no_t_rev]'}, 'basis': {'fft_box': {'nr3': 'SYSTEM[nr3b]', 'nr2': 'SYSTEM[nr2b]', 'nr1': 'SYSTEM[nr1b]'}, 'fft_grid': {'nr3': 'SYSTEM[nr3]', 'nr2': 'SYSTEM[nr2]', 'nr1': 'SYSTEM[nr1]'}, 'ecutwfc': 'SYSTEM[ecutwfc]', 'ecutrho': 'SYSTEM[ecutrho]', 'gamma_only': ('K_POINTS', <function get_k_points_card>, None), 'fft_smooth': {'nr3': 'SYSTEM[nr3s]', 'nr2': 'SYSTEM[nr2s]', 'nr1': 'SYSTEM[nr1s]'}}, 'spin_constraints': {'lagrange_multiplier': 'SYSTEM[lambda]', 'spin_constraints': 'SYSTEM[constrained_magnetization]', 'target_magnetization': 'SYSTEM[fixed_magnetization]'}, 'dft': {'hybrid': {'ecutfock': ('SYSTEM[ecutfock:]', <function Ha2Ry>, None), 'exxdiv_treatment': 'SYSTEM[exxdiv_treatment]', 'x_gamma_extrapolation': 'SYSTEM[x_gamma_extrapolation]', 'exx_fraction': 'SYSTEM[exx_fraction]', 'qpoint_grid': {'nqx3': 'SYSTEM[nqx3]', 'nqx2': 'SYSTEM[nqx2]', 'nqx1': 'SYSTEM[nqx1]'}, 'ecutvcut': ('SYSTEM[ecutvcut]', <function Ha2Ry>, None), 'screening_parameter': 'SYSTEM[screening_parameter]'}, 'functional': 'SYSTEM[input_dft]', 'vdW': {'xdm_a1': 'SYSTEM[xdm_a1]', 'xdm_a2': 'SYSTEM[xdm_a2]', 'ts_vdw_isolated': 'SYSTEM[ts_vdw_isolated]', 'london_s6': 'SYSTEM[london_s6]', 'london_rcut': 'SYSTEM[london_rcut]', 'vdw_corr': 'SYSTEM[vdw_corr]', 'london_c6': {'_text': ('SYSTEM[london_c6]', <function get_specie_related_values>, None)}, 'ts_vdw_econv_thr': 'SYSTEM[ts_vdw_econv_thr]'}, 'dftU': {'lda_plus_u_kind': 'SYSTEM[lda_plus_u_kind]', 'Hubbard_J0': {'_text': ('SYSTEM[Hubbard_J0]', <function get_specie_related_values>, None)}, 'U_projection_type': 'SYSTEM[U_projection_type]', 'Hubbard_U': {'_text': [('SYSTEM[Hubbard_U]', <function get_specie_related_values>, None), ('SYSTEM[lda_plus_U]', <function set_lda_plus_u_flag>, None)]}, 'Hubbard_alpha': {'_text': ('SYSTEM[Hubbard_alpha]', <function get_specie_related_values>, None)}, 'Hubbard_J': {'_text': ('SYSTEM[Hubbard_J]', <function get_specie_related_values>, None)}, 'starting_ns': {'_text': ('SYSTEM[starting_ns_eigenvalue]', <function get_specie_related_values>, None)}, 'Hubbard_beta': {'_text': ('SYSTEM[Hubbard_beta]', <function get_specie_related_values>, None)}}}, 'ekin_functional': {'ecfixed': 'SYSTEM[ecfixed]', 'qcutz': 'SYSTEM[qcutz]', 'q2sigma': 'SYSTEM[q2sigma]'}, 'k_points_IBZ': ('K_POINTS', <function get_k_points_card>, None), 'electron_control': {'conv_thr': 'ELECTRONS[conv_thr]', 'mixing_ndim': 'ELECTRONS[mixing_ndim]', 'mixing_mode': 'ELECTRONS[mixing_mode]', 'tbeta_smoothing': 'ELECTRONS[tbeta_smoothing]', 'mixing_beta': 'ELECTRONS[mixing_beta]', 'tq_smoothing': 'ELECTRONS[tq_smoothing]', 'diago_thr_init': 'ELECTRONS[diago_thr_init]', 'max_nstep': 'ELECTRONS[electron_maxstep]', 'diago_cg_maxiter': 'ELECTRONS[diago_cg_maxiter]', 'diagonalization': 'ELECTRONS[diagonalization]', 'diago_full_acc': 'ELECTRONS[diago_full_acc]', 'real_space_q': 'ELECTRONS[tqr]'}, 'ion_control': {'md': {'ion_temperature': 'IONS[ion_temperature]', 'pot_extrapolation': 'IONS[pot_extrapolation]', 'wfc_extrapolation': 'IONS[wfc_extrapolation]', 'tolp': 'IONS[tolp]', 'timestep': 'CONTROL[dt]', 'tempw': 'IONS[tempw]', 'nraise': 'IONS[nraise]', 'deltaT': 'IONS[delta_t]'}, 'bfgs': {'ndim': 'IONS[bfgs_ndim]', 'trust_radius_init': 'IONS[trust_radius_ini]', 'trust_radius_min': 'IONS[trust_radius_min]', 'trust_radius_max': 'IONS[trust_radius_max]', 'w2': 'IONS[w_2]', 'w1': 'IONS[w_1]'}, 'upscale': 'IONS[upscale]', 'refold_pos': 'IONS[refold_pos]', 'remove_rigid_rot': 'IONS[remove_rigid_rot]', 'ion_dynamics': 'IONS[ion_dynamics]'}, 'atomic_constraints': ('CONSTRAINTS', <function get_atomic_constraints_card>), 'electric_field': {'electric_potential': [('CONTROL[tefield]', <function get_electric_potential_related>), ('CONTROL[lelfield]', <function get_electric_potential_related>), ('CONTROL[lberry]', <function get_electric_potential_related>), ('SYSTEM[eamp]', <function get_system_eamp>), ('ELECTRONS[efield]', <function get_electrons_efield>), ('SYSTEM[edir]', <function get_system_edir>), ('CONTROL[gdir]', <function get_control_gdir>)], 'potential_decrease_width': 'SYSTEM[eopreg]', 'nk_per_string': 'CONTROL[nppstr]', 'potential_max_position': 'SYSTEM[emaxpos]', 'n_berry_cycles': 'CONTROL[nberrycyc]', 'electric_field_direction': [('SYSTEM[edir]', <function get_system_edir>), ('CONTROL[gdir]', <function get_control_gdir>)], 'dipole_correction': 'CONTROL[dipfield]', 'electric_field_amplitude': [('SYSTEM[eamp]', <function get_system_eamp>), ('ELECTRONS[efield]', <function get_electrons_efield>)], 'electric_field_vector': 'ELECTRONS[efield_cart]'}, 'external_atomic_forces': ('ATOMIC_FORCES', <function get_atomic_forces_card>, None), 'bands': {'nbnd': 'SYSTEM[nbnd]', 'occupations': {'_text': 'SYSTEM[occupations]'}, 'smearing': {'degauss': 'SYSTEM[degauss]', '_text': 'SYSTEM[smearing]'}, 'tot_charge': 'SYSTEM[tot_charge]', 'tot_magnetization': 'SYSTEM[tot_magnetization]'}, 'control_variables': {'stress': 'CONTROL[tstress]', 'disk_io': 'CONTROL[disk_io]', 'wf_collect': 'CONTROL[wf_collect]', 'title': 'CONTROL[title]', 'calculation': 'CONTROL[calculation]', 'verbosity': 'CONTROL[verbosity]', 'pseudo_dir': 'CONTROL[pseudo_dir]', 'print_every': 'CONTROL[iprint]', 'forc_conv_thr': 'CONTROL[forc_conv_thr]', 'prefix': 'CONTROL[prefix]', 'max_seconds': 'CONTROL[max_seconds]', 'forces': 'CONTROL[tprnfor]', 'etot_conv_thr': 'CONTROL[etot_conv_thr]', 'restart_mode': 'CONTROL[restart_mode]', 'press_conv_thr': 'CELL[press_conv_thr]', 'nstep': 'CONTROL[nstep]', 'outdir': 'CONTROL[outdir]'}, 'atomic_structure': {'crystal_positions': ('ATOMIC_FORCES', <function get_atomic_forces_card>, None), 'atomic_positions': ('ATOMIC_FORCES', <function get_atomic_forces_card>, None), 'nat': 'SYSTEM[nat]', '_text': [('SYSTEM[ibrav]', <function set_ibrav_to_zero>, None), ('ATOMIC_POSITIONS', <function get_atomic_positions_cell_card>, None), ('CELL_PARAMETERS', <function get_cell_parameters_card>, None)]}, 'cell_control': {'fix_volume': ('CELL[cell_dofree]', <function get_cell_dofree>, None), 'pressure': 'CELL[press]', 'isotropic': ('CELL[cell_dofree]', <function get_cell_dofree>, None), 'fix_area': ('CELL[cell_dofree]', <function get_cell_dofree>, None), 'free_cell': ('CELL_PARAMETERS', <function get_cell_parameters_card>, None), 'cell_dynamics': 'CELL[cell_dynamics]', 'cell_factor': 'CELL[cell_factor]', 'wmass': 'CELL[wmass]'}, 'spin': {'noncolin': [('SYSTEM[nspin]', <function get_system_nspin>, None), 'SYSTEM[noncolin]'], 'spinorbit': 'SYSTEM[lspinorb]', 'lsda': ('SYSTEM[nspin]', <function get_system_nspin>, None)}, 'free_positions': [('ATOMIC_POSITIONS',), ('CELL_PARAMETERS',)], 'atomic_species': {'ntyp': 'SYSTEM[ntyp]', '_text': [('ATOMIC_SPECIES', <function get_atomic_species_card>, None), ('SYSTEM[Hubbard_U]',), ('SYSTEM[Hubbard_J0]',), ('SYSTEM[Hubbard_alpha]',), ('SYSTEM[Hubbard_beta]',), ('SYSTEM[Hubbard_J]',), ('SYSTEM[starting_ns_eigenvalue]',), ('SYSTEM[starting_magnetization]', <function get_starting_magnetization>, None)]}}
clear_input()
class schrodinger.application.matsci.qexsd.qespresso.converters.RawInputConverter(invariant_map, variant_map, input_namelists=None, input_cards=None)

Bases: _abcoll.Container

A Fortran’s namelist builder.

add_kwarg(path, tag, node_dict)
clear_input()
get_qe_input()
input_cards = None

Sequence of input special cards, assuming an empty list if not provided.

input_namelists = None

Sequence of input namelists. Use keys of the maps if not provided.

invariant_map = None

Map of parameters that are matched with one-to-one relation and which value is invariant from XML to QE Fortran input format.

set_parameter(path, value)
set_path(path, tag, node_dict)

Insert values for a path.

Parameters:
  • path
  • tag
  • node_dict
Returns:

target_pattern = <_sre.SRE_Pattern object>

RE pattern to extract Fortran input’s namelist/card and name of a parameter

variant_map = None

Map of parameters that require a type conversion or are multi related with other inputs.

schrodinger.application.matsci.qexsd.qespresso.converters.conversion_maps_builder(template_map)

Build invariant and variant conversion maps from a template. The template is a multilevel dictionary that reproduce the structure of the input data. An entry maybe:

  1. a string with the list and the option names (eg: “CONTROL[calculation]”). In this case the entry is mapped to this value, without modifications.

  2. a tuple with three items: - list and option names (eg: ‘SYSTEM[Hubbard_U]’); - the function that has to be used to calculate the namelist option

    value from XML value;

    • the function that has to be used to calculate to calculate the XML value data from namelist entry.
  3. a list of tuples when the XML entry has to be used to calculate other namelist or card’s entries. Each tuple has the meaning of the previous case. The second and third elements may be None or empty if the template has another tuple with the same list and option names that indicate the transformation functions associated.

Parameters:template_map – Template dictionary
Returns:A couple of dictionaries, the first for invariant

parameter mappings, se second for multi-dependent or type transformations.

schrodinger.application.matsci.qexsd.qespresso.converters.to_fortran(value)

Translate a Python value to the equivalent literal representation for Fortran input.

Parameters:value
Returns: