YamboDipolesParser¶
Module that manages the parsing of a Yambo dipoles database.
- class mppi.Parsers.YamboDipolesParser.YamboDipolesParser(file, verbose=True)[source]¶
Bases:
objectClass to read information about the dipoles from the
dipolesdatabase created by Yambo.- Parameters:
file (
string) – string with the name of the database to be parsedverbose (
boolean) – define the amount of information provided on terminal
- dip_ir¶
Array with the variable
DIP_iRthat 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_pthat 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_vthat 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_spinthat 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
DipBandsALLis enabled the dipoles are computed for all the bands range, not only for the valence-conduction pairs.- 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 usedlast_k (
int) – index of the last k variable. If None the last value of the dip_ir variable is usedfirst_band (
int) – index of the first band. If None the first value of the dip_ir variable is usedlast_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
dipolesdatabase 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 usedlast_k (
int) – index of the last k variable. If None the last value of the dip_spin variable is usedfirst_band (
int) – index of the first band. If None the first value of the dip_spin variable is usedlast_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