pub enum Type {
Qubit,
QubitRegister,
Int {
bits: u8,
},
IntArray {
bits: u8,
},
Float {
precision: FloatPrecision,
},
FloatArray {
precision: FloatPrecision,
},
}
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.
The length of the register is not known at compile time, but fixed at runtime.
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.
The length of the array is not known at compile time, but fixed at runtime.
Arrays of integers of bitwidth 1 can be used as classical bit arrays.
Float
Floating point numbers.
Fields
precision: FloatPrecision
Precision of the floating point number.
FloatArray
Array of floating point numbers.
The length of the array is not known at compile time, but fixed at runtime.
Fields
precision: FloatPrecision
Precision of the floating point numbers.
Implementations§
Source§impl Type
impl Type
Sourcepub fn float(precision: FloatPrecision) -> Self
pub fn float(precision: FloatPrecision) -> Self
Create a new floating point type.
Sourcepub fn float_array(precision: FloatPrecision) -> Self
pub fn float_array(precision: FloatPrecision) -> Self
Create a new floating point array type.
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 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