@@ -7,7 +7,7 @@ using Printf
77using LinearAlgebra
88
99using QuantumControl. Controls: get_controls, discretize, discretize_on_midpoints
10- using QuantumControl: Objective , ControlProblem
10+ using QuantumControl: Trajectory , ControlProblem
1111import QuantumControl
1212
1313using .. RandomObjects: random_matrix, random_state_vector
@@ -17,7 +17,7 @@ using ..RandomObjects: random_matrix, random_state_vector
1717
1818```julia
1919problem = dummy_control_problem(;
20- N=10, n_objectives =1, n_controls=1, n_steps=50, dt=1.0, density=0.5,
20+ N=10, n_trajectories =1, n_controls=1, n_steps=50, dt=1.0, density=0.5,
2121 complex_operators=true, hermitian=true, pulses_as_controls=false, rng,
2222 kwargs...)
2323```
@@ -27,8 +27,9 @@ Sets up a control problem with random (sparse) Hermitian matrices.
2727# Arguments
2828
2929* `N`: The dimension of the Hilbert space
30- * `n_objectives`: The number of objectives in the optimization. All objectives
31- will have the same Hamiltonian, but random initial and target states.
30+ * `n_trajectories`: The number of trajectories in the optimization. All
31+ trajectories will have the same Hamiltonian, but random initial and target
32+ states.
3233* `n_controls`: The number of controls, that is, the number of control terms in
3334 the control Hamiltonian. Each control is an array of random values,
3435 normalized on the intervals of the time grid.
@@ -50,7 +51,7 @@ Sets up a control problem with random (sparse) Hermitian matrices.
5051"""
5152function dummy_control_problem (;
5253 N= 10 ,
53- n_objectives = 1 ,
54+ n_trajectories = 1 ,
5455 n_controls= 1 ,
5556 n_steps= 50 ,
5657 dt= 1.0 ,
@@ -83,22 +84,22 @@ function dummy_control_problem(;
8384 push! (hamiltonian, (H_c, control))
8485 end
8586
86- objectives = [
87- Objective (;
88- initial_state = random_state_vector (N; rng),
89- generator = tuple (hamiltonian... ),
87+ trajectories = [
88+ Trajectory (
89+ random_state_vector (N; rng),
90+ tuple (hamiltonian... );
9091 target_state= random_state_vector (N; rng)
91- ) for k = 1 : n_objectives
92+ ) for k = 1 : n_trajectories
9293 ]
9394
94- return ControlProblem (;
95- objectives= objectives,
95+ return ControlProblem (
96+ trajectories,
97+ tlist;
9698 pulse_options= Dict (
9799 control => Dict (:lambda_a => 1.0 , :update_shape => t -> 1.0 ) for
98100 control in controls
99101 ),
100102 prop_method,
101- tlist,
102103 kwargs...
103104 )
104105end
@@ -119,7 +120,7 @@ mutable struct DummyOptimizationResult
119120
120121 function DummyOptimizationResult (problem)
121122 tlist = problem. tlist
122- controls = get_controls (problem. objectives )
123+ controls = get_controls (problem. trajectories )
123124 iter_start = get (problem. kwargs, :iter_start , 0 )
124125 iter = iter_start
125126 iter_stop = get (problem. kwargs, :iter_stop , 20 )
@@ -146,8 +147,8 @@ mutable struct DummyOptimizationResult
146147end
147148
148149struct DummyOptimizationWrk
149- objectives
150- adjoint_objectives
150+ trajectories
151+ adjoint_trajectories
151152 kwargs
152153 controls
153154 pulses0:: Vector{Vector{Float64}}
157158
158159
159160function DummyOptimizationWrk (problem)
160- objectives = [obj for obj in problem. objectives ]
161- adjoint_objectives = [adjoint (obj ) for obj in problem. objectives ]
162- controls = get_controls (objectives )
161+ trajectories = [traj for traj in problem. trajectories ]
162+ adjoint_trajectories = [adjoint (traj ) for traj in problem. trajectories ]
163+ controls = get_controls (trajectories )
163164 kwargs = Dict (problem. kwargs)
164165 tlist = problem. tlist
165166 if haskey (kwargs, :continue_from )
@@ -180,8 +181,8 @@ function DummyOptimizationWrk(problem)
180181 end
181182 pulses1 = [copy (pulse) for pulse in pulses0]
182183 return DummyOptimizationWrk (
183- objectives ,
184- adjoint_objectives ,
184+ trajectories ,
185+ adjoint_trajectories ,
185186 kwargs,
186187 controls,
187188 pulses0,
0 commit comments