krotov.result module¶
Reference¶
-
class
krotov.result.
Result
[source]¶ Bases:
object
Result object for a Krotov optimization
-
tlist
¶ The time grid values
Type: numpy.ndarray
-
iter_seconds
¶ for each iteration number, the number of seconds that were spent in the optimization
Type: list[int]
-
tau_vals
¶ for each iteration, a list of complex overlaps between the forward-propagated state and the target state for each objective, assuming
Objective.target
contains the target state.Type: list[list[complex]
-
guess_controls
¶ List of the guess controls in array format
Type: list[numpy.ndarray]
-
optimized_controls
¶ List of the optimized control fields, in the order corresponding to
guess_controls
Type: list[numpy.ndarray]
-
controls_mapping
¶ A nested list that indicates where in
objectives
theguess_controls
andoptimized_controls
are used (as returned byextract_controls_mapping()
)Type: list
-
all_pulses
¶ If the optimization was performed with
store_all_pulses=True
, for each iteration, a list of the optimized pulses (in the order corresponding toguess_controls
). These pulses are defined at midpoints of the tlist intervals. Empty list ifstore_all_pulses=False
Type: list
-
states
¶ for each objective, a list of states for each value in tlist, obtained from propagation under the final optimized control fields.
Type: list[list[qutip.Qobj]]
-
start_local_time
¶ Time stamp of when the optimization started
Type: time.struct_time
-
end_local_time
¶ Time stamp of when the optimization ended
Type: time.struct_time
-
message
¶ Description of why
optimize_pulses()
completed, E.g, “Reached 1000 iterations”Type: str
-
time_fmt
= '%Y-%m-%d %H:%M:%S'¶ Format used in
start_local_time_str
andend_local_time_str
-
start_local_time_str
¶ The
start_local_time
attribute formatted as a string
-
end_local_time_str
¶ The
end_local_time
attribute formatted as a string
-
optimized_objectives
¶ A copy of the
objectives
with theoptimized_controls
plugged inType: list[Objective]
-
classmethod
load
(filename, objectives=None)[source]¶ Construct
Result
object from adump()
fileParameters: - filename (str) – The file from which to load the
Result
. Must be in the format created bydump()
. - objectives (None or list[Objective]) – If given, after loading
Result
from the given filename, overwriteobjectives
with the given objectives. This is necessary becausedump()
does not preserve time-dependent controls that are Python functions.
Returns: The
Result
instance loaded from filenameReturn type: - filename (str) – The file from which to load the
-
dump
(filename)[source]¶ Dump the
Result
to a binarypickle
file.The original
Result
object can be restored from the resulting file usingload()
. However, time-dependent control fields that are callables/functions will not be preserved, as they are not “pickleable”.Parameters: filename (str) – Name of file to which to dump the Result
.
-