paraqeet.measurement.state_transfer_fidelity.StateTransferFidelityAD#
- class paraqeet.measurement.state_transfer_fidelity.StateTransferFidelityAD(propagation, initial_state, target_state)#
Bases:
StateTransferFidelityFidelity measure that compares overlap of the initial and final state.
- Parameters:
propagation (Propagation) – Abstract base class for any implementation that can solve the equation of motion.
initial_state (Array) – Initial state.
target_state (Array) – Target state.
times (Array) – One-dimensional vector of timestamps.
- __init__(propagation, initial_state, target_state)#
- Parameters:
propagation (DifferentiablePropagation)
initial_state (Array)
target_state (Array)
Methods
__init__(propagation, initial_state, ...)calculate_normalized_scalar(times)Measure overlap between initial and target state.
get_value_and_gradient(times)Measure with gradient.
measure(times)Return measurement in the range [0, 1].
- calculate_normalized_scalar(times)#
Measure overlap between initial and target state. To be used with an optimizer.
- Parameters:
times (Array) – One-dimensional vector of timestamps.
- Returns:
Overlap between initial and target state in a bare float.
- Return type:
float
- get_value_and_gradient(times)#
Measure with gradient.
Overwrite inherited measure_with_gradient to calculate gradients using AD.
- Returns:
Tuple of function value and gradient of shape (n_parameters,).
- Return type:
Tuple[float, Array]
- Parameters:
times (Array)
- measure(times)#
Return measurement in the range [0, 1].
- Parameters:
times (Array)
- Return type:
Array | float