braket.device_schema.pulse.native_gate_calibrations_v1 module

class braket.device_schema.pulse.native_gate_calibrations_v1.InstructionArgument(*, name: str, value: Any = None, type: str, optional: bool = False)[source]

Bases: BaseModel

Defines an Instruction argument

name

The argument name

Type:

str

value

The value of the argument

Type:

Any

type

The string name of the argument’s value type

Type:

str

optional

The boolean to represent if argument is optional or not

Type:

bool

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.

name: str
value: Any
type: str
optional: bool
class braket.device_schema.pulse.native_gate_calibrations_v1.Instruction(*, name: str, arguments: List[InstructionArgument] | None = None)[source]

Bases: BaseModel

Defines a Native Gate Calibration Instruction

instructionName

The name of the instruction

arguments

List of instruction’s argument

Type:

List[braket.device_schema.pulse.native_gate_calibrations_v1.InstructionArgument] | None

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.

name: str
arguments: List[InstructionArgument] | None
class braket.device_schema.pulse.native_gate_calibrations_v1.PulseFunctionArgument(*, name: str, value: Any = None, type: str, optional: bool = False)[source]

Bases: BaseModel

Defines a pulse function argument

name

The argument name

Type:

str

value

The value of the argument

Type:

Any

type

The string name of the argument’s value type

Type:

str

optional

The boolean to represent if argumenet is optional or not

Type:

bool

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.

name: str
value: Any
type: str
optional: bool
class braket.device_schema.pulse.native_gate_calibrations_v1.PulseFunction(*, name: str, arguments: List[PulseFunctionArgument])[source]

Bases: BaseModel

Defines a pulse function used in native gate calibrations

name

The name of the pulse function

Type:

str

arguments

List of the pulse function’s arguments

Type:

List[braket.device_schema.pulse.native_gate_calibrations_v1.PulseFunctionArgument]

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.

name: str
arguments: List[PulseFunctionArgument]
class braket.device_schema.pulse.native_gate_calibrations_v1.NativeGate(*, name: str, qubits: List[str], arguments: List[str], calibrations: List[Instruction | PulseFunction])[source]

Bases: BaseModel

Defines a native gate

name

The name of the native gate

Type:

str

qubits

The name of qubits that the gate acts on

Type:

List[str]

arguments

The list of the native gate’s argument

Type:

List[str]

calibrations

List of instructions/pulse functions

Type:

List[braket.device_schema.pulse.native_gate_calibrations_v1.Instruction | braket.device_schema.pulse.native_gate_calibrations_v1.PulseFunction]

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.

name: str
qubits: List[str]
arguments: List[str]
calibrations: List[Instruction | PulseFunction]
class braket.device_schema.pulse.native_gate_calibrations_v1.TemplateWaveformArgument(*, name: str, value: Any = None, type: str, optional: bool = False)[source]

Bases: BaseModel

Defines a template waveform’s argument

name

The name of the template waveform’s argument

Type:

str

value

The value of the argument

Type:

Any

type

The string name of the argument’s value type

Type:

str

optional

The boolean to represent if argumenet is optional or not

Type:

bool

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.

name: str
value: Any
type: str
optional: bool
class braket.device_schema.pulse.native_gate_calibrations_v1.Waveform(*, waveformId: str)[source]

Bases: BaseModel

Defines the base type for waveforms

Attributes: waveformId: Id to uniquely identify waveforms

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.

waveformId: str
class braket.device_schema.pulse.native_gate_calibrations_v1.TemplateWaveform(*, waveformId: str, name: str, arguments: List[TemplateWaveformArgument])[source]

Bases: Waveform

Defines a template waveform

name

The name of the template waveform

Type:

str

arguments

List of waveform’s arguments

Type:

List[braket.device_schema.pulse.native_gate_calibrations_v1.TemplateWaveformArgument]

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.

name: str
arguments: List[TemplateWaveformArgument]
class braket.device_schema.pulse.native_gate_calibrations_v1.ArbitraryWaveform(*, waveformId: str, amplitudes: List[Tuple[float, float]])[source]

Bases: Waveform

Defines a arbitrary waveform

waveformId

The unique identifier for the waveform

amplitudes

List of Tuple containg two floats to denote the real and imaginary part of a complex number

Type:

List[Tuple[float, float]]

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.

amplitudes: List[Tuple[float, float]]
class braket.device_schema.pulse.native_gate_calibrations_v1.NativeGateCalibrations(*, braketSchemaHeader: BraketSchemaHeader = BraketSchemaHeader(name='braket.device_schema.pulse.native_gate_calibrations', version='1'), gates: Dict[str, Dict[str, List[NativeGate]]], waveforms: Dict[str, TemplateWaveform | ArbitraryWaveform])[source]

Bases: BraketSchemaBase

Defines the structure of how native gates will be represented

gates

Nested dictionary with an outer and inner key.

Type:

Dict[str, Dict[str, List[braket.device_schema.pulse.native_gate_calibrations_v1.NativeGate]]]

Outer key will be the qubit and inner key will be the gate name.
waveforms

Dictionary that holds waveform ID as the key and waveform as the value

Type:

Dict[str, braket.device_schema.pulse.native_gate_calibrations_v1.TemplateWaveform | braket.device_schema.pulse.native_gate_calibrations_v1.ArbitraryWaveform]

Examples

>>> input_json = {
...         "braketSchemaHeader": {
...             "name": "braket.device_schema.pulse.native_gate_calibrations",
...             "version": "1",
...         },
...         "gates":
...             {
...                 "0": {
...                     "rx": [{"name": "rx", "qubits": ["0"], "arguments": ["-1.5707963267948966"], "calibrations": [
...                           {"name": "barrier", "arguments": [{"name": "qubit", "value": "0", "type": "string"}]},
...                           {"name": "play", "arguments": [{"name": "frame", "value": "q0_rf_frame", "type": "frame"},
...                                                          {"name": "waveform", "value": "wf_drag_gaussian_0", "type": "waveform"}]},
...                            {"name": "barrier", "arguments": [{"name": "qubit", "value": "0", "type": "string"}]
...                        },
...                        .
...                        .
...                  },
...                   .
...                   .
...                   .
...         },
...         "waveforms": {
...             "q0_q1_cz_CZ": {"waveformId": "q0_q1_cz_CZ", "amplitudes": [[0.0, 0.0], [0.0, 0.0], ...]},
...             "wf_drag_gaussian_0": {"waveformId": "wf_drag_gaussian_0", "name": "drag_gaussian" , "arguments": [
...                                                                 {"name": "length", "value": 6.000000000000001e-08, "type": "float"},
...                                                                 {"name": "sigma", "value": 6.369913502160144e-09, "type": "float"},
...                                                                 {"name": "amplitude", "value": -0.4549282253548838, "type": "float"},
...                                                                 {"name": "beta", "value": 7.494904522022295e-10, "type": "float"}]}
...                 .
...                 .
...                 .
...         }
...     }
>>> NativeGateCalibrations.parse_raw_schema(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.

braketSchemaHeader: BraketSchemaHeader
gates: Dict[str, Dict[str, List[NativeGate]]]
waveforms: Dict[str, TemplateWaveform | ArbitraryWaveform]