User Tools

Site Tools


howto:rtp_field_xas

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
howto:rtp_field_xas [2023/10/10 13:51] – [Real-Time TDDFT for resonant excitation] glebretonhowto:rtp_field_xas [2023/10/16 16:15] oschuett
Line 1: Line 1:
 ====== How to run a Real-Time TDDFT with explicit field: Resonant X-Ray example ====== ====== How to run a Real-Time TDDFT with explicit field: Resonant X-Ray example ======
 +
 +Note: this tutorial is still under construction
  
 In this tutorial, we will present a simulation of resonant X-Ray excitation of an isolated carbon monoxide in real-time using a time-dependent field.  In this tutorial, we will present a simulation of resonant X-Ray excitation of an isolated carbon monoxide in real-time using a time-dependent field. 
 On this page, you will find an overview of the method, some equations, and the CP2K input file.  On this page, you will find an overview of the method, some equations, and the CP2K input file. 
-A longer version is available in the form of a jupyter notebook file in {{:howto:rtp_field_xas.zip | this zip file}} along with the simulated data so that you do not need to run this calculation yourself to run the analysis.+A longer version is available in the form of a jupyter notebook file in {{ :howto:rtp_field_xas.zip | this zip file}} along with the simulated data so that you do not need to run this calculation yourself to perform the analysis.
 This kind of calculation is not easy to grasp: do not hesitate to have a first look before diving into the equations and details!  This kind of calculation is not easy to grasp: do not hesitate to have a first look before diving into the equations and details! 
 This tutorial is connected to this article REF where you can find complementary information.  This tutorial is connected to this article REF where you can find complementary information. 
Line 10: Line 12:
 ==== Real-Time TDDFT for resonant excitation ==== ==== Real-Time TDDFT for resonant excitation ====
  
-Such calculation aims to promote a small number of electrons from one specific state to another using an electromagnetic field at a given resonant frequency.+Such real-time calculation aims to promote a small number of electrons from one specific state to another using an electromagnetic field. The electronic dynamics are propagated as the field is applied, leading to an electronic excitation increasing with time if the field frequency matches the targetted electronic transition energy.
  
 == Real-Time TDDFT reminders == == Real-Time TDDFT reminders ==
  
 The light is treated classically using either the length or velocity gauge to interact with the electrons.  The light is treated classically using either the length or velocity gauge to interact with the electrons. 
-The simulation starts usually from the electronic ground state, but one can also construct another starting state in CP2K to start with+The simulation starts usually from the electronic ground state, but one can also construct another starting state in CP2K. 
 The field is applied as the wave function is propagated in real-time. The field is applied as the wave function is propagated in real-time.
 This time-dependent field $\textbf{F}(t)$ has typically an envelope, $E_{\text{env}}$, and is defined as:  This time-dependent field $\textbf{F}(t)$ has typically an envelope, $E_{\text{env}}$, and is defined as: 
Line 45: Line 47:
  
 For X-Rays, we use the XAS_TDP scheme implemented in CP2K, see for instance [[howto:xas_tdp| this tutorial]] for more information.  For X-Rays, we use the XAS_TDP scheme implemented in CP2K, see for instance [[howto:xas_tdp| this tutorial]] for more information. 
-For isolated carbon monoxide and with our calculation parameters (PBEh functional and PCSEG2 basis set), the first available for the Oxygen 1s excitation has a resonant frequency of $\omega_{res} = \omega = 529$~ev with an associated oscillator strength of 0.044 a.u. Note that this result is also confirmed using a real-time approach, [[howto:delta_kick| the $\delta$-kick technic]].+For isolated carbon monoxide and with our calculation parameters (PBEh functional and PCSEG2 basis set), the first available excited state for the Oxygen 1s has a resonant frequency of $\omega_{res} = \omega = 529$ ev with an associated oscillator strength of 0.044 a.u. Note that this result is also confirmed using a real-time approach, [[howto:delta_kick| the $\delta$-kick technic]].
  
