braket.device_schema.device_capabilities module

class braket.device_schema.device_capabilities.DeviceCapabilities[source]

Bases: pydantic.main.BaseModel

DeviceCapabilities are the properties specific to device, this schema defines what is common across all the devices

service

properties which are common to the Braket service

action

Map of the action to its properties

deviceParameters

It is the json schema of the deviceParameters for each device. for example the deviceParameter for IonqDeviceCapabilities will be IonqDeviceParameters.json_schema()

Examples

>>> import json
>>> input_json = {
...    "service": {
...        "braketSchemaHeader": {
...            "name": "braket.device_schema.device_service_properties",
...            "version": "1",
...        },
...        "executionWindows": [
...            {
...                "executionDay": "Everyday",
...                "windowStartHour": "09:00",
...                "windowEndHour": "19:00",
...            }
...        ],
...        "shotsRange": [1, 10],
...        "deviceCost": {
...             "price": 0.25,
...             "unit": "minute"
...         },
...         "deviceDocumentation": {
...             "imageUrl": "image_url",
...             "summary": "Summary on the device",
...             "externalDocumentationUrl": "exter doc link",
...         },
...         "deviceLocation": "us-east-1",
...         "updatedAt": "2020-06-16T19:28:02.869136"
...    },
...    "action": {
...        "braket.ir.jaqcd.program": {
...            "actionType": "braket.ir.jaqcd.program",
...            "version": ["1"],
...        }
...    },
...    "deviceParameters": {#Schema of specific device parameter instance},
... }
>>> DeviceCapabilities.parse_raw(json.dumps(input_json))

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.