Source code for braket.ir.jaqcd.result_types

# Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
#     http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

from enum import Enum

from braket.ir.jaqcd.shared_models import EmptyListMultiState, EmptyListMultiTarget, Observable


[docs]class Expectation(EmptyListMultiTarget, Observable): """ Expectation of specified targets and observable as requested result. Attributes: type (str): The result type. default = "expectation". (type) is optional. This should be unique among all instruction types. targets (List[int]): The target qubits. This is a list of int >= 0. Examples: >>> Expectation(targets=[1], observable=["x"]) """
[docs] class Type(str, Enum): expectation = "expectation"
type = Type.expectation
[docs]class Sample(EmptyListMultiTarget, Observable): """ Sample for specified targets and observable as requested result. Attributes: type (str): The result type. default = "sample". (type) is optional. This should be unique among all instruction types. targets (List[int]): The target qubits. This is a list of int >= 0. observable (List[string]): A list with at least one item and items are strings matching the observable regex Examples: >>> Sample(targets=[1], observable=["x"]) """
[docs] class Type(str, Enum): sample = "sample"
type = Type.sample
[docs]class Variance(EmptyListMultiTarget, Observable): """ Variance of specified targets and observables as requested result. Attributes: type (str): The result type. default = "variance". (type) is optional. This should be unique among all instruction types. targets (List[int]): The target qubits. This is a list of int >= 0. observable (List[string]): A list with at least one item and items are strings matching the observable regex Examples: >>> Variance(targets=[1], observable=["x"]) """
[docs] class Type(str, Enum): variance = "variance"
type = Type.variance
[docs]class StateVector(EmptyListMultiTarget): """ State vector of specified states as requested result. Attributes: type (str): The result type. default = "statevector". (type) is optional. This should be unique among all instruction types. states (List[string]): Variable length list with with all strings matching the state regex Examples: >>> StateVector(states=["01", "10"]) """
[docs] class Type(str, Enum): statevector = "statevector"
type = Type.statevector
[docs]class Amplitude(EmptyListMultiState): """ Amplitudes of specified states as requested result. Attributes: type (str): The result type. default = "amplitude". (type) is optional. This should be unique among all instruction types. states (List[string]): Variable length list with with all strings matching the state regex Examples: >>> Amplitude(states=["01", "10"]) """
[docs] class Type(str, Enum): amplitude = "amplitude"
type = Type.amplitude
[docs]class Probability(EmptyListMultiTarget): """ Probability of specified targets as requested result. Attributes: type (str): The result type. default = "probability". (type) is optional. This should be unique among all instruction types. targets (List[int]): The target qubits. This is a list of int >= 0. Examples: >>> Probability(targets=[1, 2]) """
[docs] class Type(str, Enum): probability = "probability"
type = Type.probability