Coverage for src/braket/device_schema/dwave/dwave_device_capabilities_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 pydantic import Field
16from braket.device_schema.device_capabilities import DeviceCapabilities
17from braket.device_schema.dwave.dwave_device_parameters_v1 import DwaveDeviceParameters
18from braket.device_schema.dwave.dwave_provider_properties_v1 import DwaveProviderProperties
19from braket.schema_common import BraketSchemaBase, BraketSchemaHeader
22class DwaveDeviceCapabilities(DeviceCapabilities, BraketSchemaBase):
24 """
25 These are the capabilities specific to D-Wave device
27 Attributes:
28 provider: Properties specific to D-Wave provider
30 Examples:
31 >>> import json
32 >>> input_json = ...{
33 ... "braketSchemaHeader": {
34 ... "name": "braket.device_schema.dwave.dwave_device_capabilities",
35 ... "version": "1",
36 ... },
37 ... "provider": {
38 ... "braketSchemaHeader": {
39 ... "name": "braket.device_schema.dwave.dwave_provider_properties",
40 ... "version": "1",
41 ... },
42 ... "annealingOffsetStep": 1.45,
43 ... "annealingOffsetStepPhi0": 1.45,
44 ... "annealingOffsetRanges": [[1.45, 1.45], [1.45, 1.45]],
45 ... "annealingDurationRange": [1, 2, 3],
46 ... "couplers": [[1, 2, 3], [1, 2, 3]],
47 ... "defaultAnnealingDuration": 1,
48 ... "defaultProgrammingThermalizationDuration": 1,
49 ... "defaultReadoutThermalizationDuration": 1,
50 ... "extendedJRange": [1, 2, 3],
51 ... "hGainScheduleRange": [1, 2, 3],
52 ... "hRange": [1, 2, 3],
53 ... "jRange": [1, 2, 3],
54 ... "maximumAnnealingSchedulePoints": 1,
55 ... "maximumHGainSchedulePoints": 1,
56 ... "perQubitCouplingRange": [1, 2, 3],
57 ... "programmingThermalizationDurationRange": [1, 2, 3],
58 ... "qubits": [1, 2, 3],
59 ... "qubitCount": 1,
60 ... "quotaConversionRate": 1,
61 ... "readoutThermalizationDurationRange": [1, 2, 3],
62 ... "taskRunDurationRange": [1, 2, 3],
63 ... "topology": {},
64 ... },
65 ... "service": {
66 ... "braketSchemaHeader": {
67 ... "name": "braket.device_schema.device_service_properties",
68 ... "version": "1",
69 ... },
70 ... "executionWindows": [
71 ... {
72 ... "executionDay": "Everyday",
73 ... "windowStartHour": "1966280412345.6789",
74 ... "windowEndHour": "1966280414345.6789",
75 ... }
76 ... ],
77 ... "shotsRange": [1, 10],
78 ... "deviceCost": {
79 ... "price": 0.25,
80 ... "unit": "minute"
81 ... },
82 ... "deviceDocumentation": {
83 ... "imageUrl": "image_url",
84 ... "summary": "Summary on the device",
85 ... "externalDocumentationUrl": "exter doc link",
86 ... },
87 ... "deviceLocation": "us-east-1"
88 ... },
89 ... "action": {
90 ... "braket.ir.jaqcd.program": {
91 ... "actionType": "braket.ir.jaqcd.program",
92 ... "version": ["1.0", "1.1"],
93 ... }
94 ... },
95 ... "deviceParameters": {DwaveDeviceParameters.schema_json()},
96 ... }
97 >>> DwaveDeviceCapabilities.parse_raw_schema(json.dumps(input_json))
98 """
100 _PROGRAM_HEADER = BraketSchemaHeader(
101 name="braket.device_schema.dwave.dwave_device_capabilities", version="1"
102 )
103 braketSchemaHeader: BraketSchemaHeader = Field(default=_PROGRAM_HEADER, const=_PROGRAM_HEADER)
104 provider: DwaveProviderProperties