YamboUtils

This file contains some useful functions to perform computation with Yambo. The module can be loaded in the notebook in one of the following way

>>> from mppi import Utilities as U
>>> U.build_SAVE

or to load directly some elements

>>> from mppi.Utilities import build_SAVE
>>> build_SAVE
mppi.Utilities.YamboUtils.build_SAVE(source_dir, run_dir, command='p2y -a 2', make_link=True)[source]

Build the SAVE folder for a yambo computation.

The function creates the SAVE folder in the source_dir using the command provided as the command parameter (the option -a 2 ensures that labelling of the high-symmetry kpoints is consistent in both QE and Yambo) and create a symbolic link (or a copy) of the SAVE folder in the run_dir. This procedure is performed only if the SAVE folder is not already found in the run_dir. If the source_dir is not found an exception is raised.

Parameters
  • source_dir (string) – name of the folder with the source nscf QuantumESPRESSO computation

  • run_dir (string) – folder where the SAVE folder is linked or copied

  • command (string) – command for generation of the SAVE Folder. Default is ‘p2y -a 2’

  • make_link (bool) – if True create a symbolic link

mppi.Utilities.YamboUtils.get_variable_from_db(ndb_file, var_name)[source]

Extract the value of a variable from a ndb database

Parameters
  • ndb_file (string) – the name of the database

  • var_name (string) – name of the variable

Returns

array with the values of the variable

Return type

numpy.ndarray

mppi.Utilities.YamboUtils.make_FixSymm(run_dir, polarization='linear', Efield1=[1.0, 0.0, 0.0], Efield2=[0.0, 1.0, 0.0], removeTimeReversal=True)[source]

Perform the fixSymm procedure to remove the symmetries broken by the electric field. The procedure creates the FixSymm folder into run_dir and run yambo_rt into the FixSymm to generate the r_setup. If a FixSymm folder is already present in the run_dir no operations are performed.

Parameters
  • run_dir (string) – folder with the SAVE directory

  • polarization (string) – specifies the linear or circular polarization of the field

  • Efield1 (list) – direction of the first electric field

  • Efield2 (list) – direction of the second electric field. Useful for the circular polarization case

  • removeTimeReversal (bool) – if True remove the time reversal symmetry