OptimizationApplication#

class OptimizationApplication[fuente]#

Bases: ABC

An abstract class for optimization applications.

Methods

abstract interpret(result)[fuente]#

Convert the calculation result of the problem (OptimizationResult or a binary array using np.ndarray) to the answer of the problem in an easy-to-understand format.

Parámetros:

result (OptimizationResult | ndarray) – The calculated result of the problem

static sample_most_likely(state_vector)[fuente]#

Compute the most likely binary string from state vector.

Parámetros:

state_vector (QuasiDistribution | Statevector | ndarray | Dict) – state vector or counts or quasi-probabilities.

Devuelve:

binary string as numpy.ndarray of ints.

Muestra:

ValueError – if state_vector is not QuasiDistribution, Statevector, np.ndarray, or dict.

Tipo del valor devuelto:

ndarray

abstract to_quadratic_program()[fuente]#

Convert a problem instance into a QuadraticProgram

Tipo del valor devuelto:

QuadraticProgram