ResultView ¶
A result view object serves as a view into one row of a solution object.
The Result class is readonly as it's merely a helper class for looking into a solution's row, i.e., a single sample and this sample's metadata.
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 ResultView, Solution
>>> solution: Solution = ...
>>> result: ResultView = solution[0]
>>> 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.
obj_value property ¶
Get the objective value of this sample if present. This is the value computed by the corresponding AqModel.
raw_energy property ¶
Get the raw energy returned by the algorithm if present. This value is not guaranteed to be accurate under consideration of the corresponding AqModel.
variable_bounds property ¶
Get this result's feasibility values of all variable bounds.