braket.ir.jaqcd.instructions module
- class braket.ir.jaqcd.instructions.H(*, target: ConstrainedIntValue, type: Type = Type.h)[source]
Bases:
SingleTargetHadamard 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 braket.ir.jaqcd.instructions.I(*, target: ConstrainedIntValue, type: Type = Type.i)[source]
Bases:
SingleTargetIdentity 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 braket.ir.jaqcd.instructions.X(*, target: ConstrainedIntValue, type: Type = Type.x)[source]
Bases:
SingleTargetPauli-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 braket.ir.jaqcd.instructions.Y(*, target: ConstrainedIntValue, type: Type = Type.y)[source]
Bases:
SingleTargetPauli-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 braket.ir.jaqcd.instructions.Z(*, target: ConstrainedIntValue, type: Type = Type.z)[source]
Bases:
SingleTargetPauli-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 braket.ir.jaqcd.instructions.Rx(*, angle: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.rx)[source]
Bases:
SingleTarget,AngleX-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 braket.ir.jaqcd.instructions.Ry(*, angle: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.ry)[source]
Bases:
SingleTarget,AngleY-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 braket.ir.jaqcd.instructions.Rz(*, angle: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.rz)[source]
Bases:
SingleTarget,AngleZ-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 braket.ir.jaqcd.instructions.S(*, target: ConstrainedIntValue, type: Type = Type.s)[source]
Bases:
SingleTargetS 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 braket.ir.jaqcd.instructions.T(*, target: ConstrainedIntValue, type: Type = Type.t)[source]
Bases:
SingleTargetT 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 braket.ir.jaqcd.instructions.Si(*, target: ConstrainedIntValue, type: Type = Type.si)[source]
Bases:
SingleTargetSi 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 braket.ir.jaqcd.instructions.Ti(*, target: ConstrainedIntValue, type: Type = Type.ti)[source]
Bases:
SingleTargetTi 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 braket.ir.jaqcd.instructions.Swap(*, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.swap)[source]
Bases:
DoubleTargetSwap 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 braket.ir.jaqcd.instructions.CSwap(*, targets: ConstrainedListValue[ConstrainedIntValue], control: ConstrainedIntValue, type: Type = Type.cswap)[source]
Bases:
SingleControl,DoubleTargetControlled 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 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 braket.ir.jaqcd.instructions.PSwap(*, angle: ConstrainedFloatValue, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.pswap)[source]
Bases:
DoubleTarget,AngleParameterized 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 braket.ir.jaqcd.instructions.XY(*, angle: ConstrainedFloatValue, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.xy)[source]
Bases:
DoubleTarget,AngleRotates 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 braket.ir.jaqcd.instructions.PhaseShift(*, angle: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.phaseshift)[source]
Bases:
SingleTarget,AnglePhase 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 braket.ir.jaqcd.instructions.CPhaseShift(*, angle: ConstrainedFloatValue, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cphaseshift)[source]
Bases:
SingleTarget,SingleControl,AngleControlled 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 braket.ir.jaqcd.instructions.CPhaseShift00(*, angle: ConstrainedFloatValue, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cphaseshift00)[source]
Bases:
SingleTarget,SingleControl,AngleControlled 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 braket.ir.jaqcd.instructions.CPhaseShift01(*, angle: ConstrainedFloatValue, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cphaseshift01)[source]
Bases:
SingleTarget,SingleControl,AngleControlled 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 braket.ir.jaqcd.instructions.CPhaseShift10(*, angle: ConstrainedFloatValue, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cphaseshift10)[source]
Bases:
SingleTarget,SingleControl,AngleControlled 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 braket.ir.jaqcd.instructions.CNot(*, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cnot)[source]
Bases:
SingleTarget,SingleControlControlled 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 braket.ir.jaqcd.instructions.CCNot(*, controls: ConstrainedListValue[ConstrainedIntValue], target: ConstrainedIntValue, type: Type = Type.ccnot)[source]
Bases:
SingleTarget,DoubleControlDoubly-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 braket.ir.jaqcd.instructions.CV(*, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cv)[source]
Bases:
SingleTarget,SingleControlControlled 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 braket.ir.jaqcd.instructions.CY(*, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cy)[source]
Bases:
SingleTarget,SingleControlControlled 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 braket.ir.jaqcd.instructions.CZ(*, control: ConstrainedIntValue, target: ConstrainedIntValue, type: Type = Type.cz)[source]
Bases:
SingleTarget,SingleControlControlled 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 braket.ir.jaqcd.instructions.ECR(*, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.ecr)[source]
Bases:
DoubleTargetAn 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 braket.ir.jaqcd.instructions.XX(*, angle: ConstrainedFloatValue, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.xx)[source]
Bases:
DoubleTarget,AngleThe 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 braket.ir.jaqcd.instructions.YY(*, angle: ConstrainedFloatValue, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.yy)[source]
Bases:
DoubleTarget,AngleThe 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 braket.ir.jaqcd.instructions.ZZ(*, angle: ConstrainedFloatValue, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.zz)[source]
Bases:
DoubleTarget,AngleThe 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 braket.ir.jaqcd.instructions.V(*, target: ConstrainedIntValue, type: Type = Type.v)[source]
Bases:
SingleTargetSquare 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 braket.ir.jaqcd.instructions.Vi(*, target: ConstrainedIntValue, type: Type = Type.vi)[source]
Bases:
SingleTargetConjugate 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 braket.ir.jaqcd.instructions.Unitary(*, targets: ConstrainedListValue[ConstrainedIntValue], matrix: ConstrainedListValue[ConstrainedListValue[ConstrainedListValue[ConstrainedFloatValue]]], type: Type = Type.unitary)[source]
Bases:
TwoDimensionalMatrix,MultiTargetArbitrary 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 braket.ir.jaqcd.instructions.BitFlip(*, probability: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.bit_flip)[source]
Bases:
SingleTarget,SingleProbabilityBit 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 braket.ir.jaqcd.instructions.PhaseFlip(*, probability: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.phase_flip)[source]
Bases:
SingleTarget,SingleProbabilityPhase 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 braket.ir.jaqcd.instructions.PauliChannel(*, probX: ConstrainedFloatValue, probY: ConstrainedFloatValue, probZ: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.pauli_channel)[source]
Bases:
SingleTarget,TripleProbabilityA 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 braket.ir.jaqcd.instructions.MultiQubitPauliChannel(*, probabilities: dict[ConstrainedStrValue, ConstrainedFloatValue], targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.multi_qubit_pauli_channel)[source]
Bases:
MultiTarget,MultiProbabilityMulti-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 braket.ir.jaqcd.instructions.Depolarizing(*, probability: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.depolarizing)[source]
Bases:
SingleTarget,SingleProbability_34Depolarizing 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 braket.ir.jaqcd.instructions.TwoQubitDepolarizing(*, probability: ConstrainedFloatValue, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.two_qubit_depolarizing)[source]
Bases:
DoubleTarget,SingleProbability_1516Two-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 braket.ir.jaqcd.instructions.TwoQubitDephasing(*, probability: ConstrainedFloatValue, targets: ConstrainedListValue[ConstrainedIntValue], type: Type = Type.two_qubit_dephasing)[source]
Bases:
DoubleTarget,SingleProbability_34Two-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 braket.ir.jaqcd.instructions.AmplitudeDamping(*, gamma: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.amplitude_damping)[source]
Bases:
SingleTarget,DampingProbabilityAmplitude 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 braket.ir.jaqcd.instructions.GeneralizedAmplitudeDamping(*, probability: ConstrainedFloatValue, gamma: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.generalized_amplitude_damping)[source]
Bases:
SingleTarget,DampingProbability,DampingSingleProbabilityGeneralized 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 braket.ir.jaqcd.instructions.PhaseDamping(*, gamma: ConstrainedFloatValue, target: ConstrainedIntValue, type: Type = Type.phase_damping)[source]
Bases:
SingleTarget,DampingProbabilityPhase 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 braket.ir.jaqcd.instructions.Kraus(*, targets: ConstrainedListValue[ConstrainedIntValue], matrices: ConstrainedListValue[ConstrainedListValue[ConstrainedListValue[ConstrainedListValue[ConstrainedFloatValue]]]], type: Type = Type.kraus)[source]
Bases:
TwoDimensionalMatrixList,MultiTargetArbitrary 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 braket.ir.jaqcd.instructions.StartVerbatimBox(*, directive: str = 'StartVerbatimBox', type: Type = Type.start_verbatim_box)[source]
Bases:
CompilerDirectiveStartVerbatimBox 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.
- directive: str
- class braket.ir.jaqcd.instructions.EndVerbatimBox(*, directive: str = 'EndVerbatimBox', type: Type = Type.end_verbatim_box)[source]
Bases:
CompilerDirectiveEndVerbatimBox 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.
- directive: str