NumberPartition#
- class NumberPartition(number_set)[fuente]#
Bases:
OptimizationApplication
Optimization application for the «number partition» [1] problem.
Referencias
[1]: «Partition problem», https://en.wikipedia.org/wiki/Partition_problem
Methods
- interpret(result)[fuente]#
Interpret a result as a list of subsets
- Parámetros:
result (OptimizationResult | ndarray) – The calculated result of the problem
- Devuelve:
A list of subsets whose sum is the half of the total.
- Tipo del valor devuelto:
- static sample_most_likely(state_vector)#
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: