32 use,
intrinsic :: iso_fortran_env
87 integer,
public,
parameter :: &
97 integer,
parameter,
public :: &
98 controlfunction_mode_none = 0, &
108 integer :: representation = 0
113 real(real64) :: omegamax =
m_zero
116 real(real64) :: targetfluence =
m_zero
119 logical :: fix_initial_fluence = .false.
121 integer :: mode = controlfunction_mode_none
126 real(real64) :: w0 =
m_zero
128 integer :: no_controlfunctions = 0
129 real(real64),
allocatable :: alpha(:)
131 type(tdf_t),
allocatable :: td_penalty(:)
138 integer :: no_controlfunctions = 0
147 type(tdf_t),
allocatable :: f(:)
148 real(real64),
allocatable :: alpha(:)
150 integer :: current_representation = 0
152 real(real64) :: w0 =
m_zero
153 real(real64),
allocatable :: u(:, :)
154 real(real64),
allocatable :: utransf(:, :)
155 real(real64),
allocatable :: utransfi(:, :)
157 real(real64),
allocatable :: theta(:)
160 logical :: cf_common_initialized = .false.
161 type(controlfunction_common_t) :: cf_common
174 type(partner_list_t),
intent(in) :: ext_partners
175 type(namespace_t),
intent(in) :: namespace
176 real(real64),
intent(in) :: dt
177 integer,
intent(in) :: max_iter
178 logical,
intent(out) :: mode_fixed_fluence
180 character(len=1024) :: expression
181 integer :: no_lines, steps, il, idir, ncols, ipar, irow, ierr
182 real(real64) :: octpenalty
183 complex(real64) :: pol(3)
189 if (.not. cf_common_initialized)
then
192 message(1) =
"Internal error: Cannot call controlfunction_mod_init twice."
232 call parse_variable(namespace,
'OCTControlFunctionRepresentation',
ctr_rt, cf_common%representation)
233 if (.not.
varinfo_valid_option(
'OCTControlFunctionRepresentation', cf_common%representation))
then
236 select case (cf_common%representation)
238 write(
message(1),
'(a)')
'Info: The OCT control functions will be represented as a Fourier series,'
239 write(
message(2),
'(a)')
' and then a transformation to hyperspherical coordinates will be made.'
242 write(
message(1),
'(a)')
'Info: The OCT control functions will be represented as a Fourier series,'
243 write(
message(2),
'(a)')
' in which (i) the zero-frequency component is assumed to be zero,'
244 write(
message(3),
'(a)')
' and (ii) the sum of all the cosine coefficients are zero, so that'
245 write(
message(4),
'(a)')
' the control function starts and ends at zero.'
246 write(
message(5),
'(a)')
' Then, a transformation to hyperspherical coordinates will be made.'
249 write(
message(1),
'(a)')
'Info: The OCT control functions will be represented as a Fourier series.'
252 write(
message(1),
'(a)')
'Info: The OCT control functions will be represented as a Fourier series,'
253 write(
message(2),
'(a)')
' in which the zero-frequency component is assumed to be zero,'
254 write(
message(3),
'(a)')
' and (ii) the sum of all the cosine coefficients are zero, so that'
255 write(
message(4),
'(a)')
' the control function starts and ends at zero.'
258 write(
message(1),
'(a)')
'Info: The OCT control functions will be represented in real time.'
262 write(
message(1),
'(a)')
'Info: The OCT control functions will be represented in real time.'
276 if (cf_common%representation /=
ctr_rt)
then
277 write(
message(1),
'(a)')
'Info: The representation of the OCT control parameters will be restricted'
278 write(
message(2),
'(a,f10.5,a)')
' with an energy cut-off of ', &
312 call parse_variable(namespace,
'OCTFixInitialFluence', .
true., cf_common%fix_initial_fluence)
346 if(.not.
associated(lasers))
then
347 message(1) =
"No lasers found. Cannot proceed."
352 do il = 1, lasers%no_lasers
355 if (aimag(pol(idir))**2 > 1.0e-20_real64)
then
356 write(
message(1),
'(a)')
'In QOCT runs, the polarization vector cannot be complex. Complex'
357 write(
message(2),
'(a)')
'polarization vectors are only truly necessary if one wants a'
358 write(
message(3),
'(a)')
'circularly / elliptically polarized laser. This concepts assumes'
359 write(
message(4),
'(a)')
'the existence of a well defined carrier frequency (otherwise it'
360 write(
message(5),
'(a)')
'would not make sense to speak of a fixed phase difference). So in'
361 write(
message(6),
'(a)')
'QOCT runs it would only make sense for envelope-only optimizations.'
362 write(
message(7),
'(a)')
'This possibility should be implemented in the future.'
374 do il = 1, lasers%no_lasers
375 select case (cf_common%mode)
392 if (lasers%no_lasers > 1)
then
393 write(
message(1),
'(a)')
'Currently octopus only accepts one control field.'
396 cf_common%no_controlfunctions = 1
398 mode_fixed_fluence = .false.
399 select case (cf_common%representation)
401 if (abs(cf_common%targetfluence) <=
m_epsilon)
then
402 write(
message(1),
'(a)')
'If you set "OCTControlFunctionRepresentation" to either'
403 write(
message(2),
'(a)')
'"control_fourier_series_h", or "control_zero_fourier_series_h", then the run'
404 write(
message(3),
'(a)')
'must be done in fixed fluence mode.'
407 mode_fixed_fluence = .
true.
409 if (abs(cf_common%targetfluence) >
m_epsilon)
then
410 write(
message(1),
'(a)')
'If you set "OCTControlFunctionRepresentation" to "control_fourier_series",'
411 write(
message(2),
'(a)')
'then you cannot run in fixed fluence mode.'
414 mode_fixed_fluence = .false.
416 if (abs(cf_common%targetfluence) >
m_epsilon) mode_fixed_fluence = .
true.
440 safe_allocate(cf_common%alpha(1:cf_common%no_controlfunctions))
442 if (
parse_block(namespace,
'OCTPenalty', blk) == 0)
then
445 if (ncols /= cf_common%no_controlfunctions)
then
456 cf_common%alpha(1:cf_common%no_controlfunctions) = octpenalty
474 safe_allocate(cf_common%td_penalty(1:cf_common%no_controlfunctions))
476 if (
parse_block(namespace,
'OCTLaserEnvelope', blk) == 0)
then
480 write(
message(1),
'(a)')
'The block "OCTLaserEnvelope" is only compatible with the option'
481 write(
message(2),
'(a)')
'"OCTControlFunctionType = controlfunction_mode_epsilon".'
486 if (no_lines /= cf_common%no_controlfunctions)
call messages_input_error(namespace,
'OCTLaserEnvelope')
488 do irow = 1, no_lines
491 call tdf_read(cf_common%td_penalty(irow), namespace, trim(expression), ierr)
493 message(1) =
'Time-dependent function "'//trim(expression)//
'" could not be read from inp file.'
496 call tdf_to_numerical(cf_common%td_penalty(irow), steps, dt, cf_common%omegamax)
497 ierr =
parse_block(namespace,
'OCTLaserEnvelope', blk)
502 do ipar = 1, cf_common%no_controlfunctions
519 real(real64),
intent(in) :: dt
520 integer,
intent(in) :: ntiter
527 cp%no_controlfunctions = cf_common%no_controlfunctions
528 cp%current_representation = ctr_internal
529 safe_allocate_source_a(cp%alpha, cf_common%alpha)
531 safe_allocate(cp%f(1:cp%no_controlfunctions))
532 do ipar = 1, cp%no_controlfunctions
545 select case (cf_common%representation)
559 message(1) =
"Internal error: invalid representation."
568 select case (cf_common%representation)
570 cp%dof = cp%no_controlfunctions * cp%dim
590 cp%dof = cp%no_controlfunctions * cp%dim
593 if (cp%dof <= 0)
then
594 write(
message(1),
'(a)')
'The number of degrees of freedom used to describe the control function'
595 write(
message(2),
'(a)')
'is less than or equal to zero. This should not happen. Please review your input file.'
598 if (cf_common%representation /= ctr_internal)
then
599 write(
message(1),
'(a,i6,a)')
'The parametrization of the control functions makes use of ', cp%dim,
' basis'
600 write(
message(2),
'(a,i6,a)')
'functions and ', cp%dof,
' degrees of freedom.'
602 safe_allocate(cp%theta(1:cp%dof))
629 assert(
associated(lasers))
631 select case (cf_common%mode)
633 do ipar = 1, cp%no_controlfunctions
668 if (abs(
cf_common%targetfluence) > m_epsilon)
then
669 if (
cf_common%targetfluence < m_zero)
then
671 write(message(1),
'(a)')
'Info: The QOCT run will attempt to find a solution with the same'
672 write(message(2),
'(a,f10.5,a)')
' fluence as the input external fields: F = ', &
675 write(message(1),
'(a)')
'Info: The QOCT run will attempt to find a solution with a predefined'
676 write(message(2),
'(a,f10.5,a)')
' fluence: F = ',
cf_common%targetfluence,
' a.u.'
678 call messages_info(2)
701 if (par%current_representation /=
cf_common%representation)
then
725 par%current_representation =
ctr_rt
728 do ipar = 1, par%no_controlfunctions
729 call tdf_numerical_to_fourier(par%f(ipar))
734 do ipar = 1, par%no_controlfunctions
735 call tdf_numerical_to_zerofourier(par%f(ipar))
740 do ipar = 1, par%no_controlfunctions
741 call tdf_numerical_to_fourier(par%f(ipar))
746 do ipar = 1, par%no_controlfunctions
747 call tdf_numerical_to_zerofourier(par%f(ipar))
767 select case (par%current_representation)
773 do ipar = 1, par%no_controlfunctions
774 call tdf_fourier_to_numerical(par%f(ipar))
778 do ipar = 1, par%no_controlfunctions
779 call tdf_zerofourier_to_numerical(par%f(ipar))
783 do ipar = 1, par%no_controlfunctions
784 call tdf_fourier_to_numerical(par%f(ipar))
788 do ipar = 1, par%no_controlfunctions
789 call tdf_zerofourier_to_numerical(par%f(ipar))
809 assert(pp%current_representation == qq%current_representation)
812 do ipar = 1, pp%no_controlfunctions
813 res = res + tdf_diff(pp%f(ipar), qq%f(ipar))
824 integer :: ipar, iter
831 do ipar = 1, cp%no_controlfunctions
832 do iter = 1, tdf_niter(cp%f(ipar)) + 1
833 call tdf_set_numerical(cp%f(ipar), iter, tdf(cp%f(ipar), iter) / tdf(
cf_common%td_penalty(ipar), iter))
847 type(partner_list_t),
intent(in) :: ext_partners
851 type(lasers_t),
pointer :: lasers
858 lasers => list_get_lasers(ext_partners)
859 assert(
associated(lasers))
863 do ipar = 1, cp%no_controlfunctions
864 call laser_set_f(lasers%lasers(ipar), par%f(ipar))
878 type(partner_list_t),
intent(in) :: ext_partners
879 integer,
intent(in) :: val
882 type(lasers_t),
pointer :: lasers
886 lasers => list_get_lasers(ext_partners)
887 assert(
associated(lasers))
889 do ipar = 1, cp%no_controlfunctions
890 call laser_set_f_value(lasers%lasers(ipar), val, tdf(cp%f(ipar), val))
905 if (
allocated(cp%f))
then
906 do ipar = 1, cp%no_controlfunctions
907 call tdf_end(cp%f(ipar))
910 safe_deallocate_a(cp%f)
911 safe_deallocate_a(cp%alpha)
912 safe_deallocate_a(cp%u)
913 safe_deallocate_a(cp%utransf)
914 safe_deallocate_a(cp%utransfi)
915 safe_deallocate_a(cp%theta)
924 character(len=*),
intent(in) :: filename
926 type(namespace_t),
intent(in) :: namespace
928 integer :: iter, ipar, ifreq, iunit, niter, nfreqs, idof
929 real(real64) :: time, wmax, dw, ww, wa, wb, dt
930 real(real64),
allocatable ::
func(:, :)
931 complex(real64) :: ft, ez, ezdt
932 character(len=2) :: digit
935 if (.not. mpi_grp_is_root(mpi_world))
return
939 call io_mkdir(trim(filename), namespace)
944 iunit = io_open(trim(filename)//
'/Fluence', namespace, action=
'write')
948 niter = tdf_niter(par%f(1))
949 safe_allocate(
func(1:niter + 1, 1:cp%no_controlfunctions))
954 do ipar = 1, cp%no_controlfunctions
955 if (cp%no_controlfunctions > 1)
then
956 write(digit,
'(i2.2)') ipar
957 iunit = io_open(trim(filename)//
'/cp-'//digit, namespace, action=
'write')
959 iunit = io_open(trim(filename)//
'/cp', namespace, action=
'write')
961 write(iunit,
'(2a20)')
'# t [a.u] ',
' e(t) '
962 do iter = 1, tdf_niter(par%f(ipar)) + 1
963 time = (iter - 1) * tdf_dt(par%f(ipar))
964 write(iunit,
'(2es20.8e3)') time, tdf(par%f(ipar), iter)
965 func(iter, ipar) = tdf(par%f(ipar), time)
972 do ipar = 1, cp%no_controlfunctions
973 if (cp%no_controlfunctions > 1)
then
974 write(digit,
'(i2.2)') ipar
975 iunit = io_open(trim(filename)//
'/cp-'//digit, namespace, action=
'write')
977 iunit = io_open(trim(filename)//
'/cp', namespace, action=
'write')
979 write(iunit,
'(3a20)')
'# t [a.u] ',
' e(t) ',
' f(t) '
980 do iter = 1, tdf_niter(par%f(ipar)) + 1
981 time = (iter - 1) * tdf_dt(par%f(ipar))
982 write(iunit,
'(3es20.8e3)') time, tdf(par%f(ipar), time) *
cos(par%w0 * time), tdf(par%f(ipar), time)
983 func(iter, ipar) = tdf(par%f(ipar), time) *
cos(par%w0 * time)
995 do ipar = 1, cp%no_controlfunctions
996 if (cp%no_controlfunctions > 1)
then
997 write(digit,
'(i2.2)') ipar
998 iunit = io_open(trim(filename)//
'/cpw-'//digit, namespace, action=
'write')
1000 iunit = io_open(trim(filename)//
'/cpw', namespace, action=
'write')
1002 write(iunit,
'(3a20)')
'# w [a.u] ',
' Re[e(w)] ', &
1009 dw = wmax / (nfreqs - 1)
1010 dt = tdf_dt(par%f(1))
1012 do ifreq = 1, nfreqs
1013 ww = wa + (ifreq - 1) * dw
1016 ezdt =
exp(m_zi * ww * tdf_dt(par%f(ipar)))
1017 do iter = 1, niter + 1
1018 time = (iter - 1) * dt
1019 ft = ft +
func(iter, ipar) * ez
1023 write(iunit,
'(3es20.8e3)') ww, real(ft, real64) , aimag(ft)
1025 call io_close(iunit)
1030 iunit = io_open(trim(filename)//
'/cpw', namespace, action=
'write')
1031 write(iunit,
'(3a20)')
'# w [a.u] ',
' Re[e(w)] ', &
1035 wa = cp%w0 - m_three *
cf_common%omegamax
1036 wb = cp%w0 + m_three *
cf_common%omegamax
1038 dw = wmax/(nfreqs-1)
1039 dt = tdf_dt(par%f(1))
1041 do ifreq = 1, nfreqs
1042 ww = wa + (ifreq - 1) * dw
1045 ezdt =
exp(m_zi * ww * tdf_dt(par%f(1)))
1046 do iter = 1, niter + 1
1047 time = (iter - 1) * dt
1048 ft = ft +
func(iter, 1) * ez
1052 write(iunit,
'(3es20.8e3)') ww, real(ft, real64) , aimag(ft)
1055 call io_close(iunit)
1060 iunit = io_open(trim(filename)//
'/theta', namespace, action=
'write')
1061 do idof = 1, par%dof
1062 write(iunit,
'(i5,es20.8e3)') idof, par%theta(idof)
1064 call io_close(iunit)
1091 do ipar = 1, par_%no_controlfunctions
1095 do ipar = 1, par%no_controlfunctions
1097 call tdf_copy(ff, par_%f(ipar))
1098 call tdf_cosine_multiply(par%w0, ff)
1117 integer :: iter, ipar
1118 real(real64) :: time, integral, fi, tdp
1123 assert(par%current_representation ==
cf_common%representation)
1131 do ipar = 1, par_%no_controlfunctions
1133 call tdf_copy(ff, par_%f(ipar))
1134 do iter = 1, tdf_niter(ff) + 1
1135 time = (iter - 1) * tdf_dt(ff)
1136 fi = tdf(par_%f(ipar), iter)
1137 tdp =
sqrt(real(tdf(
cf_common%td_penalty(ipar), iter), real64))
1138 call tdf_set_numerical(ff, iter, fi * tdp)
1140 integral = integral + tdf_dot_product(ff, ff)
1144 do ipar = 1, par_%no_controlfunctions
1146 call tdf_copy(ff, par_%f(ipar))
1147 do iter = 1, tdf_niter(ff) + 1
1148 time = (iter - 1) * tdf_dt(ff)
1149 fi = tdf(par_%f(ipar), iter)
1150 tdp =
sqrt(real(tdf(
cf_common%td_penalty(ipar), iter), real64))
1151 call tdf_set_numerical(ff, iter, fi * tdp *
cos(par_%w0 * time))
1153 integral = integral + tdf_dot_product(ff, ff)
1158 j2 = - par_%alpha(1) * (integral -
cf_common%targetfluence)
1169 real(real64) :: old_fluence
1176 do ipar = 1, par%no_controlfunctions
1177 call tdf_scalar_multiply(
sqrt(
cf_common%targetfluence / old_fluence), par%f(ipar))
1190 real(real64),
intent(in) :: alpha
1194 par%alpha(:) = alpha
1212 cp_out%no_controlfunctions = cp_in%no_controlfunctions
1213 cp_out%dim = cp_in%dim
1214 cp_out%dof = cp_in%dof
1215 cp_out%current_representation = cp_in%current_representation
1216 cp_out%w0 = cp_in%w0
1218 safe_allocate_source_a(cp_out%alpha, cp_in%alpha)
1219 safe_allocate(cp_out%f(1:cp_out%no_controlfunctions))
1221 do ipar = 1, cp_in%no_controlfunctions
1222 call tdf_init(cp_out%f(ipar))
1223 call tdf_copy(cp_out%f(ipar), cp_in%f(ipar))
1226 safe_allocate_source_a(cp_out%u, cp_in%u)
1227 safe_allocate_source_a(cp_out%utransf, cp_in%utransf)
1228 safe_allocate_source_a(cp_out%utransfi, cp_in%utransfi)
1229 safe_allocate_source_a(cp_out%theta, cp_in%theta)
1248 do ipar = 1, par%no_controlfunctions
1249 call tdf_set_random(par%f(ipar))
1264 character(len=1),
intent(in) :: dir
1265 integer,
intent(in) :: iter
1266 real(real64),
intent(in) :: mu
1267 real(real64),
intent(in) :: dd(:)
1268 complex(real64),
intent(in) :: dq(:)
1277 do ipar = 1, cp%no_controlfunctions
1278 val = dd(ipar) / ( tdf(
cf_common%td_penalty(ipar), iter) - m_two * aimag(dq(ipar)))
1279 val = (m_one - mu) * tdf(cpp%f(ipar), iter) + mu * val
1280 call tdf_set_numerical(cp%f(ipar), iter, val)
1281 if (iter + 1 <= tdf_niter(cp%f(ipar)) + 1)
call tdf_set_numerical(cp%f(ipar), iter+1, val)
1282 if (iter + 2 <= tdf_niter(cp%f(ipar)) + 1)
call tdf_set_numerical(cp%f(ipar), iter+2, val)
1286 do ipar = 1, cp%no_controlfunctions
1287 val = dd(ipar) / ( tdf(
cf_common%td_penalty(ipar), iter + 1) - m_two * aimag(dq(ipar)))
1288 val = (m_one - mu) * tdf(cpp%f(ipar), iter + 1) + mu * val
1289 call tdf_set_numerical(cp%f(ipar), iter + 1, val)
1290 if (iter > 0)
call tdf_set_numerical(cp%f(ipar), iter, val)
1291 if (iter - 1 > 0)
call tdf_set_numerical(cp%f(ipar), iter-1, val)
1303 integer,
intent(in) :: ipar
1327 real(real64),
intent(out) :: lower_bounds(:)
1328 real(real64),
intent(out) :: upper_bounds(:)
1334 lower_bounds(1:par%dof-1) = m_zero
1335 lower_bounds(par%dof) = -m_pi
1336 upper_bounds(1:par%dof) = m_pi
1338 lower_bounds = -huge(m_zero)
1339 lower_bounds = -huge(m_zero)
1340 upper_bounds = huge(m_zero)
1341 upper_bounds = huge(m_zero)
1368 type(filter_t),
intent(inout) :: filter
1376 do ipar = 1, par%no_controlfunctions
1377 call filter_apply(par%f(ipar), filter)
1394 message(1) =
"Internal error: Cannot call controlfunction_mod_close when not initialized."
1395 call messages_fatal(1)
1401 do ipar = 1,
cf_common%no_controlfunctions
1402 call tdf_end(
cf_common%td_penalty(ipar))
1415 real(real64),
intent(inout) :: dedu(:, :)
1419 real(real64),
allocatable :: grad_matrix(:, :), dedv(:, :)
1426 dedu = diagonal_matrix(par%dim, m_one)
1429 safe_allocate(grad_matrix(1:par%dim - 1, 1:par%dim))
1431 call hypersphere_grad_matrix(grad_matrix, rr, par%theta)
1432 dedu = matmul(grad_matrix, transpose(par%utransfi))
1433 safe_deallocate_a(grad_matrix)
1436 safe_allocate(dedv(1:par%dim-1, 1:par%dim))
1438 do i = 1, (par%dim-1)/2
1439 dedv(i, 1) = - m_one
1440 dedv(i, i+1) = m_one
1442 do i = (par%dim-1)/2+1, par%dim-1
1443 dedv(i, i+1) = m_one
1445 safe_allocate(grad_matrix(1:par%dim - 2, 1:par%dim - 1))
1447 call hypersphere_grad_matrix(grad_matrix, rr, par%theta)
1448 dedu = matmul(grad_matrix, matmul(transpose(par%utransfi), dedv))
1449 safe_deallocate_a(grad_matrix)
1450 safe_deallocate_a(dedv)
1453 dedu = diagonal_matrix(par%dim, m_one)
1458 dedu(i, 1) = - m_one
1459 dedu(i, i+1) = m_one
1461 do i = par%dof/2+1, par%dof
1462 dedu(i, i+1) = m_one
1476 type(tdf_t),
intent(inout) :: depsilon
1477 integer,
intent(in) :: i
1479 real(real64),
allocatable :: dedu(:, :)
1481 assert( i > 0 .and. i <= par%dof)
1483 safe_allocate(dedu(1:par%dof, 1:par%dim))
1485 call tdf_set_numerical(depsilon, dedu(i, 1:par%dim))
1486 call tdf_to_numerical(depsilon)
1489 safe_deallocate_a(dedu)
1498 real(real64),
intent(inout) :: grad(:)
1501 type(tdf_t) :: depsilon
1504 select case (par%current_representation)
1509 - par%u(jj, 1) * tdf(par_output%f(1), jj)
1513 call tdf_copy(depsilon, par%f(1))
1516 - tdf_dot_product(par_output%f(1), depsilon)
1517 call tdf_end(depsilon)
1522 call tdf_copy(depsilon, par%f(1))
1524 grad(jj) = - tdf_dot_product(par_output%f(1), depsilon)
1525 call tdf_end(depsilon)
1534#include "controlfunction_trans_inc.F90"
double exp(double __x) __attribute__((__nothrow__
double sqrt(double __x) __attribute__((__nothrow__
double cos(double __x) __attribute__((__nothrow__
real(real64) function func(r1, rn, n, a)
This module contains the definition of the data type that holds a "control function" used for OCT run...
integer, parameter, public ctr_fourier_series
integer, parameter, public controlfunction_mode_f
subroutine, public controlfunction_filter(par, filter)
real(real64) function, public controlfunction_diff(pp, qq)
subroutine, public controlfunction_gradient(par, par_output, grad)
controlfunction_gradient computes the (minus the) gradient of the J functional with respect to the pa...
subroutine, public controlfunction_apply_envelope(cp)
subroutine, public controlfunction_set_fluence(par)
subroutine, public controlfunction_bounds(par, lower_bounds, upper_bounds)
subroutine, public controlfunction_to_h_val(cp, ext_partners, val)
subroutine, public controlfunction_to_realtime(par)
subroutine controlfunction_trans_matrix(par)
integer, parameter, public ctr_internal
integer pure function, public controlfunction_dof(par)
real(real64) function, public controlfunction_fluence(par)
subroutine controlfunction_deltaedeltau(par, dedu)
integer, parameter, public ctr_fourier_series_h
subroutine, public controlfunction_set_theta(par, theta)
subroutine controlfunction_basis_to_theta(par)
subroutine, public controlfunction_set_alpha(par, alpha)
subroutine, public controlfunction_write(filename, cp, namespace)
subroutine, public controlfunction_prepare_initial(par)
"Prepares" the initial guess control field: maybe it has to be normalized to a certain fluence,...
integer pure function, public controlfunction_representation()
Returns the representation type for the control functions used in the OCT run.
real(real64) pure function, public controlfunction_w0(par)
integer, parameter, public ctr_rt
subroutine, public controlfunction_update(cp, cpp, dir, iter, mu, dd, dq)
Update the control function(s) given in "cp", according to the formula cp = (1 - mu) * cpp + mu * dd ...
integer, parameter, public ctr_zero_fourier_series_h
subroutine, public controlfunction_end(cp)
integer, parameter, public ctr_zero_fourier_series
integer, parameter, public controlfunction_mode_epsilon
subroutine, public controlfunction_get_theta(par, theta)
real(real64) function, public controlfunction_j2(par)
subroutine, public controlfunction_randomize(par)
real(real64) pure function, public controlfunction_alpha(par, ipar)
integer pure function, public controlfunction_number(par)
real(real64) pure function, public controlfunction_targetfluence()
subroutine, public controlfunction_copy(cp_out, cp_in)
subroutine, public controlfunction_set_rep(par)
Transforms the control function to frequency space, if this is the space in which the functions are d...
subroutine, public controlfunction_mod_close()
subroutine, public controlfunction_to_h(cp, ext_partners)
logical cf_common_initialized
integer pure function, public controlfunction_mode()
Returns the "mode" of the control function, i.e. if it is the full pulse, the envelope,...
subroutine controlfunction_theta_to_basis(par)
subroutine controlfunction_der(par, depsilon, i)
controlfunction_der computes the derivative of a controlfunction with respect to one of its degrees o...
subroutine, public controlfunction_to_basis(par)
subroutine, public controlfunction_init(cp, dt, ntiter)
Before using an controlfunction_t variable, it needs to be initialized, either by calling controlfunc...
subroutine, public controlfunction_mod_init(ext_partners, namespace, dt, max_iter, mode_fixed_fluence)
Initializes the module, should be the first subroutine to be called (the last one should be controlfu...
type(controlfunction_common_t) cf_common
subroutine, public controlfunction_set(cp, ext_partners)
The external fields defined in epot_t "ep" are transferred to the control functions described in "cp"...
type(lasers_t) function, pointer, public list_get_lasers(partners)
real(real64), parameter, public m_zero
real(real64), parameter, public m_epsilon
real(real64), parameter, public m_one
This module defines classes and functions for interaction partners.
complex(real64) function, dimension(3), public laser_polarization(laser)
subroutine, public laser_to_numerical_all(laser, dt, max_iter, omegamax)
The td functions that describe the laser field are transformed to a "numerical" representation (i....
subroutine, public laser_get_f(laser, ff)
real(real64) function, public laser_carrier_frequency(laser)
subroutine, public laser_to_numerical(laser, dt, max_iter, omegamax)
The td functions that describe the laser field are transformed to a "numerical" representation (i....
This module is intended to contain "only mathematical" functions and procedures.
subroutine, public messages_print_with_emphasis(msg, iunit, namespace)
character(len=512), private msg
subroutine, public messages_obsolete_variable(namespace, name, rep)
subroutine, public messages_info(no_lines, iunit, verbose_limit, stress, all_nodes, namespace)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public messages_input_error(namespace, var, details, row, column)
subroutine, public messages_experimental(name, namespace)
integer function, public parse_block(namespace, name, blk, check_varinfo_)
integer pure function, public tdf_nfreqs(f)
subroutine, public tdf_end(f)
subroutine, public tdf_init_numerical(f, niter, dt, omegamax, initval, rep)
subroutine, public tdf_to_numerical(f, niter, dt, omegamax)
subroutine, public tdf_read(f, namespace, function_name, ierr)
This function initializes "f" from the TDFunctions block.
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
character(len=20) pure function, public units_abbrev(this)
This module defines the unit system, used for input and output.
type(unit_system_t), public units_out
This data type contains information that is filled when the module is initialized ("controlfunction_m...
This is the data type used to hold a control function.