PAOFLOW.gen.elphon_system#

paoflow-gen elphon: write an electron-phonon system folder from a pw.x input.

The folder has the layout of examples/elphon/<System>: system.py (the only file with values, an ElphonSystem plus the per-workflow defaults), qe/ (scf, ph.x, nscf and, optionally, optics-nscf inputs with run_qe.sh) and one subfolder per selected workflow (phonons/, coupling/, superconductivity/, optics/, transport/, arpes/) holding copies of the drivers of PAOFLOW/gen/elphon_templates (the same files as the examples).

Attributes#

Functions#

render_system_py(cfg)

Text of system.py: NAME, SYSTEM and the per-workflow default dictionaries.

render_run_qe(cfg)

Text of qe/run_qe.sh: scf, ph.x, the nscf (and the EPW / optics steps).

write_ukk_script(cfg)

Text of qe/nscf/write_ukk.py (placeholder <prefix>.ukk for wannierize = .false.).

qe_inputs(cfg)

QE (and EPW) inputs of the system folder, {relative path: text}.

workflow_files(cfg)

Template files (relative paths) of the workflows selected in cfg['workflows'].

write_system_folder(cfg, out[, force])

Write system.py, the QE inputs and the workflow drivers of a system folder.

ask_divisible(ask_int, prompt, default, divisor, what)

Ask for an integer that is a positive multiple of divisor (re-prompting otherwise).

ask_workflows(ask, choices, default)

Comma-separated multi-select among choices (re-prompts on an unknown name).

collect_elphon_system(args, workdir)

Prompt for the electron-phonon system configuration.

main_elphon(args, workdir)

Run the electron-phonon generator: prompts, then the system folder.

Module Contents#

PAOFLOW.gen.elphon_system.TEMPLATE_DIR[source]#
PAOFLOW.gen.elphon_system.WORKFLOWS: dict[str, tuple[str, ...]][source]#
PAOFLOW.gen.elphon_system.QE_HELPERS = ('qe/kmesh.py',)[source]#
PAOFLOW.gen.elphon_system.WRITE_UKK_TEMPLATE = Multiline-String[source]#
Show Value
"""#!/usr/bin/env python3
"""Write {ukk} for epw.x with wannierize = .false. (run in this directory before epw.x).

EPW reads the band bookkeeping from this file only: the {nbnd} nscf bands, {exclusion}
No Wannier functions are built; the identity rotations only feed
EPW's Wannier stage, which PAOFLOW does not use.  The empty {stem}.bvec /
{stem}.mmn written alongside let that stage finish.
"""

from PAOFLOW.gen.epw_inputs import write_placeholder_ukk

write_placeholder_ukk('{ukk}', nbnd={nbnd}, nk_total={nk_total}, exclude_bands={excluded}, nelec={nelec})
print('Wrote {ukk} (and the empty wannier90 stubs {stem}.bvec, {stem}.mmn)')
"""
PAOFLOW.gen.elphon_system.SYSTEM_COMMENTS[source]#
PAOFLOW.gen.elphon_system.SUPERCONDUCTIVITY_COMMENTS[source]#
PAOFLOW.gen.elphon_system.OPTICS_COMMENTS[source]#
PAOFLOW.gen.elphon_system.TRANSPORT_COMMENTS[source]#
PAOFLOW.gen.elphon_system.ARPES_COMMENTS[source]#
PAOFLOW.gen.elphon_system.PHONONS_COMMENTS[source]#
PAOFLOW.gen.elphon_system.COUPLING_COMMENTS[source]#
PAOFLOW.gen.elphon_system.render_system_py(cfg)[source]#

Text of system.py: NAME, SYSTEM and the per-workflow default dictionaries.

Parameters:

cfg (dict) – name, prefix, coupling_source, kgrid, qgrid, masses_amu, nelec, basisdir, configuration, pthr, long_range, quadrupoles (path or None), cache_dir, spin_degeneracy and the optional dictionaries superconductivity, optics, transport, arpes, phonons, coupling (missing ones are written empty).

Returns:

The module text.

Return type:

str

PAOFLOW.gen.elphon_system.render_run_qe(cfg)[source]#

Text of qe/run_qe.sh: scf, ph.x, the nscf (and the EPW / optics steps).

Parameters:

cfg (dict) – prefix, coupling_source, optics_nscf (bool), metal (bool).

Returns:

The shell script (NP processes, run from qe/).

Return type:

str

PAOFLOW.gen.elphon_system.write_ukk_script(cfg)[source]#

Text of qe/nscf/write_ukk.py (placeholder <prefix>.ukk for wannierize = .false.).

PAOFLOW.gen.elphon_system.qe_inputs(cfg)[source]#

QE (and EPW) inputs of the system folder, {relative path: text}.

Parameters:

cfg (dict) – prefix, kgrid, qgrid, nbnd, nelec, masses_amu, pw_template_text (a pw.x input; without it only qe/nscf/nscf.kpoints is written), pseudo_dir, coupling_source, irreducible (nscf on the irreducible wedge), metal (no epsil), exclude_bands, optics_nscf, optics_kgrid, optics_nbnd.

Returns:

qe/phonon/scf.in, qe/phonon/ph.in, qe/nscf/nscf.in (or nscf.kpoints), qe/run_qe.sh and, for the EPW source, qe/nscf/epw.in and qe/nscf/write_ukk.py; with optics_nscf also qe/optics/nscf.in.

Return type:

dict

PAOFLOW.gen.elphon_system.workflow_files(cfg)[source]#

Template files (relative paths) of the workflows selected in cfg['workflows'].

PAOFLOW.gen.elphon_system.write_system_folder(cfg, out, force=False)[source]#

Write system.py, the QE inputs and the workflow drivers of a system folder.

Parameters:
  • cfg (dict) – The generator configuration (render_system_py(), qe_inputs(), workflows, metal).

  • out (str) – The system folder (created).

  • force (bool, optional) – Overwrite existing files (otherwise they are skipped with a message).

Returns:

Written files.

Return type:

list of str

PAOFLOW.gen.elphon_system.ask_divisible(ask_int, prompt, default, divisor, what)[source]#

Ask for an integer that is a positive multiple of divisor (re-prompting otherwise).

PAOFLOW.gen.elphon_system.ask_workflows(ask, choices, default)[source]#

Comma-separated multi-select among choices (re-prompts on an unknown name).

PAOFLOW.gen.elphon_system.collect_elphon_system(args, workdir)[source]#

Prompt for the electron-phonon system configuration.

Parameters:
  • args (argparse.Namespace) – prefix and out overrides of paoflow-gen.

  • workdir (str) – Directory scanned for a pw.x input.

Returns:

The configuration of write_system_folder().

Return type:

dict

PAOFLOW.gen.elphon_system.main_elphon(args, workdir)[source]#

Run the electron-phonon generator: prompts, then the system folder.

Parameters:
  • args (argparse.Namespace) – paoflow-gen arguments (prefix, out, force).

  • workdir (str) – Directory scanned for QE inputs.

Returns:

Exit status.

Return type:

int