AnnealingQuantumTaskResult
- class braket.tasks.annealing_quantum_task_result.AnnealingQuantumTaskResult(record_array, variable_count, problem_type, task_metadata, additional_metadata)[source]
Bases:
objectResult of an annealing problem quantum task execution. This class is intended to be initialized by a QuantumTask class.
- Parameters:
record_array (
recarray) – numpy array with keys ‘solution’ (np.ndarray) where row is solution, column is value of the variable, ‘solution_count’ (numpy.ndarray) the number of times the solutions occurred, and ‘value’ (numpy.ndarray) the output or energy of the solutions.variable_count (
int) – the number of variablesproblem_type (
ProblemType) – the type of annealing problemtask_metadata (
TaskMetadata) – Quantum task metadata.additional_metadata (
AdditionalMetadata) – Additional metadata about the quantum task
- record_array: recarray
- variable_count: int
- problem_type: ProblemType
- task_metadata: TaskMetadata
- additional_metadata: AdditionalMetadata
- data(selected_fields=None, sorted_by='value', reverse=False)[source]
Yields the data in record_array
- Parameters:
selected_fields (
list[str] |None) – selected fields to return. Options are ‘solution’, ‘value’, and ‘solution_count’. Default is None.sorted_by (
str) – Sorts the data by this field. Options are ‘solution’, ‘value’, and ‘solution_count’. Default is ‘value’.reverse (
bool) – If True, returns the data in reverse order. Default is False.
- Yields:
Generator[tuple] – data in record_array
- static from_object(result)[source]
Create AnnealingQuantumTaskResult from AnnealingTaskResult object
- Parameters:
result (
AnnealingTaskResult) – AnnealingTaskResult object- Return type:
- Returns:
AnnealingQuantumTaskResult – An AnnealingQuantumTaskResult based on the given result object