-This means that applying an electric field with a carrying frequency of 529~ev should promote electrons from the oxygen 1s toward this excited state noted $|\omega>$.  +Hence, applying an electric field with a carrying frequency of 529 ev should promote electrons from the oxygen 1s toward this excited statenoted $|\omega>$.  
-Within the RT-TDDFT approach, it means that the Molecular Orbital corresponding to the Oxygen 1s $|1s(t)>$ will be transformed with time as: +Within the RT-TDDFT approach, it means that the Molecular Orbital corresponding to the Oxygen 1s$|1s(t)>$will be transformed with time as: 
  
 $$ $$
Line 57: Line 59:
 Note that this equation leaves aside the time-dependent phase factor between these two states. Note that this equation leaves aside the time-dependent phase factor between these two states.
  
-If the field is resonant with only one state and if we assume that the rest of the electrons do not evolve we can use the generalized version of the Rabi oscillation formula to get a prediction of the excited state population with time: +If the field is resonant with only one electronic transition and if we assume that the rest of the electrons do not evolve we can use the generalized version of the Rabi oscillation formula to get a prediction of the excited state population with time: 
  
 $$ $$
Line 64: Line 66:
 $$ $$
  
-Where $\mathbf{\mu}^{res}$ is the transition dipole moment between the ground and excited state, $\mathbf{F}$ the polarization of the field, and $A(t)$ the integral of the field envelope.+Where $\mathbf{\mu}^{res}$ is the transition dipole moment between the ground and excited state, $\mathbf{F}$ is the polarization of the field, and $A(t)$ is the integral of the field envelope.
 In today's case where the amount of electron promoted is small, one can use this approximate formula:  In today's case where the amount of electron promoted is small, one can use this approximate formula: 
  
Line 71: Line 73:
 $$ $$
  
-Where $\tau  = |\mathbf{\mu}^{res} \cdot \mathbf{F}|^2 $ can be seen as an instantaneous promoting rate of the electrons upon the resonant field. +Where $\tau  = |\mathbf{\mu}^{res} \cdot \mathbf{F}|^2 $ can be seen as an instantaneous promoting rate for the core electron upon the resonant field. 
  
 == Real-Time evolution expectations == == Real-Time evolution expectations ==
  
 In the perturbative regime, one can expect the above-mentioned excited population prediction to be correct as the oscillator strength is provided by Linear Response.  In the perturbative regime, one can expect the above-mentioned excited population prediction to be correct as the oscillator strength is provided by Linear Response. 
-Thus, one can track in real-time such population using projection of the time-dependent molecular orbital:  +Thus, one can track in real-time these ground and excited population using projection of the time-dependent molecular orbital: 
  
 $$ $$
Line 83: Line 84:
 $$ $$
  
-And we should also have that: $\rho_{Exc}(t) = 1 -  \rho_{GS}(t)$. +Moreover, we should also have: $\rho_{Exc}(t) = 1 -  \rho_{GS}(t)$. 
 These projections are written for the Molecular Orbital originally corresponding to the Oxygen 1s, but we can also write them for the other electrons.  These projections are written for the Molecular Orbital originally corresponding to the Oxygen 1s, but we can also write them for the other electrons. 
 Yet, in the case of core X-Ray excitation, we do not expect the other electrons to be affected within the perturbative regime: for any Molecular Orbital $i$ which is not the one corresponding to the Oxygen 1s we should have:  Yet, in the case of core X-Ray excitation, we do not expect the other electrons to be affected within the perturbative regime: for any Molecular Orbital $i$ which is not the one corresponding to the Oxygen 1s we should have: 
  
 $$ $$
-|\psi_i(t)> \approx e^{ -i E_i t} |\psi_i(t=0)> +|\psi_i(t)> \approx e^{ -i E_i t} |\psi_i(t=0)>,
 $$ $$
  
