paraqeet.measurement.goat_over_grape.GOATOverGRAPE#

class paraqeet.measurement.goat_over_grape.GOATOverGRAPE(measurement, propagation, generators)[source]#

Bases: NormalizableMeasurement, Differentiable

Combine GRAPE propagation with analytic gradients of GOAT via chain rule.

Parameters:
__init__(measurement, propagation, generators)[source]#
Parameters:

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)[source]#

Passthrough the measurement.

Returns:

Returns the normalized weighted sum.

Return type:

Array

Parameters:

times (Array | float)

get_value_and_gradient(times)[source]#

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)[source]#

Sum of plain weighted measurements.

Returns:

Returns the plain weighted sum.

Return type:

Array

Parameters:

times (Array)