-
Notifications
You must be signed in to change notification settings - Fork 4
/
eldest.py
executable file
·360 lines (273 loc) · 14.1 KB
/
eldest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
#!/usr/bin/python
##########################################################################
# ELDEST #
# Investigating Electronic Decay Processes with Streaking #
##########################################################################
# Purpose: #
# - A program to simulate the streaking process of electronic #
# decay processes. #
# #
##########################################################################
# written by: Elke Fasshauer May 2018 #
##########################################################################
import scipy
import scipy.integrate as integrate
import numpy as np
import sciconv
import complex_integration as ci
import res_anal_integ as aires
import in_out
#-------------------------------------------------------------------------
# Input parameters
rdg_au = 0.5 # transition dipole moment into the resonant state
cdg = 0.5 # transition dipole moment into any continuum state
# parameters of the investigated system
# the ground state energy is being defined as Eg = 0
Er_eV = 44.0 # resonance energy in eV
E_kin_eV = 2.0 # kinetic energy of secondary electron
E_fin_eV = 12.0 # final state energy in eV
#Gamma_eV = 0.5 # electronic decay width of the resonant state
tau_s = 2.0E-15 # lifetime
# laser parameters
Omega_min_eV = 40.0 # scanning XUV pulse from Omega_min-eV to
Omega_max_eV = 48.0 #
TX_s = 100E-18 # duration of the XUV pulse in seconds
n_X = 3
I_X = 5.0E11 # intensity of the XUV pulse in W/cm^2
#A0X = 1.0 # amplitude of the XUV pulse
omega_eV = 1.0 # IR pulse
TL_s = 1.0E-14 # duration of the IR streaking pulse
n_L = 4
I_L = 1.0E09 # intensity of the IR pulse in W/cm^2
#A0L = 1.0 # amplitude of the IR pulse
delta_t_s = 5.0E-14 # time difference between the maxima of the two pulses
phi = 0
# parameters of the simulation
tmax_s = 3.0E-15 # simulate until time tmax in seconds
timestep_s = 200E-18 # evaluate expression every timestep_s seconds
Omega_step_eV = 0.5 # energy difference between different evaluated Omegas
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
# Definitions of reusable functions
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
# Convert input parameters to atomic units
#-------------------------------------------------------------------------
Er_au = sciconv.ev_to_hartree(Er_eV)
E_kin_au = sciconv.ev_to_hartree(E_kin_eV)
E_fin_au = sciconv.ev_to_hartree(E_fin_eV)
#Gamma_au = sciconv.ev_to_hartree(Gamma_eV)
tau_au = sciconv.second_to_atu(tau_s)
Gamma_au = 1. / tau_au
# laser parameters
Omega_min_au = sciconv.ev_to_hartree(Omega_min_eV)
Omega_max_au = sciconv.ev_to_hartree(Omega_max_eV)
TX_au = sciconv.second_to_atu(TX_s)
TX_au = n_X * 2 * np.pi / Omega_min_au
I_X_au = sciconv.Wcm2_to_aiu(I_X)
E0X = np.sqrt(I_X_au)
A0X = E0X / Omega_min_au # this could be wrong and might have
# to be evaluated for each Omega
omega_au = sciconv.ev_to_hartree(omega_eV)
TL_au = sciconv.second_to_atu(TL_s)
TL_au = n_L * 2 * np.pi / omega_au
I_L_au = sciconv.Wcm2_to_aiu(I_L)
E0L = np.sqrt(I_L_au)
A0L = E0L / omega_au
delta_t_au = sciconv.second_to_atu(delta_t_s)
# parameters of the simulation
tmax_au = sciconv.second_to_atu(tmax_s)
timestep_au = sciconv.second_to_atu(timestep_s)
Omega_step_au = sciconv.ev_to_hartree(Omega_step_eV)
p_au = np.sqrt(2*E_kin_au)
VEr_au = np.sqrt(Gamma_au/ (2*np.pi))
res_kin = complex(Gamma_au/2,Er_au + E_kin_au)
res = complex(Gamma_au/2,Er_au)
#-------------------------------------------------------------------------
in_out.check_input(Er_au, E_kin_au, E_fin_au, Gamma_au,
Omega_min_au, Omega_max_au, TX_au, A0X,
omega_au, TL_au, A0L, delta_t_au,
tmax_au, timestep_au, Omega_step_au)
#-------------------------------------------------------------------------
# open outputfile
outfile = open("eldest.out", mode='w')
#-------------------------------------------------------------------------
# physical defintions of functions
# XUV pulse
f_t = lambda tau: 1./4 * ( np.exp(2j * np.pi * (t_au - tau) / TX_au)
+ 2
+ np.exp(-2j * np.pi * (t_au - tau) /TX_au) )
fp_t = lambda tau: np.pi/(2j*TX_au) * ( - np.exp(2j*np.pi* (t_au - tau)/TX_au)
+ np.exp(-2j*np.pi* (t_au - tau) /TX_au) )
FX_t = lambda tau: - A0X * np.cos(Omega_au * (t_au - tau)) * fp_t(tau) + A0X * Omega_au * np.sin(Omega_au * (t_au - tau)) * f_t(tau)
#Variante mit TX
f_TX = lambda tau: 1./4 * ( np.exp(2j * np.pi * (TX_au/2 - tau) / TX_au)
+ 2
+ np.exp(-2j * np.pi * (TX_au/2 - tau) /TX_au) )
fp_TX = lambda tau: np.pi/(2j*TX_au) * ( - np.exp(2j*np.pi* (TX_au/2 - tau)/TX_au)
+ np.exp(-2j*np.pi* (TX_au/2 - tau) /TX_au) )
FX_TX = lambda tau: - A0X * np.cos(Omega_au * (TX_au/2 - tau)) * fp_TX(tau) + A0X * Omega_au * np.sin(Omega_au * (TX_au/2 - tau)) * f_TX(tau)
# IR pulse
A_IR = lambda t3: A0L * np.sin(np.pi * (t3 - delta_t_au + TL_au/2) * omega_au / TL_au
+ phi)**2
integ_IR = lambda t3: (p_au + A_IR(t3))**2
#-------------------------------------------------------------------------
# technical defintions of functions
# probiere Umschreiben der Integrationsvariable
fun_t_1 = lambda tau: np.exp(-tau * res) * FX_t(tau)
fun_t_2 = lambda tau: np.exp(complex(0,E_kin_au) * tau) * FX_t(tau)
fun_TX2_1 = lambda tau: np.exp(-tau * res) * FX_TX(tau)
fun_TX2_2 = lambda tau: np.exp(complex(0,E_kin_au) * tau) * FX_TX(tau)
#-------------------------------------------------------------------------
# initialization
t_au = -TX_au/2
outfile.write(' '.join(('TX/2 = ',
str(sciconv.atu_to_second(TX_au/2)), 's', '\n')))
outfile.write(' '.join(('TL/2 = ',
str(sciconv.atu_to_second(TL_au/2)), 's', '\n')))
outfile.write(' '.join(('delta_t_au - TL_au/2 = ',
str(sciconv.atu_to_second(delta_t_au - TL_au/2)), 's', '\n')))
outfile.write(' '.join(('delta_t_au + TL_au/2 = ',
str(sciconv.atu_to_second(delta_t_au + TL_au/2)), 's', '\n')))
outfile.write(' '.join(('tmax = ',
str(sciconv.atu_to_second(tmax_au)), 's', '\n')))
#-------------------------------------------------------------------------
# constant integrals, they are independent of both Omega and t
integral_6_12 = aires.integral_6_12(Vr=VEr_au, rdg=rdg_au, E_kin=E_kin_au,
TX=TX_au, TL=TL_au, delta=delta_t_au,
res=res, res_kin=res_kin)
integral_7_13 = aires.integral_7_13(Vr=VEr_au, rdg=rdg_au, E_kin=E_kin_au,
TX=TX_au, TL=TL_au, delta=delta_t_au,
res=res, res_kin=res_kin)
integral_14 = aires.integral_14(Vr=VEr_au, rdg=rdg_au, E_kin=E_kin_au,
TX=TX_au, TL=TL_au, delta=delta_t_au,
res=res, res_kin=res_kin)
integral_15 = aires.integral_15(Vr=VEr_au, rdg=rdg_au, E_kin=E_kin_au,
TX=TX_au, TL=TL_au, delta=delta_t_au,
res=res, res_kin=res_kin)
integral_16 = aires.integral_16(Vr=VEr_au, rdg=rdg_au, E_kin=E_kin_au,
TX=TX_au, TL=TL_au, delta=delta_t_au,
res=res, res_kin=res_kin)
const_after = integral_6_12 + integral_7_13 + integral_14 + integral_15
#-------------------------------------------------------------------------
while ((t_au <= TX_au/2) and (t_au <= tmax_au)):
#-------------------------------------------------------------------------
outfile.write('during the first pulse \n')
Omega_au = Omega_min_au
outlines = []
while (Omega_au < Omega_max_au):
# integral 1
# other integration variable
I1 = ci.complex_quadrature(fun_t_1, (t_au + TX_au/2), 0)
I2 = ci.complex_quadrature(fun_t_2, (t_au + TX_au/2), 0)
J = - rdg_au * VEr_au / res_kin * (I1[0] - I2[0])
string = in_out.prep_output(J, Omega_au)
outlines.append(string)
Omega_au = Omega_au + Omega_step_au
in_out.doout(t_au,outlines)
t_au = t_au + timestep_au
#-------------------------------------------------------------------------
while (t_au >= TX_au/2 and t_au <= (delta_t_au - TL_au/2) and (t_au <= tmax_au)):
#-------------------------------------------------------------------------
outfile.write('between the pulses \n')
Omega_au = Omega_min_au
outlines = []
# integrals 3 and 4 are independent of omega, they are therefore
# evaluated before integral 2 and especially outside the loop
#integral 3
integral_3 = aires.integral_3(VEr_au, rdg_au, E_kin_au, TX_au, res, res_kin, t_au)
K = integral_3
#integral 4
integral_4 = aires.integral_3(VEr_au, rdg_au, E_kin_au, TX_au, res, res_kin, t_au)
K = K + integral_4
while (Omega_au < Omega_max_au):
# integral 2
# other integration variable
I1 = ci.complex_quadrature(fun_TX2_1, (TX_au/2 + TX_au/2), 0)
I2 = ci.complex_quadrature(fun_TX2_2, (TX_au/2 + TX_au/2), 0)
J = - rdg_au * VEr_au / res_kin * (I1[0] - I2[0])
L = K + J
string = in_out.prep_output(L, Omega_au)
outlines.append(string)
Omega_au = Omega_au + Omega_step_au
in_out.doout(t_au,outlines)
t_au = t_au + timestep_au
#-------------------------------------------------------------------------
# during the ir pulse
while (t_au >= (delta_t_au - TL_au/2)
and t_au <= (delta_t_au + TL_au/2)
and (t_au <= tmax_au)):
#-------------------------------------------------------------------------
outfile.write('during the second pulse \n')
# integrals, that are independent of omega
integral_8 = aires.integral_8(Vr=VEr_au, rdg=rdg_au, E_kin=E_kin_au,
TX=TX_au, TL=TL_au, delta=delta_t_au,
res=res, res_kin=res_kin, t=t_au)
integral_9 = aires.integral_9(Vr=VEr_au, rdg=rdg_au, E_kin=E_kin_au,
TX=TX_au, TL=TL_au, delta=delta_t_au,
res=res, res_kin=res_kin, t=t_au)
integral_10 = aires.integral_10(Vr=VEr_au, rdg=rdg_au, E_kin=E_kin_au,
TX=TX_au, TL=TL_au, delta=delta_t_au,
res=res, res_kin=res_kin, t=t_au)
I_IR = integrate.quad(integ_IR, delta_t_au - TL_au/2, t_au)
I10 = integral_10 * I_IR[0]
K = integral_8 + integral_9 + I10 + integral_7_13
Omega_au = Omega_min_au
outlines = []
while (Omega_au < Omega_max_au):
# integral 5 = integral 2
# other integration variable
I1 = ci.complex_quadrature(fun_TX2_1, (TX_au/2 + TX_au/2), 0)
I2 = ci.complex_quadrature(fun_TX2_2, (TX_au/2 + TX_au/2), 0)
J = - rdg_au * VEr_au / res_kin * (I1[0] - I2[0])
L = J + K
string = in_out.prep_output(L, Omega_au)
outlines.append(string)
Omega_au = Omega_au + Omega_step_au
in_out.doout(t_au,outlines)
t_au = t_au + timestep_au
#-------------------------------------------------------------------------
# after the second pulse
while (t_au >= (delta_t_au + TL_au/2)
and (t_au <= tmax_au)):
#-------------------------------------------------------------------------
outfile.write('after the second pulse')
# omega independent integrals
#integral 16
I_IR = integrate.quad(integ_IR, delta_t_au - TL_au/2, delta_t_au + TL_au/2)
integral_16_p = integral_16 * I_IR[0]
#integral 17
integral_17 = aires.integral_17(Vr=VEr_au, rdg=rdg_au, E_kin=E_kin_au,
TX=TX_au, TL=TL_au, delta=delta_t_au,
res=res, res_kin=res_kin, t=t_au)
#integral 18
integral_18 = aires.integral_18(Vr=VEr_au, rdg=rdg_au, E_kin=E_kin_au,
TX=TX_au, TL=TL_au, delta=delta_t_au,
res=res, res_kin=res_kin, t=t_au)
#integral 19
integral_19 = aires.integral_19(Vr=VEr_au, rdg=rdg_au, E_kin=E_kin_au,
TX=TX_au, TL=TL_au, delta=delta_t_au,
res=res, res_kin=res_kin, t=t_au)
integral_19 = integral_19 * I_IR[0]
#integral 20
integral_20 = aires.integral_20(Vr=VEr_au, rdg=rdg_au, E_kin=E_kin_au,
TX=TX_au, TL=TL_au, delta=delta_t_au,
res=res, res_kin=res_kin, t=t_au)
integral_20_p = integral_20 * I_IR[0]
K = (integral_16_p + integral_17 + integral_18 + integral_19
+ integral_20_p + const_after)
Omega_au = Omega_min_au
outlines = []
while (Omega_au < Omega_max_au):
# integral 11 = integral 5 = integral 2
# other integration variable
I1 = ci.complex_quadrature(fun_TX2_1, (TX_au/2 + TX_au/2), 0)
I2 = ci.complex_quadrature(fun_TX2_2, (TX_au/2 + TX_au/2), 0)
J = - rdg_au * VEr_au / res_kin * (I1[0] - I2[0])
L = J + K
string = in_out.prep_output(L, Omega_au)
outlines.append(string)
Omega_au = Omega_au + Omega_step_au
in_out.doout(t_au,outlines)
t_au = t_au + timestep_au
outfile.close