create_epw_inputs

Module to prepare input files for wannier90 and EPW calculations

Functions

band_file_epw(mpid, compound)

function to include 'nosym = .true.' inside QE scf.in file for bandstructure calculation :param mpid: :type mpid: Materials id :param compound: :type compound: compound name :param Example: :param >>> band_file_epw("mp-1234": :param "Si"):

ciftoxsf(file_name, outfile)

function to change .cif file to .xsf format, suitable for xcrysden.

epw_sc(mpid, compound, prefix, qpoint_file, ...)

function to write input file for EPW calculations.

epw_sc_from_json(json_file[, out])

Write input file for EPW calculations based on JSON configuration.

func_erfc(xdata, aparam, bparam[, func_type])

erfc function erfc((x-a)/b) :param xdata: :type xdata: x data :param aparam and bparam are parameters: :param func_type: :type func_type: Type of function

main()

main function

phonon_input(mass_file, qpoint_file, mpid, ...)

function to write ph.in file for phonon calculation :param mass_file: It has mass in a.m.u in each line as in QE scf.in file :type mass_file: mass.in file automatically created in 'create-inputs' bash script :param qpoint_file: :type qpoint_file: qpoint.in file provided :param mpid: :type mpid: MP id :param compound: :type compound: MP compound name :param prefix: :type prefix: prefix used in QE calculations :param Returns: :type Returns: None :param --------------: :param write a file in 'ph-mpid-compound.in' format: :param Example: :param >>> phonon_input('mass.in': :param 'qpoint.in': :param 'mp-123': :param 'SiO2': :param 'si2o4'):

prepare_nscf(grid_file[, what])

function to write file for non-scf calculations :param grid_file: It just has 3 numbers, representing the k-mesh, nkx nky nkz (no offset) :type grid_file: kmesh.grid file automatically created from bash scripts :param what: :type what: type of nscf grid.

projwfc(prefix, mpid, compound)

function to write projwfc.in file for orbital projection calculation :param mpid: :type mpid: MP id :param compound: :type compound: MP compound name :param prefix: :type prefix: prefix used in QE calculations :param Returns: :type Returns: None :param --------------: :param write a file in 'projwfc-mpid-compound.in' format: :param Example: :param --------: :param >>> projwfc('prefix': :param 'mp-123': :param 'FeS2'): :param This will create a file named 'projwfc-mp-123-FeS2.in' with the necessary parameters.:

pw2wan_input(mpid, compound, prefix[, proj])

function to write pw2wan input file :param mpid: :type mpid: Materials id :param compound: :type compound: compound name :param prefix: :type prefix: prefix used in QE calculations :param proj: :type proj: 'scdm' if used SCDM projection, '' otherwise

scdmfit(func, file_name, mpid, compound, fermi)

function to fit erfc function and calculate SCDM parameters to generate automatic projections for wannierization :param func: :type func: function to fit :param file_name: :type file_name: Data in 'energy, projection' format :param mpid: :type mpid: MP id :param compound: :type compound: compound :param fermi: :type fermi: Fermi level :param entang: :type entang: type of entanglement.

create_epw_inputs.phonon_input(mass_file, qpoint_file, mpid, compound, prefix)[source]

function to write ph.in file for phonon calculation :param mass_file: It has mass in a.m.u in each line as in QE scf.in file :type mass_file: mass.in file automatically created in ‘create-inputs’ bash script :param qpoint_file: :type qpoint_file: qpoint.in file provided :param mpid: :type mpid: MP id :param compound: :type compound: MP compound name :param prefix: :type prefix: prefix used in QE calculations :param Returns: :type Returns: None :param ————–: :param write a file in ‘ph-mpid-compound.in’ format: :param Example: :param >>> phonon_input(‘mass.in’: :param ‘qpoint.in’: :param ‘mp-123’: :param ‘SiO2’: :param ‘si2o4’):

create_epw_inputs.prepare_nscf(grid_file, what='nscf')[source]