-with $E_i$ the energy associated to the $i^[\text{th}} Molecular Orbital.  +with $E_i$ the energy associated to the $i^[\text{th}} molecular orbital.  
-Let us define the projection for all the Molecular orbital either toward their ground state or the targetted excited state: +Let us define the projection for all the molecular orbital either toward their ground state or the targetted excited state: 
  
 $$ $$
Line 98: Line 99:
 $$ $$
  
-For all MO except the one corresponding to the Oxygen 1s we should have $\rho^i_{GS}(t) = 1$ and $\rho^i_{Exc}(t) \approx 0$. Therefore, here is the generalized formula for the ground state population and the excited state one for the whole wave-function: +For all MOs except the ones corresponding to the Oxygen 1s we should have $\rho^i_{GS}(t) = 1$ and $\rho^i_{Exc}(t) \approx 0$. Therefore, here is the generalized formula for the ground state population and the excited state one for the whole wave-function: 
  
 $$ $$
-\rho_{GS}(t) = \sum_{i=1}^{Ne} |<\psi_i(t=0) | \psi_i(t)>|^2 ; \ \ \  \rho_{Exc}(t) = \sum_{i=1}^{Ne} |<\omega| \psi_i(t)>|^2.+\rho_{GS}(t) = \sum_{i=1}^{N_e} |<\psi_i(t=0) | \psi_i(t)>|^2 ; \ \ \  \rho_{Exc}(t) = \sum_{i=1}^{N_e} |<\omega| \psi_i(t)>|^2.
 $$ $$
  
-We should have in the perturbative regime $\rho_{GS}(t)$ close to the number of electron $Neand $\rho_{GS}(t) = Ne - \rho_{Exc}(t)$.+We should have in the perturbative regime $\rho_{GS}(t)$ close to the number of electron $N_e$:  $\rho_{GS}(t) = N_e - \rho_{Exc}(t)$.
  
 Finally, if we neglect the off-resonance interaction with the field, the evolution of the energy is: Finally, if we neglect the off-resonance interaction with the field, the evolution of the energy is:
Line 220: Line 221:
     &END POISSON     &END POISSON
     &XC     &XC
- &XC_FUNCTIONAL PBE                +      &XC_FUNCTIONAL PBE                
-            &PBE                +        &PBE                
-               SCALE_X 0.55 +          SCALE_X 0.55 
-            &END +        &END 
-         &END XC_FUNCTIONAL +      &END XC_FUNCTIONAL 
-         &HF +      &HF 
-            FRACTION 0.45 +        FRACTION 0.45 
-            &INTERACTION_POTENTIAL +        &INTERACTION_POTENTIAL 
-               POTENTIAL_TYPE TRUNCATED    +          POTENTIAL_TYPE TRUNCATED    
-               CUTOFF_RADIUS 7.0         +          CUTOFF_RADIUS 7.0         
-            &END INTERACTION_POTENTIAL +        &END INTERACTION_POTENTIAL 
-         &END HF +      &END HF 
-     &END XC+    &END XC
     &PRINT     &PRINT
       &MULLIKEN OFF       &MULLIKEN OFF
Line 272: Line 273:
 </code> </code>
  
-We will not detail all the parameters and instead focus on the one related to the dynamics itself, the field, and the time-dependent projection part.+We will not detail all the parameters and instead focus on the one related to the real-time propagation, the field, and the time-dependent projection part.
  
 == Real-Time Propagation parameters == == Real-Time Propagation parameters ==
Line 280: Line 281:
 INITIAL_WFN SCF_WFN INITIAL_WFN SCF_WFN
 </code> </code>
-Therefore, before the Real-Time Propagation, a ground state calculation will be performed. +Before the Real-Time Propagation starts, a ground state calculation will thus be performed. 
 We use a Molecular Orbital-based description of the wave function for the propagation along with the Arnoldi approach to compute the exponential: We use a Molecular Orbital-based description of the wave function for the propagation along with the Arnoldi approach to compute the exponential:
  
