Result ¶
A result object can be understood as a solution with only one sample.
It can be obtained by calling model.evaluate_sample for a single sample.
Most properties available for the solution object are also available for a result, but in the singular form. For example, you can call solution.obj_values, but result.obj_value.
Examples:
>>> from luna_quantum import Model, Result, Solution
>>> model: Model = ...
>>> solution: Solution = ...
>>> sample = solution.samples[0]
>>> result = model.evaluate_sample(sample)
>>> result.obj_value
-109.42
>>> result.sample
[0, -5, 0.28]
>>> result.constraints
[True, False]
>>> result.feasible
False
constraints property ¶
Get this result's feasibility values of all constraints. Note that results.constraints[i] iff. model.constraints[i] is feasible for this result.
feasible property ¶
Return whether all constraint results are feasible for this result.
variable_bounds property ¶
Get this result's feasibility values of all variable bounds.