pub enum Type {
Qubit,
QubitRegister {
length: Option<u32>,
},
Int {
bits: u8,
},
IntArray {
bits: u8,
length: Option<u32>,
},
Float {
precision: FloatPrecision,
},
FloatArray {
precision: FloatPrecision,
length: Option<u32>,
},
}Expand description
Value type.
Variants§
Qubit
Quantum bit.
Qubits are linear types.
QubitRegister
Quantum registers.
A quantum register is an array of slots that can hold qubits. Slots of a quantum register can either be empty or filled with a qubit.
Quantum registers are linear types.
If length is None, the register has dynamic length.
If Some, the register has static compile-time length.
Int
Integers.
The type does not distinguish between signed and unsigned integers. Instead it is up to the operation to interpret the integer as signed or unsigned. Signed integers are represented using two’s complement.
Integers of bitwidth 1 can be used as classical bits or boolean values.
IntArray
Integer array.
Arrays of integers of bitwidth 1 can be used as classical bit arrays.
If length is None, the array has dynamic length.
If Some, the array has static compile-time length.
Float
Floating point numbers.
Fields
precision: FloatPrecisionPrecision of the floating point number.
FloatArray
Array of floating point numbers.
If length is None, the array has dynamic length.
If Some, the array has static compile-time length.
Fields
precision: FloatPrecisionPrecision of the floating point numbers.
Implementations§
Source§impl Type
impl Type
Sourcepub fn int_array(bits: u8, length: Option<u32>) -> Self
pub fn int_array(bits: u8, length: Option<u32>) -> Self
Create a new integer array type.
If length is None, the array has dynamic length.
If Some, the array has static compile-time length.
Sourcepub fn float(precision: FloatPrecision) -> Self
pub fn float(precision: FloatPrecision) -> Self
Create a new floating point type.
Sourcepub fn float_array(precision: FloatPrecision, length: Option<u32>) -> Self
pub fn float_array(precision: FloatPrecision, length: Option<u32>) -> Self
Create a new floating point array type.
If length is None, the array has dynamic length.
If Some, the array has static compile-time length.
Trait Implementations§
impl Copy for Type
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnsafeUnpin for Type
impl UnwindSafe for Type
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<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 more