Coverage for src/braket/device_schema/rigetti/rigetti_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 typing import Dict
16from pydantic import Field
18from braket.device_schema.device_action_properties import DeviceActionType
19from braket.device_schema.device_capabilities import DeviceCapabilities
20from braket.device_schema.gate_model_qpu_paradigm_properties_v1 import (
21 GateModelQpuParadigmProperties,
22)
23from braket.device_schema.jaqcd_device_action_properties import JaqcdDeviceActionProperties
24from braket.device_schema.rigetti.rigetti_device_parameters_v1 import RigettiDeviceParameters
25from braket.schema_common import BraketSchemaBase, BraketSchemaHeader
28class RigettiDeviceCapabilities(BraketSchemaBase, DeviceCapabilities):
29 """
30 This defines the capabilities of a rigetti device.
32 Attributes:
33 action: Actions that a rigetti device can support
34 paradigm: Paradigm properties of a rigetti
36 Examples:
37 >>> import json
38 >>> input_json = {
39 ... "braketSchemaHeader": {
40 ... "name": "braket.device_schema.rigetti.rigetti_device_capabilities",
41 ... "version": "1",
42 ... },
43 ... "service": {
44 ... "braketSchemaHeader": {
45 ... "name": "braket.device_schema.device_service_properties",
46 ... "version": "1",
47 ... },
48 ... "executionWindows": [
49 ... {
50 ... "executionDay": "Everyday",
51 ... "windowStartHour": "1966280412345.6789",
52 ... "windowEndHour": "1966280414345.6789",
53 ... }
54 ... ],
55 ... "shotsRange": [1, 10],
56 ... "deviceCost": {
57 ... "price": 0.25,
58 ... "unit": "minute"
59 ... },
60 ... "deviceDocumentation": {
61 ... "imageUrl": "image_url",
62 ... "summary": "Summary on the device",
63 ... "externalDocumentationUrl": "exter doc link",
64 ... },
65 ... "deviceLocation": "us-east-1"
66 ... },
67 ... "action": {
68 ... "braket.ir.jaqcd.program": {
69 ... "actionType": "braket.ir.jaqcd.program",
70 ... "version": ["1.0", "1.1"],
71 ... "supportedOperations": ["x", "y"],
72 ... "supportedResultTypes": [{
73 ... "name": "resultType1",
74 ... "observables": ["observable1"],
75 ... "minShots": 0,
76 ... "maxShots": 4,
77 ... }],
78 ... }
79 ... },
80 ... "paradigm": {
81 ... "braketSchemaHeader": {
82 ... "name": "braket.device_schema.gate_model_qpu_paradigm_properties",
83 ... "version": "1",
84 ... },
85 ... "qubitCount": 32,
86 ... "nativeGateSet": ["ccnot", "cy"],
87 ... "connectivity": {
88 ... "fullyConnected": False,
89 ... "connectivityGraph": {"1": ["2", "3"]},
90 ... },
91 ... },
92 ... "deviceParameters": {RigettiDeviceParameters.schema_json()},
93 ... }
94 >>> RigettiDeviceCapabilities.parse_raw_schema(json.dumps(input_json))
96 """
98 _PROGRAM_HEADER = BraketSchemaHeader(
99 name="braket.device_schema.rigetti.rigetti_device_capabilities", version="1"
100 )
101 braketSchemaHeader: BraketSchemaHeader = Field(default=_PROGRAM_HEADER, const=_PROGRAM_HEADER)
102 action: Dict[DeviceActionType, JaqcdDeviceActionProperties]
103 paradigm: GateModelQpuParadigmProperties