Line 287: Line 288:
 </code> </code>
  
-Note that for very large systems, the density-based method can be used for linear scaling (see the DENSITY_PROPAGATION keyword). +Note that for extensive systems, the density-based method can be used for linear scaling (see the DENSITY_PROPAGATION keyword). 
 For each time step, the AERTS algorithm is used with a convergence threshold defined by  For each time step, the AERTS algorithm is used with a convergence threshold defined by 
  
Line 300: Line 301:
 </code> </code>
  
-The time step used is rather small since we have to describe a core-hole excitation process that takes place with a typical frequency of 529~ev. As a rule of thumb, the time step should be about tens of the field frequency used:+The time step used is rather small since we have to describe a core-hole excitation process that takes place with a typical frequency of 529 ev. As a rule of thumb, the time step should be about tens of the field frequency used:
  
 <code> <code>
Line 312: Line 313:
 The time-dependent electric field is defined for both gauges in the EFIELD section. It should be noted that one can define several EFIELD sections to apply several fields within the same simulation.  The time-dependent electric field is defined for both gauges in the EFIELD section. It should be noted that one can define several EFIELD sections to apply several fields within the same simulation. 
  
-The field is defined by its envelope, its intensity (in W.cm$^{-2}$), its polarization along the laboratory x,y, and z-axis, its wavelength (in nanometer), and the original phase. Several types of field envelopes can be used. Here we use a Gaussian one with a width of $\sigma=0.3073$ fs and centered at $T0=1.3190$ fs. The intensity used is 4.08E+13 W.cm$^{-2}$. Along with a carrying frequency of 529 ev (approximately 2.34374655955 nm), it should promote about $10^{-3}$ from the Oxygen 1s to the first available excited state. See {{:howto:rtp_field_xas.zip |the jupyter notebook tutorial}} for more information about how to choose these parameters depending your system.  +The field is defined by its envelope, its intensity, its polarization along the laboratory x, y, and z-axis, its wavelength, and the original phase. Several types of field envelopes can be used. Here we use a Gaussian one with a width of $\sigma=0.3073$ fs and centered at $T0=1.3190$ fs. The intensity used is 4.08E+13 W.cm$^{-2}$. Along with a carrying frequency of 529 ev (approximately 2.34374655955 nm), it should promote about $10^{-3}$ from the Oxygen 1s to the first available excited state. See {{:howto:rtp_field_xas.zip |the jupyter notebook tutorial}} for more information about how to choose these parameters depending on your system.  
  
 <code> <code>
Line 354: Line 355:
  
 All the time-dependent Molecular Orbitals are projected (TD_MO_INDEX = -1) and these projections are stored separately (SUM_ON_ALL_TD .FALSE.). This calculation is spin-independent so one does not have to define the spin of the MO to project.  All the time-dependent Molecular Orbitals are projected (TD_MO_INDEX = -1) and these projections are stored separately (SUM_ON_ALL_TD .FALSE.). This calculation is spin-independent so one does not have to define the spin of the MO to project. 
-The reference to projected on is loaded from the file RTP-RESTART.wfn, which is the ground state obtained after the SCF cycles. Note that you can define a wave-function that is not the ground state as long as the wave-function description (basis set, number of electrons...) is the same as the one used for the real-time propagation. The 'type' of reference is the default one, REFERENCE_TYPE SCF. All the molecular orbitals available in this reference wave-function will be used as a reference for the projection (REF_MO_INDEX -1 ), and stored in separate files (SUM_ON_ALL_REF .FALSE.). The projection will be computed at each time step.+The reference to projected to is loaded from the file RTP-RESTART.wfn, which is the ground state obtained after the SCF cycles. Note that you can define a wave-function that is not the ground state as long as the wave-function description (basis set, number of electrons...) is the same as the one used for the real-time propagation. The 'type' of the reference file is the default one, REFERENCE_TYPE SCF. All the molecular orbitals available in this reference wave-function will be used as a reference for the projection (REF_MO_INDEX -1 ), and stored in separate files (SUM_ON_ALL_REF .FALSE.). The projection will be computed at each time step.
  
