YamboRTGlesserParser¶
Module that manages the parsing of the ndb.RT_G_PAR database created by yambo_rt.
- class mppi.Parsers.YamboRTGlesserParser.YamboRTGlesserParser(file, verbose=True)[source]¶
Bases:
objectClass to manage information about the \(G^<\) from the
ndb.RT_G_PARdatabase created by yambo_rt.- Parameters:
file (
string) – string with the name of the database to be parsedverbose (
boolean) – define the amount of information provided on terminal
- Gless¶
Array with the variable
dG_lesserthat contains the lesser component of the time-dependent Green function expressed in the Kohn-Sham basis. The structure of the array is [time,kpoint,band1,band2,real and imaginary part]- Type:
np.array
- buildDensityMatrix(first_time=None, last_time=None, first_k=None, last_k=None, first_band=None, last_band=None, equilibrium_dm=None)[source]¶
Compute the density matrix from the Green function according to the relation
\[\rho_{b1,b2,k}(t) = -iG^<_{b2,b1,k}(t)\]The real and complex parts of the
dGarray are recasted to produce the complex structure of the density matrix. Note that the band indices are transposed, since in this way we are able to reproduce the correct expectation of on observable using the relation \(<O> = Tr(\rho O)\). If theequilibrium_dmargument is not None add the equilibrium occupations, provided in the argument, to the density matrix.- Parameters:
first_time (
int) – index of the first time variable. If None the first value of the Green function is usedlast_time (
int) – index of the last time variable. If None the last value of the Green function is usedfirst_k (
int) – index of the first k variable. If None the first value of the Green function is usedlast_k (
int) – index of the last k variable. If None the last value of the Green function is usedfirst_band (
int) – index of the first band. If None the first value of the Green function is usedlast_band (
int) – index of the last band. If None the last value of the Green function is usedequilibrium_dm (
array) – if not None include the equilibrium occupations. The equilibrium_dm has to be an array with shape equal to (band1,band2) and the slice corresponding to the block of the Green function is extracted
- Returns:
- the complex array with the density matrix.
The structure of the array is [time,kpoint,band1,band2]
- Return type:
(
array)
- buildEqDensityMatrix(num_occupied_bands=1, band_occupation=2)[source]¶
Compute the equilibrium density matrix, that is a (time and k independent) diagonal array filled with the occupations of the bands
- Parameters:
num_occupied_bands (
int) – number of occupied bandsoccupation (
int) – set the number of electrons in the occupied bands
- Returns:
- diagonal array (of the dimension of the Green function)
with the equilibrium occupations
- Return type:
array
- mppi.Parsers.YamboRTGlesserParser.buildBlochVectors(dm)[source]¶
Build the Bloch vectors \(u_i(t,k)\) (for each time step and for each k point) associated to the 2x2 density matrix provided as input. Bloch vectors are computed according to the relation
\[u_1(t,k) = 2Re(\rho_{0,1,k}(t)) \, , \ u_2(t,k) = -2Im(\rho_{0,1,k}(t)) \, , \ u_3(t,k) = \rho_{0,0,k}(t) - \rho_{1,1,k}(t)\]The Bloch vectors are rescaled by the value of the trace of the density matrix (for each time and k point). If one trace vanishes the vector associated to the same time and k is set to zero.
- Parameters:
dm (
array) – time and k dependent array(s) with the 2x2 density matrix. The function assumes that the shape of dm is (time,kpoint,2,2)- Returns:
- the real array with the Bloch vectors for all the times and k points.
The shape of the array is (component,time,kpoint)
- Return type:
(
array)