YamboDipolesParser

Module that manages the parsing of a Yambo dipoles database.

class mppi.Parsers.YamboDipolesParser.YamboDipolesParser(file, verbose=True)[source]

Bases: object

Class to read information about the dipoles from the dipoles database created by Yambo.

Parameters:
  • file (string) – string with the name of the database to be parsed

  • verbose (boolean) – define the amount of information provided on terminal

dip_ir

Array with the variable DIP_iR that contains the position dipoles times the imaginary unit. The structure of the array is [kpoints][full_bands][empty_bands][cartesian_component][real and imaginary part]

Type:

np.array

dip_p

Array with the variable DIP_p that contains the matrix elements of the momentum operator. The structure of the array is [kpoints][full_bands][empty_bands][cartesian_component][real and imaginary part]

Type:

np.array

dip_v

Array with the variable DIP_v that contains the matrix elements of the velocity operator (commutator of x operator with the Hamiltonian). The structure of the array is [kpoints][full_bands][empty_bands][cartesian_component][real and imaginary part]

Type:

np.array

dip_spin

Array with the variable DIP_spin that contains the matrix elements of the spin operator. The structure of the array is [kpoints][full_bands][empty_bands][cartesian_component][real and imaginary part]

Type:

np.array

Note

If the option DipBandsALL is enabled the dipoles are computed for all the bands range, not only for the valence-conduction pairs.

get_info()[source]

Provide information on the attributes of the class

r_dipole(component, first_k=None, last_k=None, first_band=None, last_band=None)[source]

Compute the array with the matrix elements of the position operator. The i factor in the definition of the dip_ir attribute produces a flip of the real and imaginary components (with a change of sign).

Parameters:
  • component (py:class:int) – cartesian component of the dipole operator

  • first_k (int) – index of the first k variable. If None the first value of the dip_ir variable is used

  • last_k (int) – index of the last k variable. If None the last value of the dip_ir variable is used

  • first_band (int) – index of the first band. If None the first value of the dip_ir variable is used

  • last_band (int) – index of the last band. If None the last value of the dip_ir variable is used

Returns:

complex array with the dipoles matrix element with shape(kpoint,band1,band2)

Return type:

array

readDB(verbose)[source]

Read the data from the dipoles database created by Yambo. The variables are extracted from the database and stored in the attributes of the object.

Parameters:

verbose (boolean) – define the amount of information provided on terminal

spin_dipole(component, first_k=None, last_k=None, first_band=None, last_band=None)[source]

Compute the array with the matrix elements of the spin operator.

Parameters:
  • component (py:class:int) – cartesian component of the spin operator

  • first_k (int) – index of the first k variable. If None the first value of the dip_spin variable is used

  • last_k (int) – index of the last k variable. If None the last value of the dip_spin variable is used

  • first_band (int) – index of the first band. If None the first value of the dip_spin variable is used

  • last_band (int) – index of the last band. If None the last value of the dip_spin variable is used

Returns:

complex array with the spin dipole matrix element with shape(kpoint,band1,band2)

Return type:

array