Coverage for src/braket/task_result/dwave_metadata_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 Optional
16from pydantic import BaseModel, Field, conint, conlist
18from braket.schema_common import BraketSchemaBase, BraketSchemaHeader
21class DwaveTiming(BaseModel):
22 """
23 The D-Wave timing metadata result schema.
25 The times represented are in milliseconds.
27 Examples:
28 >>> DwaveTiming(qpuSamplingTime=1575, qpuAnnealTimePerSample=20)
29 """
31 qpuSamplingTime: Optional[conint(ge=0)]
32 qpuAnnealTimePerSample: Optional[conint(ge=0)]
33 qpuAccessTime: Optional[conint(ge=0)]
34 qpuAccessOverheadTime: Optional[conint(ge=0)]
35 qpuReadoutTimePerSample: Optional[conint(ge=0)]
36 qpuProgrammingTime: Optional[conint(ge=0)]
37 qpuDelayTimePerSample: Optional[conint(ge=0)]
38 postProcessingOverheadTime: Optional[conint(ge=0)]
39 totalPostProcessingTime: Optional[conint(ge=0)]
40 totalRealTime: Optional[conint(ge=0)]
41 runTimeChip: Optional[conint(ge=0)]
42 annealTimePerRun: Optional[conint(ge=0)]
43 readoutTimePerRun: Optional[conint(ge=0)]
46class DwaveMetadata(BraketSchemaBase):
47 """
48 The D-Wave metadata result schema.
50 Attributes:
51 braketSchemaHeader (BraketSchemaHeader): Schema header. Users do not need
52 to set this value. Only default is allowed.
53 activeVariables (List[int]): The active variables of the task on D-Wave
54 timing (DwaveTiming): Additional timing metadata of the task on D-Wave
56 Examples:
57 >>> timing = DwaveTiming(qpuSamplingTime=1575, qpuAnnealTimePerSample=20)
58 >>> DwaveMetadata(activeVariables=[0, 3, 4], timing=timing)
59 """
61 _DWAVE_METADATA_HEADER = BraketSchemaHeader(
62 name="braket.task_result.dwave_metadata", version="1"
63 )
64 braketSchemaHeader: BraketSchemaHeader = Field(
65 default=_DWAVE_METADATA_HEADER, const=_DWAVE_METADATA_HEADER
66 )
67 activeVariables: conlist(conint(ge=0))
68 timing: DwaveTiming