! ! License-Identifier: GPL ! ! Copyright (C) 2009 The Yambo Team ! ! Authors (see AUTHORS file for details): AM CA DS ! !> Main routine for evaluating real-time observables. !> !> This routine coordinates the computation of various real-time (RT) physical quantities !> from the time-dependent density matrix \f$\hat{\rho}(t) = -i \hat{G}^<(t)\f$. !> !> ### 1. Trace Operators and Averages !> Observables are generally computed as traces: !> \f[ \langle \hat{O} \rangle(t) = \text{Tr}[\hat{\rho}(t) \hat{O}] = -i \sum_{k \in IBZ} w_k \text{Tr}[\hat{G}^<(k,t) \hat{O}(k)] \f] !> where \f$w_k = N_{star}(k)/N_k\f$ are the BZ weights (`RTibz%weights`). !> !> ### 2. Computed Quantities !> - **Current and Polarization**: Evaluated in `RT_current_AND_polarization`. !> - **Carrier Populations**: Evaluated in `RT_carriers_number`. !> - **Electronic Temperatures**: Evaluated in `RT_carriers_temperature`. !> - **Energy Decomposition**: Evaluated in `RT_energy_components`. !> - **Entropy**: Evaluated in `RT_entropy`. !> !> ### 3. Normalization and Prefactors !> - **K-points**: All sums over the BZ are performed over the Irreducible Brillouin Zone (IBZ) !> using k-point weights \f$w_k\f$ which sum to 1. !> - **Volume**: Current and polarization are divided by the unit cell volume \f$\Omega\f$ (`DL_vol`). !> - **Spin**: Factors of 2 (closed shell) or explicit summation over \f$\sigma\f$ (`n_sp_pol`) !> are handled inside `RT_average_operator`. !> !> @param[in,out] en Electronic levels structure. !> @param[in] k BZ sampling structure. !> @param[in] dG_lesser Variation of the lesser Green's function. !> @param[in,out] OBSERVABLES Array to store the computed values. subroutine RT_Observables(en,k,dG_lesser,OBSERVABLES) ! ! This subroutine compute the variation of the energy and its different components, ! the number of electrons injected in conduction and holes in valence, ! and finally the variation in entropy and the associated temperature ! which is compared with the temperature from the fits ! use pars, ONLY:SP use R_lattice, ONLY:bz_samp use electrons, ONLY:levels,n_sp_pol use real_time, ONLY:RT_nk,RT_bands use fields, ONLY:A_tot use timing_m, ONLY:timing ! implicit none ! type(levels), intent(inout) :: en type(bz_samp), intent(in) :: k complex(SP), intent(in) :: dG_lesser(RT_bands(1):RT_bands(2),RT_bands(1):RT_bands(2),RT_nk,n_sp_pol) real(SP), intent(inout) :: OBSERVABLES(25) ! ! Workspace ! real(SP) :: NCarr(3),TFit(2),EfFit(2),Ener(5),Entr(3),TEntr(3),EnEntr(3),E_IP logical, external :: RT_do_it ! if ( .not. ( RT_do_it('OUT') .or. RT_do_it('OBS_cache') .or. RT_do_it('deltaT') ) ) return ! call timing('RT observables',OPR='start') ! ! Current, Polarization and Magnetization !========================================= ! (evaluated also in RT_integrator when an induced field is included, l_RT_induced_field=.true.) ! call RT_carriers_number(en,k,NCarr) call RT_current_AND_polarization(k,en,dG_lesser,A_tot,Ncarr) ! if (.not. RT_do_it('OUT') ) then call timing('RT observables',OPR='stop') return endif ! ! Carriers number !================ call RT_carriers_number(en,k,NCarr) ! ! Temperature !============= call RT_carriers_temperature(TFit,EfFit) ! ! Energy !======== call RT_energy_components(en,k,dG_lesser,Ener,E_IP,'tot') ! ! Entropy !========= call RT_entropy(en,k,dG_lesser,Entr,TEntr,EnEntr,E_IP) ! OBSERVABLES(1:21)=(/NCarr(:),TFit(:),EfFit(:),Ener(:),Entr(:),TEntr(:),EnEntr(:)/) ! call timing('RT observables',OPR='stop') ! end subroutine RT_Observables