-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathconfig_template.cfg
More file actions
164 lines (161 loc) · 9.77 KB
/
config_template.cfg
File metadata and controls
164 lines (161 loc) · 9.77 KB
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
/* --------------------------------------------------------------- */
/* -------------------------- Testcase -------------------------- */
/* --------------------------------------------------------------- */
// Number of levels per subsystem
nlevels = 2, 2
// Number of essential levels per subsystem (Default: same as nlevels)
nessential = 2, 2
// Number of time steps used for time-integration
ntime = 1000
// Time step size (ns). Determines final time: T=ntime*dt
dt = 0.1
// Fundamental transition frequencies (|0> to |1> transition) for each oscillator ("\omega_k", multiplying a_k^d a_k, GHz)
transfreq = 4.10595, 4.81526
// Self-kerr frequencies for each oscillator ("\xi_k", multiplying a_k^d a_k^d a_k a_k, GHz)
selfkerr = 0.2198, 0.2252
// Cross-kerr coupling frequencies for each oscillator coupling k<->l ("\xi_kl", multiplying a_k^d a_k a_l^d a_l, GHz). Format: xi_01, xi_02, xi03, ... ,xi_12, xi_13, ...
crosskerr = 0.1
// Dipole-dipole coupling frequencies for each oscillator coupling k<->l ("J_kl", multiplying a_k^d a_l + a_k a_l^d, GHz). Format Jkl = J_01, J_02, ..., J12, J13, ...
Jkl = 0.0
// Rotational wave approximation frequencies for each subsystem ("\omega_rot", GHz). Note: The target gate rotation can be specified separately with option "gate_rot_freq", see below.
rotfreq = 4.10595, 4.81526
// Switch between Schroedinger and Lindblad solver. 'none' solves Schroedinger solver (state vector dynamics), all other options solve Lindblads master equation (density matrix dynamics)
collapse_type = none
#collapse_type = decay
#collapse_type = dephase
#collapse_type = both
// Time of decay collapse operation (T1) per oscillator (gamma_1 = 1/T_1) (for Lindblad solver)
decay_time = 0.0, 0.0
// Time of dephase collapse operation (T2) per oscillator (gamma_2 = 1/T_2) (for Lindblad solver)
dephase_time = 0.0, 0.0
// Specify the initial conditions that are to be propagated
// Available options and additional parameters:
// - basis: basis states for gate optimization [<osc_ID_i>, <osc_ID_j>, ...] (defaults to all oscillators)
// - file: read from file, <path/to/file>
// - pure: kronecker product of pure vectors, <state_osc_0>, ..., <state_osc_n>
// - diagonal: diagonal density basis matrices [<osc_ID_i>, <osc_ID_j>, ...] (defaults to all oscillators)
// - ensemble: ensemble state for unconditional pure-state preparation, [<osc_ID_i>, <osc_ID_j>, ...] (defaults to all oscillators) - Lindblad solver only
// - performance: test state for performance benchmarking (0 parameters)
// - 3states: three predefined density matrix states (0 parameters) - Lindblad solver only
// - Nplus1: N+1 basis states for gate optimization (0 parameters) - Lindblad solver only
initialcondition = basis
#initialcondition = file, <path/to/initial_condition.dat>
#initialcondition = pure, 1, 0
#initialcondition = diagonal, 0
#initialcondition = ensemble, 0
#initialcondition = 3states
#initialcondition = Nplus1
#initialcondition = performance
// Optional: Read system Hamiltonian from file (default: none - use built-in analytical Hamiltonian)
#hamiltonian_file_Hsys = /path/to/system_hamiltonian.dat
// Optional: Read control Hamiltonian from file (default: none - use built-in analytical Hamiltonian)
#hamiltonian_file_Hc = /path/to/control_hamiltonian.dat
/* --------------------------------------------------------------- */
/* ------------------- Optimization options ----------------------*/
/* --------------------------------------------------------------- */
// Define the controllable segments for each oscillator and the type of parameterization. Multiple segments can be listed behind each other, with corresponding starting and finish times.
// Format: <controltype>, <number of basis functions> [, <tstart>, <tstop>]
// Available control types: "spline" for 2nd order Bspline basis functions (recommended), "spline0" for piecewise constant control parameterization (aka 0th order Bspline basis functions),
// "spline_amplitude" for amplitude-only parameterization, "step" for step function control
control_segments0 = spline, 150
control_segments1 = spline, 150
# control_segments0 = spline0, 300
# control_segments0 = spline, 150, <tstart>, <tstop>
# control_segments0 = spline_amplitude, 150, 1.0
# control_segments0 = step, <amp1>, <amp2>, <tramp>
# control_segments0 = step, <amp1>, <amp2>, <tramp>, <tstart>, <tstop>
// Decide whether control pulses should start and end at zero. Default: true.
control_enforceBC=false
// Set the initial control pulse parameters (GHz). One option for each segmemt. Note: Reading the initialization from file applies to all subsystems, not just the one oscillator with that index, i.e. the file should contain all parameters for all oscillators in one long column.
control_initialization0 = constant, 0.005
control_initialization1 = constant, 0.005
#control_initialization0 = constant, 0.005
#control_initialization0 = random, 0.005
#control_initialization0 = file, ./params.dat
#control_initialization0 = constant, <amp_init>, <phase_init>
// Maximum amplitude bound for the control pulses for each oscillator (GHz). One value for each segment.
control_bounds0 = 0.008
control_bounds1 = 0.008
// Carrier wave frequencies for each oscillator 0..Q-1. (GHz)
carrier_frequency0 = 0.0, -0.2198, -0.1
carrier_frequency1 = 0.0, -0.2252, -0.1
// Optimization target
optim_target = gate, cnot
#optim_target = gate, cqnot
#optim_target = gate, swap
#optim_target = gate, swap0q
#optim_target = gate, qft
#optim_target = gate, xgate
#optim_target = gate, hadamard
#optim_target = gate, file, /path/to/target_gate.dat
#optim_target = pure, 0, 0
#optim_target = file, /path/to/target_state.dat
// Frequency of rotation of the target gate, for each oscillator (GHz). Default: 0.0
# gate_rot_freq = 0.0,0.0
// Objective function measure
optim_objective = Jtrace
# optim_objective = Jfrobenius
# optim_objective = Jmeasure
// Weights for summing up the objective function (beta_i). If less numbers than oscillators are given, the last one will e propagated to the remaining ones.
optim_weights = 1.0
# optim_weights = 0.5, 0.5
// Optimization stopping tolerance based on gradient norm (absolute: ||G|| < atol )
optim_atol = 1e-7
// Optimization stopping tolerance based on gradient norm (relative: ||G||/||G0|| < rtol )
optim_rtol = 1e-8
// Optimization stopping criterion based on the final time cost (absolute: J(T) < ftol)
optim_ftol = 1e-5
// Optimization stopping criterion based on the infidelity (absolute: 1-Favg < inf_tol)
optim_inftol = 1e-5
// Maximum number of optimization iterations
optim_maxiter = 200
// Coefficient (gamma_1) of Tikhonov regularization for the design variables (gamma_1/2 || design ||^2)
optim_regul = 0.00001
// Coefficient (gamma_2) for adding first integral penalty term (gamma_1 \int_0^T P(rho(t) dt )
optim_penalty = 0.0
// integral penalty parameter inside the weight in P(rho(t)) (gaussian variance a)
optim_penalty_param = 0.0
// Coefficient (gamma_3) for penalizing the integral of the second derivative of state populations (gamma_3 \int_0^T d^2/dt^2(Pop(rho)) dt )
optim_penalty_dpdm = 0.0
// Coefficient (gamma_4) for penalizing the control pulse energy integral (gamma_4 \int_0^T p^2 + q^2 dt )
optim_penalty_energy= 0.0
// Coefficient (gamma_5) for penalizing variations in control amplitudes. Only used for piece-wise constant control paramterizations (spline0)
optim_penalty_variation= 0.0
// Switch to use Tikhonov regularization with ||x - x_0||^2 instead of ||x||^2
optim_regul_tik0=false
/* --------------------------------------------------------------- */
/* ------------------- Output and runtypes ----------------------*/
/* --------------------------------------------------------------- */
// Directory for output files
datadir = ./data_out
// Specify the desired output for each oscillator, one line per oscillator. Format: list of either of the following options:
//"expectedEnergy" - time evolution of the expected energy level for this oscillator (expected energy of the reduced density matrix)
//"expectedEnergyComposite" - time evolution of expected energy level of the full-dimensional composite system
//"population" - time evolution of the energy level populations (probabilities) for this oscillator (diagonals of the reduced density matrix)
//"populationComposite" - time evolution of the energy level population (probabilities) for the full-dimensional composite system
//"fullstate" - time-evolution of the full state of the composite system (full density matrix, or state vector) (note: 'fullstate' can appear in *any* of the lines). WARNING: This might result in *huge* output files! Use with care.
output0 = population, expectedEnergy
output1 = population, expectedEnergy
// Output frequency in the time domain: write output every <num> time-step
output_frequency = 1
// Frequency of writing output during optimization: write output every <num> optimization iterations.
optim_monitor_frequency = 1
// Runtype options: a forward simulation only, forward simulation and backward simulation for gradient, or "optimization" to run a full optimization cycle
#runtype = simulation
#runtype = gradient
runtype = optimization
// Use matrix free solver, instead of sparse matrix implementation. Only available for 2,3,4, or 5 oscillators.
usematfree = true
// Solver type for solving the linear system at each time step
linearsolver_type = gmres
# linearsolver_type = neumann
// Set maximum number of iterations for the linear solver
linearsolver_maxiter = 20
// Switch the time-stepping algorithm. Currently available:
// "IMR" - Implicit Midpoint Rule (IMR) of 2nd order,
// "IMR4" - Compositional IMR of order 2 using 3 stages,
// "IMR8" - Compositional IMR of order 8 using 15 stages,
// "EE" - Explicit Euler (EE) of 1st order (for debugging only)
timestepper = IMR
// For reproducability, one can choose to set a fixed seed for the random number generator. Comment out, or set negative if seed should be random (non-reproducable)
rand_seed = 1234