krotov.result module¶
Reference¶
-
class
krotov.result.Result[source]¶ Bases:
objectResult 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.targetcontains 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_controlsType: list[numpy.ndarray]
-
controls_mapping¶ A nested list that indicates where in
objectivestheguess_controlsandoptimized_controlsare 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=FalseType: 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_strandend_local_time_str
-
start_local_time_str¶ The
start_local_timeattribute formatted as a string
-
end_local_time_str¶ The
end_local_timeattribute formatted as a string
-
optimized_objectives¶ A copy of the
objectiveswith theoptimized_controlsplugged inType: list[Objective]
-
classmethod
load(filename, objectives=None)[source]¶ Construct
Resultobject 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
Resultfrom the given filename, overwriteobjectiveswith the given objectives. This is necessary becausedump()does not preserve time-dependent controls that are Python functions.
Returns: The
Resultinstance loaded from filenameReturn type: - filename (str) – The file from which to load the
-
dump(filename)[source]¶ Dump the
Resultto a binarypicklefile.The original
Resultobject 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.
-