paraqeet.measurement.goat_over_grape.GOATOverGRAPE#
- class paraqeet.measurement.goat_over_grape.GOATOverGRAPE(measurement, propagation, generators)#
Bases:
NormalizableMeasurement,DifferentiableCombine GRAPE propagation with analytic gradients of GOAT via chain rule.
- Parameters:
measurement (StateTransferFidelityGRAPE) – A StateTransferFidelityGRAPE measurement.
propagation (DifferentiablePropagation) – Propagation method used for the optimization. Used to determine the time grid.
generators (PWCGenerator | list[PWCGenerator]) – A PWCGenerator or a list of PWCGenerators that are used for propagation.
- __init__(measurement, propagation, generators)#
- Parameters:
measurement (StateTransferFidelityGRAPE)
propagation (DifferentiablePropagation)
generators (PWCGenerator | list[PWCGenerator])
Methods
__init__(measurement, propagation, generators)calculate_normalized_scalar(times)Passthrough the measurement.
get_value_and_gradient(times)Compute gradients with GRAPE and use the chain rule to provide the gradients for the optimizer.
measure(times)Sum of plain weighted measurements.
- calculate_normalized_scalar(times)#
Passthrough the measurement.
- Returns:
Returns the normalized weighted sum.
- Return type:
Array
- Parameters:
times (Array | float)
- get_value_and_gradient(times)#
Compute gradients with GRAPE and use the chain rule to provide the gradients for the optimizer.
- Returns:
Array – Function value.
Array – Gradients.
- Parameters:
times (Array)
- Return type:
tuple[Array, Array] | tuple[float, Array]
- measure(times)#
Sum of plain weighted measurements.
- Returns:
Returns the plain weighted sum.
- Return type:
Array
- Parameters:
times (Array)