-
Notifications
You must be signed in to change notification settings - Fork 0
/
module_run_stationary.f90
653 lines (527 loc) · 30.1 KB
/
module_run_stationary.f90
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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
module module_run_stationary
USE class_inputdata
USE class_grid
USE class_junction
USE class_density
USE class_system
USE class_coupling
USE class_ltensor
USE class_observables
USE class_rhox
USE class_bosonic_bath
implicit none
type(grid)::x_grid
type(densityvector)::density
type(system):: mol_system
type(leads)::theleads
type(coupling)::couplings
type(ltensor)::tensor
type(observables)::observable_set
type(rhox)::rhox_representation
type(bath)::hbath
contains
subroutine initialize_entire_system(input)
CLASS(inputdata), intent(in)::input
INTEGER :: i !< Loop Variable
!Initialize ...
!Compute the Position Grid in Hermite Base for the DVR Calculations
CALL x_grid%init_grid(input)
!----the density vector
CALL density%init_densityvector(input, "S")
!----the internal system
CALL mol_system%init_system(input, x_grid, density)
!----the Leads
CALL theleads%init_leads(input, density, mol_system)
!----the Couplings
CALL couplings%init_coupling(mol_system, x_grid, density, input)
!--- Harmonic Heath Bath
CALL hbath%init_bath(input, density, mol_system)
!--- tensor object
CALL tensor%init_tensor(input, density)
!--- Observable Object
CALL observable_set%init_observables(input, density, mol_system)
!--- RHOX Object for the rho(x) represention
CALL rhox_representation%init_rhox(input, density, x_grid, mol_system)
!---Franck Condon
CALL couplings%write_couplings(1, "stat", 25)
end subroutine
subroutine run_current_voltage_characteristics(input)
CLASS(inputdata), intent(in)::input
INTEGER :: i !< Loop Variable
INTEGER :: test_pass
CALL initialize_entire_system(input)
!Loop over the voltages and calculation of the stationary state
ASSOCIATE(volt => input%parameter_grid, &
grid_end => input%parameter_grid_length)
DO i = 1, grid_end
!Performance
CALL observable_set%get_performance_time(i,"start")
!Variation and Computation of rho
CALL theleads%change_voltage( volt(i))
CALL tensor%get_stationary_rho(density, mol_system, theleads, couplings, hbath, input)
!Processing rho
!---Observables
CALL observable_set%get_and_store_observables(i, density, mol_system, theleads, couplings)
CALL observable_set%get_state_population(i, density)
!---Rho(x)
CALL rhox_representation%get_and_store_rhox(i, density, x_grid, mol_system)
!Performance
CALL observable_set%get_performance_time(i,"end")
WRITE(*,*) volt(i), i
END DO
CALL tensor%check_bath_ltensor(density)
CALL tensor%analyse_bath_ltensor(mol_system, test_pass)
!Writing Data Output
!---Standard
CALL observable_set%write_performance_tofile("stat")
CALL observable_set%write_results_tofile("stat")
CALL observable_set%write_population_tofile("stat",1)
CALL observable_set%write_population_tofile("stat",0)
CALL observable_set%write_summary_tofile(mol_system, couplings, 20 , "stat")
CALL observable_set%write_population_histo_tofile("stat",0)
CALL observable_set%write_population_histo_tofile("stat",1)
!---rhox
CALL rhox_representation%write_rhox_tofile_xyz("stat", x_grid)
CALL rhox_representation%write_rhox_tofile_mformat("stat", x_grid)
CALL rhox_representation%write_prob_integral("stat")
CALL mol_system%write_system_to_file(25, "stat")
CALL mol_system%write_x_energy(1, "stat", 25)
END ASSOCIATE
end subroutine run_current_voltage_characteristics
subroutine run_gate_voltage(input)
CLASS(inputdata), intent(in)::input
INTEGER :: i,j!< Loop Variables
CHARACTER(len=20) :: bias_string
CHARACTER(len=20) :: gate_string
CHARACTER(len=100) :: output_string
INTEGER :: test_pass
CALL initialize_entire_system(input)
!This optional, only the object properties are set.
CALL density%set_rho_superposition_symmetric(0, input%initial_state_number, input%initial_state_number2, input%initial_occupation)
ASSOCIATE(gate_volt => input%parameter_grid, &
gate_grid_end => input%parameter_grid_length,&
bias_volt => input%sec_parameter_grid, &
bias_grid_end => input%sec_parameter_grid_length)
DO i = 1, bias_grid_end
!Change voltage of the leads
CALL theleads%change_voltage(bias_volt(i))
DO j = 1, gate_grid_end
WRITE(*,*)
WRITE(*,'(A, E10.3, I)') "Gate Voltage: ", gate_volt(j), j
WRITE(*,'(A, E10.3, I)') "Bias Voltage: ", bias_volt(i), i
WRITE(*,*)
!Performance
CALL observable_set%get_performance_time(j,"start")
!Variation of the gate and new Computation of the system, leads and the couplings
!Eigensystem and Eigenenergies
CALL mol_system%change_gate(gate_volt(j))
!Leads
CALL couplings%update(mol_system)
CALL theleads%update(mol_system)
!Bath | Remark: Elements <n|x|m> is calculated in mol_system%change_gate
CALL hbath%update_bath(mol_system)
!Frank Matrix, <n | s(x) | m>^2
CALL observable_set%put_in_frank_matrix(couplings, j)
!Position in energy representation <n | x | m> equivalent of the frank
!matrix for the harmonich bat
CALL observable_set%put_in_x_energy_matrix(mol_system, j)
!'''''''''''''''''''''''''''''''''''''''
!Calculate Rho
CALL tensor%get_stationary_rho(density, mol_system, theleads, couplings, hbath, input)
!'''''''''''''''''''''''''''''''''''''''
!''''''''''''''''''''''''''''''''''''''
!Check if Rho is calculated within the Theorie
!''''''''''''''''''''''''''''''''''''''
CALL tensor%check_bath_ltensor(density)
CALL tensor%analyse_bath_ltensor(mol_system, test_pass)
WRITE(*,*) '**********Testpass****************'
WRITE(*,*) test_pass
WRITE(*,*) '**********************************'
CALL observable_set%get_hbath_validity(test_pass, j)
!''''''''''''''''''''''''''''''''''''''
!Processing rho
!---Observables
CALL observable_set%get_and_store_observables_mod_system(j, density, mol_system, theleads, couplings)
CALL observable_set%get_state_population(j, density)
!---Rho(x)
CALL rhox_representation%update_rhox(density, mol_system, x_grid)
CALL rhox_representation%get_and_store_rhox(j, density, x_grid, mol_system)
!Optional
CALL rhox_representation%get_wave_integral(x_grid, mol_system,j)
!Energys
CALL observable_set%get_state_energy(j, mol_system, density)
!Performance
CALL observable_set%get_performance_time(j,"end")
!State Eigenenergie
CALL observable_set%get_state_energy(j, mol_system, density)
WRITE(gate_string, '(F10.3)' ) gate_volt(j)
output_string= "gate_at_"//trim(adjustl(gate_string))
!CALL mol_system%write_system_to_file(15, output_string)
!Optonal
CALL observable_set%get_sub_matrix(j, density)
END DO
!Generate suffix for the outputfiles for better specification
WRITE(bias_string, '(F10.3)' ) bias_volt(i)
output_string= "switchmod_bias_at"//trim(adjustl(bias_string))
CALL mol_system%potential_surface(output_string, 1)
!Writing Data Output
!---Standard
CALL observable_set%write_performance_tofile(output_string)
CALL observable_set%write_results_tofile(output_string)
CALL observable_set%write_state_energy_tofile(output_string)
CALL observable_set%write_population_tofile(output_string, 1)
CALL observable_set%write_population_tofile(output_string, 0)
!---rhox
CALL rhox_representation%write_rhox_tofile_xyz(output_string, x_grid)
!--- Tunnelprobability
CALL rhox_representation%write_prob_integral(output_string)
CALL rhox_representation%write_wave_integral(output_string)
!Write the transition elements <n|s(x)|m>^2 for every gate voltage
CALL observable_set%write_frank_matrix(output_string, 12)
!Write the transition elements <n|x|m>^2 for every gate voltage
CALL observable_set%write_x_energy_matrix(output_string, 12)
!Peformance for runtime estimation
CALL observable_set%get_performance_sum(gate_grid_end)
!Optional
CALL observable_set%write_sub_matrix(output_string)
!Validity Matrix
CALL observable_set%write_hbath_validity(output_string)
END DO
END ASSOCIATE
end subroutine run_gate_voltage
subroutine run_current_voltage_characteristics_3d(input)
CLASS(inputdata), intent(in)::input
INTEGER :: i,j!< Loop Variables
CHARACTER(len=20) :: gate_string
CHARACTER(len=100) :: output_string
CALL initialize_entire_system(input)
!Loop over the voltages and calculation of the stationary state
ASSOCIATE(gate_volt => input%sec_parameter_grid, &
gate_grid_end => input%sec_parameter_grid_length,&
bias_volt => input%parameter_grid, &
bias_grid_end => input%parameter_grid_length)
DO i = 1, gate_grid_end
!Variation of the gate and new Computation of the system, leads and the couplings
CALL mol_system%change_gate(gate_volt(i))
CALL theleads%update(mol_system)
CALL couplings%update(mol_system)
CALL hbath%update_bath(mol_system)
DO j = 1, bias_grid_end
WRITE(*,*)
WRITE(*,'(A, E10.3, I)') "Bias Voltage: ", bias_volt(j), j
WRITE(*,'(A, E10.3, I)') "Gate Voltage: ", gate_volt(i), i
WRITE(*,*)
!Performance
!CALL observable_set%get_performance_time(j,"start")
!Change voltage of the leads
CALL theleads%change_voltage(bias_volt(j))
CALL tensor%get_stationary_rho(density, mol_system, theleads, couplings, hbath, input)
!Processing rho
!---Observables
CALL observable_set%get_and_store_observables_mod_system(j, density, mol_system, theleads, couplings)
CALL observable_set%get_state_population(j, density)
!---Rho(x)
CALL rhox_representation%update_rhox(density, mol_system, x_grid)
CALL rhox_representation%get_and_store_rhox(j, density, x_grid, mol_system)
!Performance
!CALL observable_set%get_performance_time(j,"end")
END DO
!Generate suffix for the outputfiles for better specification
WRITE(gate_string, '(F10.3)' ) gate_volt(i)
output_string= "gate_at_"//trim(adjustl(gate_string))
!Writing Data Output
!---Standard
CALL observable_set%write_performance_tofile(output_string)
CALL observable_set%write_results_tofile(output_string)
CALL observable_set%write_population_tofile(output_string, 1)
CALL observable_set%write_population_tofile(output_string, 0)
CALL observable_set%write_summary_tofile(mol_system, couplings, 20 , output_string)
!---rhox
CALL rhox_representation%write_rhox_tofile_xyz(output_string, x_grid)
!--- Tunnelprobability
CALL rhox_representation%write_prob_integral(output_string)
!---Observables and Tunnel probability in Matrix Form
CALL observable_set%put_in_observable_matrix(i)
CALL rhox_representation%put_tunnel_probability_matrix(i)
!Peformance for runtime estimation
CALL observable_set%get_performance_sum(gate_grid_end)
END DO
!Writing the grid
CALL observable_set%write_parameter_grid
CALL mol_system%potential_surface("potential", 1)
!In and Output of matrix data
CALL observable_set%write_observable_energy_matrix_tofile_xyz("obs_matrix")
CALL observable_set%write_observable_position_matrix_tofile_xyz("obs_matrix")
CALL observable_set%write_observable_current_matrix_tofile_xyz("obs_matrix")
CALL observable_set%write_observable_population_matrix_tofile_xyz("obs_matrix", 1)
CALL observable_set%write_observable_population_matrix_tofile_xyz("obs_matrix", 0)
!Output of heatmpas
CALL observable_set%write_observable_current_matrix_heatmap("heatmap")
CALL observable_set%write_observable_position_matrix_heatmap("heatmap")
CALL observable_set%write_observable_energy_matrix_heatmap("heatmap")
CALL observable_set%write_observable_population_matrix_heatmap("heatmap",1)
CALL observable_set%write_observable_population_matrix_heatmap("heatmap",0)
!State_populations
CALL observable_set%write_observable_state_population_matrix_heatmap("heatmap", 1)
CALL observable_set%write_observable_state_population_matrix_heatmap("heatmap", 0)
!Tunnel Probabilitys
CALL rhox_representation%write_tunnel_probability_matrix("heatmap")
END ASSOCIATE
end subroutine run_current_voltage_characteristics_3d
subroutine run_cvc_with_bias_field(input)
CLASS(inputdata), intent(in)::input
INTEGER :: i,j!< Loop Variables
CHARACTER(len=20) :: gate_string
CHARACTER(len=20) :: bias_string
CHARACTER(len=100) :: output_string
CALL initialize_entire_system(input)
!Corrent potential is used
!Loop over the voltages and calculation of the stationary state
ASSOCIATE(gate_volt => input%sec_parameter_grid, &
gate_grid_end => input%sec_parameter_grid_length,&
bias_volt => input%parameter_grid, &
bias_grid_end => input%parameter_grid_length)
!Writing the grid
CALL observable_set%write_parameter_grid
CALL mol_system%write_system_to_file(25, "diode_start")
DO i = 1, gate_grid_end
DO j = 1, bias_grid_end
WRITE(*,*)
WRITE(*,'(A, E10.3, I)') "Bias Voltage: ", bias_volt(j), j
WRITE(*,'(A, E10.3, I)') "Gate Voltage: ", gate_volt(i), i
WRITE(*,*)
!Performance
CALL observable_set%get_performance_time(j,"start")
!Variation of the gate and new Computation of the system, leads and the couplings
CALL mol_system%change_gate_and_bias_field(gate_volt(i), bias_volt(j))
CALL theleads%update(mol_system)
CALL couplings%update(mol_system)
CALL hbath%update_bath(mol_system)
!Change voltage of the leads
CALL theleads%change_voltage(bias_volt(j))
CALL tensor%get_stationary_rho(density, mol_system, theleads, couplings, hbath, input)
!Frank Matrix, <n | s(x) | m>^2
CALL observable_set%put_in_frank_matrix(couplings, j)
!Processing rho
!---Observables
CALL observable_set%get_and_store_observables_mod_system(j, density, mol_system, theleads, couplings)
CALL observable_set%get_state_population(j, density)
CALL observable_set%get_state_energy(j, mol_system, density)
!---Rho(x)
CALL rhox_representation%update_rhox(density, mol_system, x_grid)
CALL rhox_representation%get_and_store_rhox(j, density, x_grid, mol_system)
!Performance
CALL observable_set%get_performance_time(j,"end")
!Generate suffix for the outputfiles for better specification
WRITE(bias_string, '(F10.3)' ) bias_volt(i)
output_string= "bias_field__"//trim(adjustl(bias_string))
!BEWARE THAT THIS PRODUCES A HUGE AMOUNT OF DATA IF
!summary_bool=1
! CALL observable_set%write_summary_tofile(mol_system, couplings, 20 , output_string)
END DO
!Generate suffix for the outputfiles for better specification
WRITE(gate_string, '(F10.3)' ) gate_volt(i)
output_string= "gate_w_bias_"//trim(adjustl(gate_string))
CALL mol_system%potential_surface(output_string, 1)
!Writing Data Output
!---Standard
CALL observable_set%write_performance_tofile(output_string)
CALL observable_set%write_results_tofile(output_string)
CALL observable_set%write_population_tofile(output_string, 1)
CALL observable_set%write_population_tofile(output_string, 0)
CALL observable_set%write_state_energy_tofile(output_string)
CALL observable_set%write_summary_tofile(mol_system, couplings, 20 , output_string)
!---rhox
CALL rhox_representation%write_rhox_tofile_xyz(output_string, x_grid)
CALL rhox_representation%write_rhox_tofile_mformat(output_string, x_grid)
!---Observables in Matrix Form
CALL observable_set%put_in_observable_matrix(i)
CALL rhox_representation%put_tunnel_probability_matrix(j)
!Peformance for runtime estimation
CALL observable_set%get_performance_sum(gate_grid_end)
!Write the transition elements <n|s(x)|m>^2 for every gate voltage
CALL observable_set%write_frank_matrix(output_string, 12)
END DO
!In and Output of matrix data
CALL observable_set%write_observable_energy_matrix_tofile_xyz("obs_matrix")
CALL observable_set%write_observable_position_matrix_tofile_xyz("obs_matrix")
CALL observable_set%write_observable_current_matrix_tofile_xyz("obs_matrix")
CALL observable_set%write_observable_population_matrix_tofile_xyz("obs_matrix", 1)
!Output of heatmpas
CALL observable_set%write_observable_current_matrix_heatmap("heatmap")
CALL observable_set%write_observable_position_matrix_heatmap("heatmap")
CALL observable_set%write_observable_energy_matrix_heatmap("heatmap")
CALL observable_set%write_observable_population_matrix_heatmap("heatmap",1)
!Tunnel Probability
CALL rhox_representation%write_tunnel_probability_matrix("heatmap")
END ASSOCIATE
END SUBROUTINE run_cvc_with_bias_field
subroutine run_gate_temperature_characteristics_3d(input)
CLASS(inputdata), intent(in)::input
INTEGER :: i,j!< Loop Variables
CHARACTER(len=20) :: gate_string
CHARACTER(len=20) :: bias_string
CHARACTER(len=100) :: output_string
CALL initialize_entire_system(input)
!Loop over the voltages and calculation of the stationary state
ASSOCIATE(gate_volt => input%sec_parameter_grid, &
gate_grid_end => input%sec_parameter_grid_length,&
temperature => input%parameter_grid, &
temperature_end => input%parameter_grid_length)
DO i = 1, gate_grid_end
!Variation of the gate and new Computation of the system, leads and the couplings
CALL mol_system%change_gate(gate_volt(i))
CALL theleads%update(mol_system)
CALL couplings%update(mol_system)
CALL hbath%update_bath(mol_system)
DO j = 1, temperature_end
WRITE(*,*)
WRITE(*,'(A, E10.3, I)') "Temperature: ", temperature(j), j
WRITE(*,'(A, E10.3, I)') "Gate Voltage: ", gate_volt(i), i
WRITE(*,*)
!Performance
CALL observable_set%get_performance_time(j,"start")
!Change Temperature of the enviroment
!---Leads
CALL theleads%change_temperature(temperature(j))
!---Harmonic Bath
CALL hbath%update_and_change_temperature(mol_system,temperature(j))
CALL tensor%get_stationary_rho(density, mol_system, theleads, couplings, hbath, input)
!Processing rho
!---Observables
CALL observable_set%get_and_store_observables_mod_system(j, density, mol_system, theleads, couplings)
CALL observable_set%get_state_population(j, density)
!---Rho(x)
CALL rhox_representation%update_rhox(density, mol_system, x_grid)
CALL rhox_representation%get_and_store_rhox(j, density, x_grid, mol_system)
!Performance
CALL observable_set%get_performance_time(j,"end")
END DO
!Generate suffix for the outputfiles for better specification
WRITE(gate_string, '(F10.3)' ) gate_volt(i)
output_string= "temp3d_gate_at_"//trim(adjustl(gate_string))
!Writing Data Output
!---Standard
CALL observable_set%write_performance_tofile(output_string)
CALL observable_set%write_results_tofile(output_string)
CALL observable_set%write_population_tofile(output_string, 1)
CALL observable_set%write_population_tofile(output_string, 0)
CALL observable_set%write_summary_tofile(mol_system, couplings, 20 , output_string)
!---rhox
CALL rhox_representation%write_rhox_tofile_xyz(output_string, x_grid)
!--- Tunnelprobability
CALL rhox_representation%write_prob_integral(output_string)
!---Observables and Tunnel probability in Matrix Form
CALL observable_set%put_in_observable_matrix(i)
CALL rhox_representation%put_tunnel_probability_matrix(i)
!Peformance for runtime estimation
CALL observable_set%get_performance_sum(gate_grid_end)
END DO
!Writing the grid
CALL observable_set%write_parameter_grid
CALL mol_system%potential_surface("potential", 1)
!In and Output of matrix data
CALL observable_set%write_observable_energy_matrix_tofile_xyz("obs_matrix")
CALL observable_set%write_observable_position_matrix_tofile_xyz("obs_matrix")
CALL observable_set%write_observable_current_matrix_tofile_xyz("obs_matrix")
CALL observable_set%write_observable_population_matrix_tofile_xyz("obs_matrix", 1)
CALL observable_set%write_observable_population_matrix_tofile_xyz("obs_matrix", 0)
!Output of heatmpas
CALL observable_set%write_observable_current_matrix_heatmap("heatmap")
CALL observable_set%write_observable_position_matrix_heatmap("heatmap")
CALL observable_set%write_observable_energy_matrix_heatmap("heatmap")
CALL observable_set%write_observable_population_matrix_heatmap("heatmap",1)
CALL observable_set%write_observable_population_matrix_heatmap("heatmap",0)
!State_populations
CALL observable_set%write_observable_state_population_matrix_heatmap("heatmap", 1)
CALL observable_set%write_observable_state_population_matrix_heatmap("heatmap", 0)
!Tunnel Probabilitys
CALL rhox_representation%write_tunnel_probability_matrix("heatmap")
END ASSOCIATE
end subroutine run_gate_temperature_characteristics_3d
subroutine run_current_frank_characteristics_3d(input)
CLASS(inputdata), intent(in)::input
INTEGER :: i,j!< Loop Variables
CHARACTER(len=20) :: gate_string
CHARACTER(len=100) :: output_string
CALL initialize_entire_system(input)
!Loop over the voltages and calculation of the stationary state
ASSOCIATE(gate_volt => input%sec_parameter_grid, &
gate_grid_end => input%sec_parameter_grid_length,&
bias_volt => input%parameter_grid, &
bias_grid_end => input%parameter_grid_length)
DO i = 1, gate_grid_end
!Variation of the gate and new Computation of the system, leads and the couplings
CALL mol_system%change_gate(gate_volt(i))
CALL theleads%update(mol_system)
CALL couplings%update(mol_system)
CALL hbath%update_bath(mol_system)
DO j = 1, bias_grid_end
WRITE(*,*)
WRITE(*,'(A, E10.3, I)') "Bias Voltage: ", bias_volt(j), j
WRITE(*,'(A, E10.3, I)') "Gate Voltage: ", gate_volt(i), i
WRITE(*,*)
!Performance
CALL observable_set%get_performance_time(j,"start")
!Change voltage of the leads
CALL theleads%change_voltage(bias_volt(j))
CALL tensor%get_stationary_rho(density, mol_system, theleads, couplings, hbath, input)
!Processing rho
!---Observables
CALL observable_set%get_and_store_observables_mod_system(j, density, mol_system, theleads, couplings)
CALL observable_set%get_state_population(j, density)
!---Rho(x)
CALL rhox_representation%update_rhox(density, mol_system, x_grid)
CALL rhox_representation%get_and_store_rhox(j, density, x_grid, mol_system)
!Performance
CALL observable_set%get_performance_time(j,"end")
END DO
!Generate suffix for the outputfiles for better specification
WRITE(gate_string, '(F10.3)' ) gate_volt(i)
output_string= "gate_at_"//trim(adjustl(gate_string))
!Writing Data Output
!---Standard
CALL observable_set%write_performance_tofile(output_string)
CALL observable_set%write_results_tofile(output_string)
CALL observable_set%write_population_tofile(output_string, 1)
CALL observable_set%write_population_tofile(output_string, 0)
CALL observable_set%write_summary_tofile(mol_system, couplings, 20 , output_string)
!---rhox
CALL rhox_representation%write_rhox_tofile_xyz(output_string, x_grid)
!--- Tunnelprobability
CALL rhox_representation%write_prob_integral(output_string)
!---Observables and Tunnel probability in Matrix Form
CALL observable_set%put_in_observable_matrix(i)
CALL rhox_representation%put_tunnel_probability_matrix(i)
!Peformance for runtime estimation
CALL observable_set%get_performance_sum(gate_grid_end)
END DO
!Writing the grid
CALL observable_set%write_parameter_grid
CALL mol_system%potential_surface("potential", 1)
!In and Output of matrix data
CALL observable_set%write_observable_energy_matrix_tofile_xyz("obs_matrix")
CALL observable_set%write_observable_position_matrix_tofile_xyz("obs_matrix")
CALL observable_set%write_observable_current_matrix_tofile_xyz("obs_matrix")
CALL observable_set%write_observable_population_matrix_tofile_xyz("obs_matrix", 1)
CALL observable_set%write_observable_population_matrix_tofile_xyz("obs_matrix", 0)
!Output of heatmpas
CALL observable_set%write_observable_current_matrix_heatmap("heatmap")
CALL observable_set%write_observable_position_matrix_heatmap("heatmap")
CALL observable_set%write_observable_energy_matrix_heatmap("heatmap")
CALL observable_set%write_observable_population_matrix_heatmap("heatmap",1)
CALL observable_set%write_observable_population_matrix_heatmap("heatmap",0)
!State_populations
CALL observable_set%write_observable_state_population_matrix_heatmap("heatmap", 1)
CALL observable_set%write_observable_state_population_matrix_heatmap("heatmap", 0)
!Tunnel Probabilitys
CALL rhox_representation%write_tunnel_probability_matrix("heatmap")
END ASSOCIATE
end subroutine run_current_frank_characteristics_3d
SUBROUTINE test(input)
CLASS(inputdata), intent(in)::input
CALL hbath%init_bath(input, density, mol_system)
CALL hbath%write_bath_functions
CALL hbath%write_bath
END SUBROUTINE test
end module module_run_stationary