#[repr(i32)]pub enum OperationType {
Unknown = 0,
Hadamard = 1,
SqrtPauli = 2,
Prepare = 3,
Measure = 4,
Shuffle = 5,
Discard = 6,
ConditionalPauli = 7,
Pauli = 8,
ControlledPauli = 9,
}Variants§
Unknown = 0
Hadamard = 1
1 support, self-inverse
SqrtPauli = 2
1 support; Pauli is specified in the pauli field (1 char)
special handling of inversion, but in terms of displaying, just add ^{-1}
Prepare = 3
1 support; Pauli string is specified in the pauli field (together with
sign)
- expecting 1 + 1 length pauli string(the first letter is + or -) not invertible
Measure = 4
N support; Pauli string and correction string is specified in the pauli
field
- expecting N+1 length pauli string, first half characters (the first letter is + or -) optionally, append ‘%’ + (N+1)-length correction (otherwise the correction is identity)
- optionally, the labels can be encoded in a JSON array appended to the string these labels correspond to where the measurement results are stored (to some extent) only invertible when the correction is identity, its inverse is itself
Shuffle = 5
2N support, special inverse: qubit 2i is mapped to qubit 2i+1, for all i in range(N) SWAP is a special case of shuffle
Discard = 6
1 support, not invertible
ConditionalPauli = 7
N support, self-inverse; Pauli string is specified in the pauli field
- expecting N+1 length pauli string (the first letter is + or -, given self._negate) the labels are appended after the first N+1 letters, in JSON array format
Pauli = 8
1 support, self-inverse; 1 pauli
ControlledPauli = 9
2 supports: control and target; Pauli is specified in the pauli field (1
char) self-inverse
Implementations§
Source§impl OperationType
impl OperationType
Source§impl OperationType
impl OperationType
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for OperationType
impl Clone for OperationType
impl Copy for OperationType
Source§impl Debug for OperationType
impl Debug for OperationType
Source§impl Default for OperationType
impl Default for OperationType
Source§fn default() -> OperationType
fn default() -> OperationType
impl Eq for OperationType
Source§impl From<OperationType> for i32
impl From<OperationType> for i32
Source§fn from(value: OperationType) -> i32
fn from(value: OperationType) -> i32
Source§impl Hash for OperationType
impl Hash for OperationType
Source§impl Ord for OperationType
impl Ord for OperationType
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for OperationType
impl PartialEq for OperationType
Source§impl PartialOrd for OperationType
impl PartialOrd for OperationType
impl StructuralPartialEq for OperationType
Source§impl TryFrom<i32> for OperationType
impl TryFrom<i32> for OperationType
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
Source§fn try_from(value: i32) -> Result<OperationType, UnknownEnumValue>
fn try_from(value: i32) -> Result<OperationType, UnknownEnumValue>
Auto Trait Implementations§
impl Forget for OperationType
impl Freeze for OperationType
impl Move for OperationType
impl RefUnwindSafe for OperationType
impl Send for OperationType
impl Sync for OperationType
impl Unpin for OperationType
impl UnsafeUnpin for OperationType
impl UnwindSafe for OperationType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request