braket.ir.jaqcd.instructions module

class braket.ir.jaqcd.instructions.H(*, target: ConstrainedIntValue, type: Type = Type.h)[source]

Bases: SingleTarget

Hadamard gate.

type

The instruction type. default = “h”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> H(target=1)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

h = 'h'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.I(*, target: ConstrainedIntValue, type: Type = Type.i)[source]

Bases: SingleTarget

Identity gate.

type

The instruction type. default = “i”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> I(target=1)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

i = 'i'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.X(*, target: ConstrainedIntValue, type: Type = Type.x)[source]

Bases: SingleTarget

Pauli-X gate.

type

The instruction type. default = “x”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> X(target=0)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

x = 'x'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.Y(*, target: ConstrainedIntValue, type: Type = Type.y)[source]

Bases: SingleTarget

Pauli-Y gate.

type

The instruction type. default = “y”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> Y(target=0)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

y = 'y'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.Z(*, target: ConstrainedIntValue, type: Type = Type.z)[source]

Bases: SingleTarget

Pauli-Z gate.

type

The instruction type. default = “z”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> Z(target=0)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

z = 'z'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.Rx(*, angle: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.rx)[source]

Bases: SingleTarget, Angle

X-axis rotation gate.

type

The instruction type. default = “rx”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

angle

The angle in radians. inf, -inf, and NaN are not allowable inputs.

Type:

float

Examples

>>> Rx(target=0, angle=0.15)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

rx = 'rx'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.Ry(*, angle: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.ry)[source]

Bases: SingleTarget, Angle

Y-axis rotation gate.

type

The instruction type. default = “ry”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

angle

The angle in radians. inf, -inf, and NaN are not allowable inputs.

Type:

float

Examples

>>> Ry(target=0, angle=0.15)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

ry = 'ry'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.Rz(*, angle: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.rz)[source]

Bases: SingleTarget, Angle

Z-axis rotation gate.

type

The instruction type. default = “rz”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

angle

The angle in radians. inf, -inf, and NaN are not allowable inputs.

Type:

float

Examples

>>> Rz(target=0, angle=0.15)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

rz = 'rz'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.S(*, target: ConstrainedIntValue, type: Type = Type.s)[source]

Bases: SingleTarget

S gate. Applies a 90 degree rotation around the Z-axis.

type

The instruction type. default = “s”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> S(target=0)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

s = 's'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.T(*, target: ConstrainedIntValue, type: Type = Type.t)[source]

Bases: SingleTarget

T gate. Applies a 45 degree rotation around the Z-axis.

type

The instruction type. default = “t”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> T(target=0)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

t = 't'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.Si(*, target: ConstrainedIntValue, type: Type = Type.si)[source]

Bases: SingleTarget

Si gate. Conjugate transpose of S gate.

type

The instruction type. default = “si”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> Si(target=0)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

si = 'si'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.Ti(*, target: ConstrainedIntValue, type: Type = Type.ti)[source]

Bases: SingleTarget

Ti gate. Conjugate transpose of T gate.

type

The instruction type. default = “ti”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> Ti(target=0)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

ti = 'ti'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.Swap(*, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.swap)[source]

Bases: DoubleTarget

Swap gate. Swaps the state of the two qubits.

type

The instruction type. default = “swap”. (type) is optional. This should be unique among all instruction types.

Type:

str

targets

The target qubits. This is a list with two items and all items are int >= 0.

Type:

List[int]

Examples

>>> Swap(targets=[0, 1])

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

swap = 'swap'
targets: ConstrainedListValue[ConstrainedIntValue]
class braket.ir.jaqcd.instructions.CSwap(*, targets: ConstrainedListValue[ConstrainedIntValue], control: ConstrainedIntValue, type: Type = Type.cswap)[source]

Bases: SingleControl, DoubleTarget

Controlled swap gate.

type

The instruction type. default = “cswap”. (type) is optional. This should be unique among all instruction types.

Type:

str

control

The control qubit. This is an int >= 0.

Type:

int

targets

The target qubits. This is a list with two items and all items are int >= 0.

Type:

List[int]

Examples

>>> Swap(control=0, targets=[1, 2])

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

cswap = 'cswap'
control: ConstrainedIntValue
class braket.ir.jaqcd.instructions.ISwap(*, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.iswap)[source]

Bases: DoubleTarget

ISwap gate. Swaps the state of two qubits, applying a -i phase to q1 when it is in the 1 state

