braket.ir.jaqcd.results module¶
-
class
braket.ir.jaqcd.results.
Expectation
[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"])
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.results.
AdjointGradient
[source]¶ Bases:
braket.ir.jaqcd.shared_models.OptionalNestedMultiTarget
,braket.ir.jaqcd.shared_models.Observable
,braket.ir.jaqcd.shared_models.OptionalMultiParameter
Adjoint Gradient as requested result. .. attribute:: type
The result type. default = “adjoint_gradient”. (type) is optional. This should be unique among all result types.
type: str -
targets
¶ The target qubits. This is a two dimensional nested list of ints >= 0.
Type: Optional[List[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]]]]
-
parameters
¶ The parameters used in the adjoint gradient calculation. This is a list of parameter names. Default: all parameters.
Type: List[str]
Examples
>>> AdjointGradient( >>> targets=[[1, 2], [3]], >>> observable=["2 * x @ y + z"], >>> parameters=["theta", "beta"] >>> )
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.results.
Sample
[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"])
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.results.
Variance
[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"])
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.results.
StateVector
[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()
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.results.
DensityMatrix
[source]¶ Bases:
braket.ir.jaqcd.shared_models.OptionalMultiTarget
The density matrix as requested result.
-
type
¶ The result type. default = “densitymatrix”. (type) is optional. This should be unique among all result types.
Type: str
-
targets
¶ The target qubits of the reduced density matrix.
Type: Optional[List[int]]
-
This is a list of int >= 0.
Examples
>>> DensityMatrix()
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.results.
Amplitude
[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"])
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.results.
Probability
[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])
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.