qiskit_addon_opt_mapper.applications.OptimizationApplication¶
- class OptimizationApplication[source]¶
Bases:
ABCAn abstract class for optimization applications.
- __init__()¶
Methods
__init__()interpret(result)Interpret the problem.
sample_most_likely(state_vector)Compute the most likely binary string from state vector.
Represent as an optimization problem.
- abstract interpret(result)[source]¶
Interpret the problem.
Convert the calculation result of the problem (
SolverResultor a binary array using np.ndarray) to the answer of the problem in an easy-to-understand format.- Parameters:
result (ndarray) – The calculated result of the problem
- static sample_most_likely(state_vector)[source]¶
Compute the most likely binary string from state vector.
- Parameters:
state_vector (QuasiDistribution | Statevector | ndarray | dict) – state vector or counts or quasi-probabilities.
- Returns:
binary string as numpy.ndarray of ints.
- Raises:
ValueError – if state_vector is not QuasiDistribution, Statevector, np.ndarray, or dict.
- Return type: