braket.device_schema.openqasm_device_action_properties module

class braket.device_schema.openqasm_device_action_properties.OpenQASMDeviceActionProperties(*, version: List[str], actionType: ConstrainedStrValue, supportedOperations: List[str], supportedModifiers: List[Control | NegControl | Power | Inverse] | None = [], supportedPragmas: List[str] | None = [], forbiddenPragmas: List[str] | None = [], maximumQubitArrays: int | None = None, maximumClassicalArrays: int | None = None, forbiddenArrayOperations: List[str] | None = [], requiresAllQubitsMeasurement: bool | None = False, supportPhysicalQubits: bool | None = False, requiresContiguousQubitIndices: bool | None = False, supportsPartialVerbatimBox: bool | None = True, supportsUnassignedMeasurements: bool | None = True, disabledQubitRewiringSupported: bool | None = False, supportedResultTypes: List[ResultType] | None = None)[source]

Bases: DeviceActionProperties

Defines the schema for properties for the actions that can be supported by OpenQASM devices.

supportedOperations

Operations supported by the OpenQASM action.

Type:

List[str]

supportedResultTypes

Result types that are supported by the OpenQASM action.

Type:

List[braket.device_schema.result_type.ResultType] | None

supportPhysicalQubits

Whether the device supports the ability to run circuits with the exact qubits chosen, without any rewiring downstream.

Type:

bool | None

supportedPragmas

List of pragmas supported (not ignored) in the OpenQASM action.

Type:

List[str] | None

forbiddenPragmas

List of pragmas that will raise an error when sent to the device.

Type:

List[str] | None

forbiddenArrayOperations

Forbidden operations on arrays.

Type:

List[str] | None

requiresAllQubitsMeasurement

Whether measurements have to be made on all qubits in the OpenQASM action.

Type:

bool | None

requiresContiguousQubitIndices

Whether used qubit indices of qubit arrays are required to be contiguous.

Type:

bool | None

Examples

>>> import json
>>> input_json = {
...    "actionType": "braket.ir.openqasm.program",
...    "version": ["1"],
...    "supportedOperations": ["x", "y"],
...    "supportedResultTypes": [{
...         "name": "resultType1",
...         "observables": ["observable1"],
...         "minShots": 0,
...         "maxShots": 4,
...     }],
...    "supportPhysicalQubits": True
...    "supportedPragmas": ["braket_bit_flip_noise"],
...    "forbiddenPragmas": ["braket_kraus_operator"],
...    "forbiddenArrayOperations": ["concatenation", "range", "slicing"],
...    "requiresAllQubitsMeasurement": False
...    "requiresContiguousQubitIndices": False
...    "supportsPartialVerbatimBox": False
...    "supportsUnassignedMeasurements": True
... }
>>> OpenQASMDeviceActionProperties.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.

actionType: ConstrainedStrValue
supportedOperations: List[str]
supportedModifiers: List[Control | NegControl | Power | Inverse] | None
supportedPragmas: List[str] | None
forbiddenPragmas: List[str] | None
maximumQubitArrays: int | None
maximumClassicalArrays: int | None
forbiddenArrayOperations: List[str] | None
requiresAllQubitsMeasurement: bool | None
supportPhysicalQubits: bool | None
requiresContiguousQubitIndices: bool | None
supportsPartialVerbatimBox: bool | None
supportsUnassignedMeasurements: bool | None
disabledQubitRewiringSupported: bool | None
supportedResultTypes: List[ResultType] | None