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