and a -i phase to q2 when it is in the 0 state.

This is equivalent to XY(pi)

type

The instruction type. default = “iswap”. (type) is optional. This should be unique among all instruction types.

Type:

str

targets

The target qubits. This is a list with two items and all items are int >= 0.

Type:

List[int]

Examples

>>> ISwap(targets=[0, 1])

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

iswap = 'iswap'
targets: ConstrainedListValue[ConstrainedIntValue]
class braket.ir.jaqcd.instructions.PSwap(*, angle: ConstrainedFloatValue, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.pswap)[source]

Bases: DoubleTarget, Angle

Parameterized swap gate that takes in the angle of the phase to apply to the swapped gates.

type

The instruction type. default = “pswap”. (type) is optional. This should be unique among all instruction types.

Type:

str

angle

The angle in radians. inf, -inf, and NaN are not allowable inputs.

Type:

float

targets

The target qubits. This is a list with two items and all items are int >= 0.

Type:

List[int]

Examples

>>> PSwap(targets=[0, 1], angle=0.15)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

pswap = 'pswap'
targets: ConstrainedListValue[ConstrainedIntValue]
class braket.ir.jaqcd.instructions.XY(*, angle: ConstrainedFloatValue, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.xy)[source]

Bases: DoubleTarget, Angle

Rotates between |01> and |10> by the given angle.

type

The instruction type. default = “xy”. (type) is optional. This should be unique among all instruction types.

Type:

str

angle

The angle in radians. inf, -inf, and NaN are not allowable inputs.

Type:

float

targets

The target qubits. This is a list with two items and all items are int >= 0.

Type:

List[int]

Examples

>>> XY(targets=[0, 1], angle=0.15)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

xy = 'xy'
targets: ConstrainedListValue[ConstrainedIntValue]
class braket.ir.jaqcd.instructions.PhaseShift(*, angle: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.phaseshift)[source]

Bases: SingleTarget, Angle

Phase shift gate. Shifts the phase between |0> and |1> by a given angle.

type

The instruction type. default = “phaseshift”. (type) is optional. This should be unique among all instruction types.

Type:

str

angle

The angle in radians. inf, -inf, and NaN are not allowable inputs.

Type:

float

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> PhaseShift(target=1, angle=0.15)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

phaseshift = 'phaseshift'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.CPhaseShift(*, angle: ConstrainedFloatValue, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cphaseshift)[source]

Bases: SingleTarget, SingleControl, Angle

Controlled phase shift gate.

type

The instruction type. default = “cphaseshift”. (type) is optional. This should be unique among all instruction types.

Type:

str

control

The control qubit. This is an int >= 0.

Type:

int

angle

The angle in radians. inf, -inf, and NaN are not allowable inputs.

Type:

float

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> CPhaseShift(control=0, target=1, angle=0.15)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

cphaseshift = 'cphaseshift'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.CPhaseShift00(*, angle: ConstrainedFloatValue, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cphaseshift00)[source]

Bases: SingleTarget, SingleControl, Angle

Controlled phase shift gate that phases the |00> state.

type

The instruction type. default = “cphaseshift00”. (type) is optional. This should be unique among all instruction types.

Type:

str

control

The control qubit. This is an int >= 0.

Type:

int

angle

The angle in radians. inf, -inf, and NaN are not allowable inputs.

Type:

float

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> CPhaseShift00(control=0, target=1, angle=0.15)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

cphaseshift00 = 'cphaseshift00'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.CPhaseShift01(*, angle: ConstrainedFloatValue, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cphaseshift01)[source]

Bases: SingleTarget, SingleControl, Angle

Controlled phase shift gate that phases the |01> state.

type

The instruction type. default = “cphaseshift01”. (type) is optional. This should be unique among all instruction types.

Type:

str

control

The control qubit. This is an int >= 0.

Type:

int

angle

The angle in radians. inf, -inf, and NaN are not allowable inputs.

Type:

float

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> CPhaseShift01(control=0, target=1, angle=0.15)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

cphaseshift01 = 'cphaseshift01'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.CPhaseShift10(*, angle: ConstrainedFloatValue, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cphaseshift10)[source]

Bases: SingleTarget, SingleControl, Angle

Controlled phase shift gate that phases the |10> state.

type

The instruction type. default = “cphaseshift10”. (type) is optional. This should be unique among all instruction types.

Type:

str

control

The control qubit. This is an int >= 0.

