braket.ir.jaqcd.results module

class braket.ir.jaqcd.results.Expectation(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.OptionalMultiTarget, braket.ir.jaqcd.shared_models.Observable

Expectation of specified targets and observable as requested result. If no targets are specified, the observable must only operate on 1 qubit and it will be applied to all qubits in parallel. Otherwise, the number of specified targets must be equivalent to the number of qubits the observable can be applied to.

type

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

Type

str

targets

The target qubits. This is a list of int >= 0.

Type

Optional[List[int]]

observable

A list with at least one item and items are strings matching the observable regex or a two dimensional hermitian matrix with complex entries. Each complex number is represented using a List[float] of size 2, with element[0] being the real part and element[1] imaginary. inf, -inf, and NaN are not allowable inputs for the element.

Type

List[Union[str, List[List[List[float]]]]

Examples

>>> Expectation(targets=[1], observable=["x"])
class Type[source]

Bases: str, enum.Enum

An enumeration.

expectation = 'expectation'
targets = None
class braket.ir.jaqcd.results.Sample(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.OptionalMultiTarget, braket.ir.jaqcd.shared_models.Observable

Sample for specified targets and observable as requested result. If no targets are specified, the observable must only operate on 1 qubit and it will be applied to all qubits in parallel. Otherwise, the number of specified targets must be equivalent to the number of qubits the observable can be applied to.

type

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

Type

str

targets

The target qubits. This is a list of int >= 0.

Type

Optional[List[int]]

observable

A list with at least one item and items are strings matching the observable regex or a two dimensional hermitian matrix with complex entries. Each complex number is represented using a List[float] of size 2, with element[0] being the real part and element[1] imaginary. inf, -inf, and NaN are not allowable inputs for the element.

Type

List[Union[str, List[List[List[float]]]]

Examples

>>> Sample(targets=[1], observable=["x"])
class Type[source]

Bases: str, enum.Enum

An enumeration.

sample = 'sample'
targets = None
class braket.ir.jaqcd.results.Variance(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.OptionalMultiTarget, braket.ir.jaqcd.shared_models.Observable

Variance of specified targets and observables as requested result. If no targets are specified, the observable must only operate on 1 qubit and it will be applied to all qubits in parallel. Otherwise, the number of specified targets must be equivalent to the number of qubits the observable can be applied to.

type

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

Type

str

targets

The target qubits. This is a list of int >= 0.

Type

List[int]

observable

A list with at least one item and items are strings matching the observable regex or a two dimensional hermitian matrix with complex entries. Each complex number is represented using a List[float] of size 2, with element[0] being the real part and element[1] imaginary. inf, -inf, and NaN are not allowable inputs for the element.

Type

List[Union[str, List[List[List[float]]]]

Examples

>>> Variance(targets=[1], observable=["x"])
class Type[source]

Bases: str, enum.Enum

An enumeration.

variance = 'variance'
targets = None
class braket.ir.jaqcd.results.StateVector(**data: Any)[source]

Bases: pydantic.main.BaseModel

The full state vector as requested result.

type

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

Type

str

Examples

>>> StateVector()
class Type[source]

Bases: str, enum.Enum

An enumeration.

statevector = 'statevector'
class braket.ir.jaqcd.results.Amplitude(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.MultiState

Amplitudes of specified states as requested result.

type

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

Type

str

states

Variable length list with with all strings matching the state regex

Type

List[string]

Examples

>>> Amplitude(states=["01", "10"])
class Type[source]

Bases: str, enum.Enum

An enumeration.

amplitude = 'amplitude'
states = None
class braket.ir.jaqcd.results.Probability(**data: Any)[source]

Bases: braket.ir.jaqcd.shared_models.OptionalMultiTarget

Probability of all states if no targets are specified or the marginal probability

of a restricted set of states if only a subset of all qubits are specified as targets

type

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

Type

str

targets

The target qubits. This is a list of int >= 0.

Type

Optional[List[int]]

Examples

>>> Probability(targets=[1, 2])
class Type[source]

Bases: str, enum.Enum

An enumeration.

probability = 'probability'
targets = None