braket.ir.jaqcd.instructions module

class braket.ir.jaqcd.instructions.H(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

h = 'h'
target = None
class braket.ir.jaqcd.instructions.I(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

i = 'i'
target = None
class braket.ir.jaqcd.instructions.X(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

x = 'x'
target = None
class braket.ir.jaqcd.instructions.Y(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

y = 'y'
target = None
class braket.ir.jaqcd.instructions.Z(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

z = 'z'
target = None
class braket.ir.jaqcd.instructions.Rx(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.SingleTarget, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

rx = 'rx'
target = None
class braket.ir.jaqcd.instructions.Ry(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.SingleTarget, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

ry = 'ry'
target = None
class braket.ir.jaqcd.instructions.Rz(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.SingleTarget, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

rz = 'rz'
target = None
class braket.ir.jaqcd.instructions.S(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

s = 's'
target = None
class braket.ir.jaqcd.instructions.T(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

t = 't'
target = None
class braket.ir.jaqcd.instructions.Si(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

si = 'si'
target = None
class braket.ir.jaqcd.instructions.Ti(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

ti = 'ti'
target = None
class braket.ir.jaqcd.instructions.Swap(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.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])
class Type[source]

Bases: str, enum.Enum

An enumeration.

swap = 'swap'
targets = None
class braket.ir.jaqcd.instructions.CSwap(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.SingleControl, braket.ir.jaqcd.shared_models.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])
class Type[source]

Bases: str, enum.Enum

An enumeration.

cswap = 'cswap'
control = None
class braket.ir.jaqcd.instructions.ISwap(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.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])
class Type[source]

Bases: str, enum.Enum

An enumeration.

iswap = 'iswap'
targets = None
class braket.ir.jaqcd.instructions.PSwap(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.DoubleTarget, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

pswap = 'pswap'
targets = None
class braket.ir.jaqcd.instructions.XY(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.DoubleTarget, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

xy = 'xy'
targets = None
class braket.ir.jaqcd.instructions.PhaseShift(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.SingleTarget, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

phaseshift = 'phaseshift'
target = None
class braket.ir.jaqcd.instructions.CPhaseShift(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.SingleTarget, braket.ir.jaqcd.shared_models.SingleControl, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

cphaseshift = 'cphaseshift'
target = None
class braket.ir.jaqcd.instructions.CPhaseShift00(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.SingleTarget, braket.ir.jaqcd.shared_models.SingleControl, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

cphaseshift00 = 'cphaseshift00'
target = None
class braket.ir.jaqcd.instructions.CPhaseShift01(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.SingleTarget, braket.ir.jaqcd.shared_models.SingleControl, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

cphaseshift01 = 'cphaseshift01'
target = None
class braket.ir.jaqcd.instructions.CPhaseShift10(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.SingleTarget, braket.ir.jaqcd.shared_models.SingleControl, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

cphaseshift10 = 'cphaseshift10'
target = None
class braket.ir.jaqcd.instructions.CNot(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.SingleTarget, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

cnot = 'cnot'
target = None
class braket.ir.jaqcd.instructions.CCNot(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.SingleTarget, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

ccnot = 'ccnot'
target = None
class braket.ir.jaqcd.instructions.CY(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.SingleTarget, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

cy = 'cy'
target = None
class braket.ir.jaqcd.instructions.CZ(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.SingleTarget, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

cz = 'cz'
target = None
class braket.ir.jaqcd.instructions.XX(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.DoubleTarget, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

xx = 'xx'
targets = None
class braket.ir.jaqcd.instructions.YY(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.DoubleTarget, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

yy = 'yy'
targets = None
class braket.ir.jaqcd.instructions.ZZ(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.DoubleTarget, braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

zz = 'zz'
targets = None
class braket.ir.jaqcd.instructions.V(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

v = 'v'
target = None
class braket.ir.jaqcd.instructions.Vi(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.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)
class Type[source]

Bases: str, enum.Enum

An enumeration.

vi = 'vi'
target = None
class braket.ir.jaqcd.instructions.Unitary(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.TwoDimensionalMatrix, braket.ir.jaqcd.shared_models.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]]])
class Type[source]

Bases: str, enum.Enum

An enumeration.

unitary = 'unitary'
matrix = None