Type:

int

angle

The angle in radians. inf, -inf, and NaN are not allowable inputs.

Type:

float

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> CPhaseShift10(control=0, target=1, angle=0.15)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

cphaseshift10 = 'cphaseshift10'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.CNot(*, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cnot)[source]

Bases: SingleTarget, SingleControl

Controlled not gate. Also known as the CX gate.

type

The instruction type. default = “cnot”. (type) is optional. This should be unique among all instruction types.

Type:

str

control

The control qubit. This is an int >= 0.

Type:

int

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> CNot(control=0, target=1)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

cnot = 'cnot'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.CCNot(*, controls: ConstrainedListValue[ConstrainedIntValue], target: ConstrainedIntValue, type: Type = Type.ccnot)[source]

Bases: SingleTarget, DoubleControl

Doubly-controlled NOT gate. Also known as the Toffoli gate.

type

The instruction type. default = “ccnot”. (type) is optional. This should be unique among all instruction types.

Type:

str

controls

The control qubits. This is a list with two items and all items are int >= 0.

Type:

int

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> CCNot(control=[0,1], target=1)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

ccnot = 'ccnot'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.CV(*, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cv)[source]

Bases: SingleTarget, SingleControl

Controlled sqrt(NOT) gate. Also known as the CV gate.

type

The instruction type. default = “cv”. (type) is optional. This should be unique among all instruction types.

Type:

str

control

The control qubit. This is an int >= 0.

Type:

int

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> CV(control=0, target=1)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

cv = 'cv'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.CY(*, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cy)[source]

Bases: SingleTarget, SingleControl

Controlled Y-gate.

type

The instruction type. default = “cy”. (type) is optional. This should be unique among all instruction types.

Type:

str

control

The control qubit

Type:

int

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> CY(control=0, target=1)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

cy = 'cy'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.CZ(*, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cz)[source]

Bases: SingleTarget, SingleControl

Controlled Z-gate.

type

The instruction type. default = “cz”. (type) is optional. This should be unique among all instruction types.

Type:

str

control

The control qubit. This is an int >= 0.

Type:

int

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> CZ(control=0, target=1)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

cz = 'cz'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.ECR(*, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.ecr)[source]

Bases: DoubleTarget

An echoed RZX(pi/2) gate.

type

The instruction type. default = “ecr”. (type) is optional. This should be unique among all instruction types.

Type:

str

targets

The target qubits. This is a list with two items and all items are int >= 0.

Type:

List[int]

Examples

>>> ECR(targets=[0, 1])

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

ecr = 'ecr'
targets: ConstrainedListValue[ConstrainedIntValue]
class braket.ir.jaqcd.instructions.XX(*, angle: ConstrainedFloatValue, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.xx)[source]

Bases: DoubleTarget, Angle

The Ising (XX) gate.

type

The instruction type. default = “xx”. (type) is optional. This should be unique among all instruction types.

Type:

str

angle

The angle in radians. inf, -inf, and NaN are not allowable inputs.

Type:

float

targets

The target qubits. This is a list with two items and all items are int >= 0.

Type:

List[int]

Examples

>>> XX(targets=[0, 1], angle=0.15)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

xx = 'xx'
targets: ConstrainedListValue[ConstrainedIntValue]
class braket.ir.jaqcd.instructions.YY(*, angle: ConstrainedFloatValue, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.yy)[source]

Bases: DoubleTarget, Angle

The Ising (YY) gate.

type

The instruction type. default = “yy”. (type) is optional. This should be unique among all instruction types.

Type:

str

angle

The angle in radians. inf, -inf, and NaN are not allowable inputs.

Type:

float

targets

The target qubits. This is a list with two items and all items are int >= 0.

Type:

List[int]

Examples

>>> YY(targets=[0, 1], angle=0.15)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

yy = 'yy'
targets: ConstrainedListValue[ConstrainedIntValue]
class braket.ir.jaqcd.instructions.ZZ(*, angle: ConstrainedFloatValue, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.zz)[source]

Bases: DoubleTarget, Angle

The Ising (ZZ) gate.

type

The instruction type. default = “zz”. (type) is optional. This should be unique among all instruction types.

Type:

str

angle

The angle in radians. inf, -inf, and NaN are not allowable inputs.

Type:

float

targets

The target qubits. This is a list with two items and all items are int >= 0.

Type:

List[int]

Examples

>>> ZZ(targets=[0, 1], angle=0.15)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