-There are Ne/2 = 7 molecular orbitals for carbon monoxide. There are thus 7 time dependent MOs (the $i$) and 7 reference MO (the $j$), so that there will be $7x7=49$ projection per time step: +There are $N_e/2 = 7molecular orbitals for carbon monoxide. There are thus 7 time-dependent MOs (the $i$s) and 7 reference MO (the $j$s), so that there will be $7x7=49$ projection per time step: 
  
 $$ $$
Line 369: Line 370:
 $$ $$
  
-Now, let us focus on the second and third projections which can be viewed as excited-state projections+Now, let us focus on the second and third projections which can be viewed as projections toward excited-states
  
 <code> <code>
Line 385: Line 386:
 </code> </code>
  
-In this case, all the time-dependent MO are involved in the projection and stored separately. This time, the reference wave function is supposed to be from an XAS_TDP calculation, see XAS_TDP%PRINT%RESTART_WFN section or the Linear Response input file in the {{:howto:rtp_field_xas.zip |tutorial archive}}. Running with the proper parameters, this XAS_TDP run produces a .wfn file per excited state: it is the $|\omega>$ presented before. Thus, using  REFERENCE_TYPE XAS_TDP automatically looks for the  $|\omega>$ saved in the .wfn file and performs the projection toward it+In this case, all the time-dependent MO are involved in the projection and stored separately. This time, the reference wave function is supposed to be from an XAS_TDP calculation, see XAS_TDP%PRINT%RESTART_WFN section or the Linear Response input file in the {{:howto:rtp_field_xas.zip |tutorial archive}}. Running with the proper parameters, this XAS_TDP run saves one .wfn file per excited state: it is the $|\omega>$ presented before. Using REFERENCE_TYPE XAS_TDP, the projection uses automatically the $|\omega>$ saved in the .wfn file as the reference file
  
 $$ $$
Line 392: Line 393:
  
 Where $c_\omega^a$ is the $a^{\text{th}}$ atomic coefficient of the excited state found in the XAS_TDP module. Where $c_\omega^a$ is the $a^{\text{th}}$ atomic coefficient of the excited state found in the XAS_TDP module.
-There will thus be 7 projections per time step in this case. The excited state population associated to this state is:+There will be 7 projections per time step in this case: one for each time-dependent MO. The excited state population associated with this excited state is:
  
 $$ $$
Line 398: Line 399:
 $$ $$
  
-The carbon monoxide molecule has a rotational symmetry along its CO bond: if one notes this axis $z$, then the $x$ and $y$-axis are equivalent by symmetry. It happens that the first available excited state for the Oxygen 1s is degenerate: there are two available states orthogonal in the $xy$-plane.  That is why ta third projection is requested: it uses the other excited state proposed by the XAD_TDP module which has the exact same frequency as the first one+The carbon monoxide molecule has a rotational symmetry along its CO bond. If one notes this axis $z$, then the $x$ and $y$-axis are equivalent by symmetry. It happens that the first available excited state for the Oxygen 1s is degenerate: there are two available excited states orthogonal in the $xy$-plane.  That is why third projection is requested which uses the other excited state proposed by the XAD_TDP module.
  
-Therefore, the excited state should be understood as the some over these two frequency equivalent state+Therefore, the excited state should be understood as the sum over the two equivalent excited states:
  
 $$ $$
Line 406: Line 407:
 $$ $$
  
-Where $\omega'$ stands for the other equivalent excited state. +Where $\omega'$ stands for the other equivalent excited state, with $\omega=\omega'=529$ ev
  
  
howto/rtp_field_xas.txt · Last modified: 2024/02/24 10:02 by oschuett