Coverage for src/braket/task_result/annealing_task_result_v1.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"). You
4# may not use this file except in compliance with the License. A copy of
5# the License is located at
6#
7# http://aws.amazon.com/apache2.0/
8#
9# or in the "license" file accompanying this file. This file is
10# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11# ANY KIND, either express or implied. See the License for the specific
12# language governing permissions and limitations under the License
14from typing import List, Optional
16from pydantic import Field, conint, conlist
18from braket.schema_common.schema_base import BraketSchemaBase, BraketSchemaHeader
19from braket.task_result.additional_metadata import AdditionalMetadata
20from braket.task_result.task_metadata_v1 import TaskMetadata
23class AnnealingTaskResult(BraketSchemaBase):
24 """
25 The annealing task result schema.
27 Attributes:
28 braketSchemaHeader (BraketSchemaHeader): Schema header. Users do not need
29 to set this value. Only default is allowed.
30 solutions (List[int]): Solutions of task result. Default is `None`.
31 solutionCounts (List[int]): The number of times the solutions occurred.
32 Default is `None`.
33 values (List[float]): Output or energy of the solutions. Default is `None`.
34 variableCount (int): The number of variables. Default is `None`.
35 taskMetadata (TaskMetadata): The task metadata.
36 additionalMetadata (AdditionalMetadata): Additional metadata of the task.
38 """
40 _ANNEALING_TASK_RESULT_HEADER = BraketSchemaHeader(
41 name="braket.task_result.annealing_task_result", version="1"
42 )
43 braketSchemaHeader: BraketSchemaHeader = Field(
44 default=_ANNEALING_TASK_RESULT_HEADER, const=_ANNEALING_TASK_RESULT_HEADER
45 )
46 solutions: Optional[List[conlist(conint(ge=-1, le=3), min_items=1)]]
47 solutionCounts: Optional[List[conint(ge=0)]]
48 values: Optional[List[float]]
49 variableCount: Optional[conint(ge=0)]
50 taskMetadata: TaskMetadata
51 additionalMetadata: AdditionalMetadata