zz = 'zz'
targets: ConstrainedListValue[ConstrainedIntValue]
class braket.ir.jaqcd.instructions.V(*, target: ConstrainedIntValue, type: Type = Type.v)[source]

Bases: SingleTarget

Square root of NOT gate.

type

The instruction type. default = “v”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> V(target=0)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

v = 'v'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.Vi(*, target: ConstrainedIntValue, type: Type = Type.vi)[source]

Bases: SingleTarget

Conjugate transpose of square root of NOT gate.

type

The instruction type. default = “vi”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> Vi(target=0)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

vi = 'vi'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.Unitary(*, targets: ConstrainedListValue[ConstrainedIntValue], matrix: ConstrainedListValue[ConstrainedListValue[ConstrainedListValue[ConstrainedFloatValue]]], type: Type = Type.unitary)[source]

Bases: TwoDimensionalMatrix, MultiTarget

Arbitrary unitary matrix gate

type

The instruction type. default = “unitary”. (type) is optional. This should be unique among all instruction types.

Type:

str

targets

The target qubits. This is a list with ints and all ints >= 0.

Type:

List[int]

matrix

The unitary matrix specifying the behavior of the gate.

Type:

List[List[List[float]]]

Examples

>>> Unitary(targets=[0], matrix=[[[0, 0], [1, 0]],[[1, 0], [0, 1]]])

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

unitary = 'unitary'
matrix: ConstrainedListValue[ConstrainedListValue[ConstrainedListValue[ConstrainedFloatValue]]]
class braket.ir.jaqcd.instructions.BitFlip(*, probability: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.bit_flip)[source]

Bases: SingleTarget, SingleProbability

Bit Flip noise channel.

type

The instruction type. default = “bit_flip”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> BitFlip(target=1, probability=0.1)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

bit_flip = 'bit_flip'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.PhaseFlip(*, probability: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.phase_flip)[source]

Bases: SingleTarget, SingleProbability

Phase Flip noise channel.

type

The instruction type. default = “phase_flip”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> PhaseFlip(target=1, probability=0.1)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

phase_flip = 'phase_flip'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.PauliChannel(*, probX: ConstrainedFloatValue, probY: ConstrainedFloatValue, probZ: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.pauli_channel)[source]

Bases: SingleTarget, TripleProbability

A single qubit Pauli noise channel.

type

The instruction type. default = “pauli_channel”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> PauliChannel(target=1, probX=0.1, probY=0.2, probZ=0.3)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

pauli_channel = 'pauli_channel'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.MultiQubitPauliChannel(*, probabilities: Dict[ConstrainedStrValue, ConstrainedFloatValue], targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.multi_qubit_pauli_channel)[source]

Bases: MultiTarget, MultiProbability

Multi-qubit Pauli noise channel.

type

The instruction type. default = “multi_qubit_pauli_channel”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit(s). This is list of intergers >= 0.

Type:

int

The length of the list must match the length of the Pauli strings provided.

Examples

>>> MultiQubitPauliChannel(target=1, probabilities={"X": 0.1})
>>> MultiQubitPauliChannel(target=[0,1], probabilities={"XY": 0.1})
>>> MultiQubitPauliChannel(target=[0,1,2], probabilities={"XYZ": 0.1})

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

multi_qubit_pauli_channel = 'multi_qubit_pauli_channel'
targets: ConstrainedListValue[ConstrainedIntValue]
class braket.ir.jaqcd.instructions.Depolarizing(*, probability: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.depolarizing)[source]

Bases: SingleTarget, SingleProbability_34

Depolarizing noise channel.

type

The instruction type. default = “depolarizing”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> Depolarizing(target=1, probability=0.1)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

depolarizing = 'depolarizing'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.TwoQubitDepolarizing(*, probability: ConstrainedFloatValue, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.two_qubit_depolarizing)[source]

Bases: DoubleTarget, SingleProbability_1516

Two-Qubit Depolarizing noise channel.

type

The instruction type. default = “two_qubit_depolarizing”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubits. This is an int >= 0.

Type:

int

Examples

>>> TwoQubitDepolarizing(target1=0, target2=1, probability=0.1)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

two_qubit_depolarizing = 'two_qubit_depolarizing'
targets: ConstrainedListValue[ConstrainedIntValue]
class braket.ir.jaqcd.instructions.TwoQubitDephasing(*, probability: ConstrainedFloatValue, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.two_qubit_dephasing)[source]

