qilisdk.cost_functions.cost_function

Classes

CostFunction

Abstract base class that maps a FunctionalResult into a scalar cost.

Module Contents

class CostFunction[fuente]

Bases: abc.ABC

Abstract base class that maps a FunctionalResult into a scalar cost.

Subclasses must implement compute_cost() to define how a FunctionalResult is reduced to a single numeric value. This value is typically consumed by an optimiser inside a VariationalProgram.

abstractmethod compute_cost(results: qilisdk.functionals.functional_result.FunctionalResult) qilisdk.core.types.Number[fuente]

Compute a scalar cost from functional execution results.

Parámetros:

results (FunctionalResult) – Output of executing a Functional (e.g. a DigitalPropagation or AnalogEvolution).

Devuelve:

Scalar cost extracted from the results.

Tipo del valor devuelto:

Number