function to write file for non-scf calculations :param grid_file: It just has 3 numbers, representing the k-mesh, nkx nky nkz (no offset) :type grid_file: kmesh.grid file automatically created from bash scripts :param what: :type what: type of nscf grid. ‘wan’ is nscf grid for wannierization :param Returns: :type Returns: None :param —————: :param write a file with kmesh grid for non-scf calculation: :param Example: :param >>> prepare_nscf(‘kmesh.grid’: :param what=’wan’):

create_epw_inputs.projwfc(prefix, mpid, compound)[source]

function to write projwfc.in file for orbital projection calculation :param mpid: :type mpid: MP id :param compound: :type compound: MP compound name :param prefix: :type prefix: prefix used in QE calculations :param Returns: :type Returns: None :param ————–: :param write a file in ‘projwfc-mpid-compound.in’ format: :param Example: :param ——–: :param >>> projwfc(‘prefix’: :param ‘mp-123’: :param ‘FeS2’): :param This will create a file named ‘projwfc-mp-123-FeS2.in’ with the necessary parameters.:

create_epw_inputs.ciftoxsf(file_name, outfile)[source]

function to change .cif file to .xsf format, suitable for xcrysden. :param file_name: :type file_name: .cif filename :param outfile: :type outfile: .xsf filename :param Returns: :type Returns: None

create_epw_inputs.func_erfc(xdata, aparam, bparam, func_type='erfc')[source]

erfc function erfc((x-a)/b) :param xdata: :type xdata: x data :param aparam and bparam are parameters: :param func_type: :type func_type: Type of function

Return type:

ydata = 0.5 * erfc((xdata-aparam)/bparam)

create_epw_inputs.scdmfit(func, file_name, mpid, compound, fermi, entang='erfc')[source]

function to fit erfc function and calculate SCDM parameters to generate automatic projections for wannierization :param func: :type func: function to fit :param file_name: :type file_name: Data in ‘energy, projection’ format :param mpid: :type mpid: MP id :param compound: :type compound: compound :param fermi: :type fermi: Fermi level :param entang: :type entang: type of entanglement. Default: ‘erfc’

Returns:

  • mu_scdm, sigma_scdm parameters

  • Example

  • ——–

  • >>> scdmfit(erfc, ‘data.csv’, ‘mp-123’, ‘FeS2’, 5.0, entang=’erfc’)

  • This will fit the erfc function to the data in ‘data.csv’,

  • calculate SCDM parameters, and return mu and sigma.

create_epw_inputs.band_file_epw(mpid, compound)[source]

function to include ‘nosym = .true.’ inside QE scf.in file for bandstructure calculation :param mpid: :type mpid: Materials id :param compound: :type compound: compound name :param Example: :param >>> band_file_epw(“mp-1234”: :param “Si”):

create_epw_inputs.pw2wan_input(mpid, compound, prefix, proj=' ')[source]

function to write pw2wan input file :param mpid: :type mpid: Materials id :param compound: :type compound: compound name :param prefix: :type prefix: prefix used in QE calculations :param proj: :type proj: ‘scdm’ if used SCDM projection, ‘’ otherwise

Returns:

  • write ‘pw2wan-mpid-compound.in’ file

  • Example

  • >>> pw2wan_input(“mp-1234”, “Si”, “Si”, proj=”scdm”)

create_epw_inputs.epw_sc_from_json(json_file, out='epw.in')[source]

Write input file for EPW calculations based on JSON configuration.

Parameters:

json_filestr

Path to the JSON configuration file.

outstr, optional

EPW input file name. Default is ‘epw.in’.

Example: >>> epw_sc_from_json(“epw.json”, out=”epw.in”)

create_epw_inputs.epw_sc(mpid, compound, prefix, qpoint_file, kpoint_file, proj=' ', out='epw.in')[source]

function to write input file for EPW calculations. Default: ‘epw.in’

Parameters:
  • mpid (Materials id)

  • compound (compound name)

  • prefix (prefix used in QE calculations)

  • qpoint_file ('qpoint.in' file for q-mesh)

  • kpoint_file ('kpoint.in' file for k-mesh)

  • proj (projection types)

  • out (epw input file)

  • Example

  • epw_sc("mp-123" (>>>)

  • "SiO2"

  • "Si2O4"

  • "qpoint.in"

  • "kpoint.in"

  • proj=""

  • out="epw.in")

create_epw_inputs.main()[source]

main function