Bases: DoubleTarget, SingleProbability_34

Two-Qubit Dephasing noise channel.

type

The instruction type. default = “two_qubit_dephasing”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubits. This is an int >= 0.

Type:

int

Examples

>>> TwoQubitDephasing(target1=0, target2=1, probability=0.1)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

two_qubit_dephasing = 'two_qubit_dephasing'
targets: ConstrainedListValue[ConstrainedIntValue]
class braket.ir.jaqcd.instructions.AmplitudeDamping(*, gamma: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.amplitude_damping)[source]

Bases: SingleTarget, DampingProbability

Amplitude Damping noise channel.

type

The instruction type. default = “amplitude_damping”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> AmplitudeDamping(target=1, gamma=0.1)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

amplitude_damping = 'amplitude_damping'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.GeneralizedAmplitudeDamping(*, probability: ConstrainedFloatValue, gamma: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.generalized_amplitude_damping)[source]

Bases: SingleTarget, DampingProbability, DampingSingleProbability

Generalized Amplitude Damping noise channel.

type

The instruction type. default = “generalized_amplitude_damping”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> GeneralizedAmplitudeDamping(target=1, gamma=0.1, probability=0.9)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

generalized_amplitude_damping = 'generalized_amplitude_damping'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.PhaseDamping(*, gamma: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.phase_damping)[source]

Bases: SingleTarget, DampingProbability

Phase Damping noise channel.

type

The instruction type. default = “phase_damping”. (type) is optional. This should be unique among all instruction types.

Type:

str

target

The target qubit. This is an int >= 0.

Type:

int

Examples

>>> PhaseDamping(target=1, gamma=0.1)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

phase_damping = 'phase_damping'
target: ConstrainedIntValue
class braket.ir.jaqcd.instructions.Kraus(*, targets: ConstrainedListValue[ConstrainedIntValue], matrices: ConstrainedListValue[ConstrainedListValue[ConstrainedListValue[ConstrainedListValue[ConstrainedFloatValue]]]], type: Type = Type.kraus)[source]

Bases: TwoDimensionalMatrixList, MultiTarget

Arbitrary quantum channel defined by the input matrices.

type

The instruction type. default = “kraus”. (type) is optional. This should be unique among all instruction types.

Type:

str

targets

The target qubits. This is a list with ints and all ints >= 0.

Type:

List[int]

matrices

A list of matrices specifying the quantum channel. A complex number is represented as a list of 2 real numbers. So each matrix has type List[List[List[float]]].

Type:

List[List[List[List[float]]]]

Examples

>>> matrix1 = [[[1/sqrt(2), 0],[0, 0]],[[0, 0],[1/sqrt(2), 0]]]
>>> matrix2 = [[[0, 0],[1/sqrt(2), 0]],[[1/sqrt(2), 0],[0, 0]]]
>>> matrices = [matrix1, matrix2]
>>> Kraus(targets=[0], matrices=matrices)

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

kraus = 'kraus'
matrices: ConstrainedListValue[ConstrainedListValue[ConstrainedListValue[ConstrainedListValue[ConstrainedFloatValue]]]]
class braket.ir.jaqcd.instructions.StartVerbatimBox(*, directive: str = 'StartVerbatimBox', type: Type = Type.start_verbatim_box)[source]

Bases: CompilerDirective

StartVerbatimBox is a compiler instruction to start a portion of code that will preserve the instruction within StartVerbatimBox and EndVerbatimBox from being modified in any way by the compiler.

type

The instruction type. default = “start_verbatim_box”. (type) is optional. This should be unique among all instruction types.

Type:

str

Examples

>>> StartVerbatimBox()

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

start_verbatim_box = 'start_verbatim_box'
directive: str
class braket.ir.jaqcd.instructions.EndVerbatimBox(*, directive: str = 'EndVerbatimBox', type: Type = Type.end_verbatim_box)[source]

Bases: CompilerDirective

EndVerbatimBox is a compiler instruction to mark the end of a portion of code that preserves the instruction within StartVerbatimBox and EndVerbatimBox from being modified in any way by the compiler.

type

The instruction type. default = “end_verbatim_box”. (type) is optional. This should be unique among all instruction types.

Type:

str

Examples

>>> EndVerbatimBox()

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.

class Type(value)[source]

Bases: str, Enum

An enumeration.

end_verbatim_box = 'end_verbatim_box'
directive: str