Config File¶
Structure¶
The purpose of the configuration file is to provide a description of the entire physical model and its numerical representation, as well as parameters governing the propagation and optimization. It consists of Sections, where each section contains either a list of key-value pairs directly, or a list of lines, where each line contains a list of key-value pairs.
An example for the former is
oct: type = krotovpk, iter_stop = 20, max_megs = 1000, continue = false
Here, oct
is the section name, and it directly contains they
key-value pairs ("type", "krotovpk")
, ("iter_stop", 20)
,
("max_megs, 1000)
, and ("continue", .false.)
. Sections that
contain key-value pairs direcly may only occur once in the config file.
An example for a section that contains lines of key-value pairs is
psi:
* type = gauss, r_0 = 0.0, k_0 = 0.0, width = 1.0, label = initial
* type = gauss, r_0 = 10.0, k_0 = 0.0, width = 1.0, label = target
The section name is psi
in this case, and the lines start with ’*’.
After the section title, there may be an arbitrary number of key-value
pairs, which are applied to all the following lines. For example,
pulse: type = gauss, t_FWHM = 1.8, E_0 = 1.0, w_L = 0.2, &
& oct_shape = flattop, ftrt = 0.2, oct_lambda_a = 100, &
& oct_increase_factor = 10
* id = 1, t_0 = 0, oct_outfile = pulse1.dat
* id = 2, t_0 = 2.5, oct_outfile = pulse2.dat
* id = 3, t_0 = 5, oct_outfile = pulse3.dat
is equivalent to
pulse:
* id = 1, t_0 = 0, oct_outfile = pulse1.dat, type = gauss, t_FWHM = 1.8, &
E_0 = 1.0, w_L = 0.2, oct_shape = flattop, ftrt = 0.2, &
oct_lambda_a = 100, oct_increase_factor = 10
* id = 2, t_0 = 2.5, oct_outfile = pulse2.dat, type = gauss, &
t_FWHM = 1.8, E_0 = 1.0, w_L = 0.2, oct_shape = flattop, ftrt = 0.2, &
oct_lambda_a = 100, oct_increase_factor = 10
* id = 3, t_0 = 5, oct_outfile = pulse3.dat, type = gauss, t_FWHM = 1.8, &
E_0 = 1.0, w_L = 0.2, oct_shape = flattop, ftrt = 0.2, &
oct_lambda_a = 100, oct_increase_factor = 10
This also opens up the possibility for having a section appear multiple times in the same config file. For example,
grid: label = initial
* dim = 1, rmin = -10 rmax = 10, n = 128, moveable = true
grid: label = target
* dim = 1, rmin = 0.078740157480315, rmax = 20.078740157480315, n = 128, &
moveable = true
is equivalent to
grid:
* dim = 1, rmin = -10 rmax = 10, n = 128, moveable = true, label = initial
* dim = 1, rmin = 0.078740157480315, rmax = 20.078740157480315, n = 128, &
moveable = true, label = target
Use of the ‘label’ keyword allows to define multiple instance of the
same type in the config file. That is, the init()
routine can be called multiple times for
different labels to initialize e.g. multiple wave functions.
The key-value pairs must comply with the following rules:
key and value are separated by ‘=’, with optional spaces around ‘=’, and different key-value pairs are separated by ‘,’
They values must be valid, strings, integers, floats, or logicals, as appropriate for the given key (see below)
string values may optionally be enclosed in quotes. The quotes are required if the string contains spaces, commas, or equal signs. Valid examples are
oct_outfile = "outfolder/my out file"
,method = cheby
, ormethod='cheby'
float values may be tagged with a unit, e.g.
rmin = 0.26_nm
,mass = 19.98_dalton
,E0 = 5.4_GHz
,beta = 0.8_unitless
. All real values are immediately converted to internal units by the parser, using QDYN’s unit system. It is strongly recommended to tag all values with a unit. Non-tagged values are not converted, and must therefore be compatible with the current internal-units system.logical values may be any of
true
,1
,.true.
,T
,false
,0
,.false.
,F
You may use comments in the config file, starting with an exclamation
mark (like in Fortran). Continued lines must end with &
.
User Parameters¶
A config file may contain any of the sections user_logicals
,
user_reals
, user_ints
, user_strings
to define allow for
arbitrary user-defined key-value pairs, e.g.
user_ints: n_qubit = 7, n_cavity = 70
user_logicals: prop_guess = F, dissipation = F
user_strings: gate = O_holonomic.dat, J_T = SM
user_reals: &
w_c = 8100.0_MHz, &
w_1 = 6850.0_MHz, &
w_2 = 7250.0_MHz, &
w_d = 8140.0_MHz, &
alpha_1 = -300.0_MHz, &
alpha_2 = -300.0_MHz, &
J = 0.0, &
g_1 = 70.0_MHz, &
g_2 = 70.0_MHz, &
w_chi = 1.0, &
n0_qubit = 0.0, &
n0_cavity = 0.0, &
gamma_1 = 0.0_MHz, &
gamma_2 = 0.0_MHz, &
kappa = 0.0_MHz
These user-defined values will be accessible to a program using the QDYN
library by using the get_user_para()
routine.
All other sections and the keys they allow directly mirror the
para_t
QDYN data structure.
Refcard¶
The following refcard gives a complete list of the available keys:
Sections¶
Beyond the sections for user-defined values, the following sections may appear in the config file: