#[non_exhaustive]pub enum QubitRegisterOp {
Alloc = 0,
Free = 10,
FreeZero = 1,
ExtractIndex = 2,
InsertIndex = 3,
ExtractSlice = 4,
InsertSlice = 5,
Length = 6,
Split = 7,
Join = 8,
Create = 9,
}Expand description
An operation over qubit registers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Alloc = 0
Allocates a new qubit register given a number of qubits in the |0> state.
Free = 10
Frees a qubit register.
This operation makes no assumptions about the state of the qubits.
FreeZero = 1
Frees a qubit register, assuming that all qubits are in the |0> state.
It is undefined behavior to free a qubit register containing qubits that are not in the |0> state.
ExtractIndex = 2
Extracts a single qubit from a qubit register.
The slot must have been filled before and is marked as empty after the extraction.
InsertIndex = 3
Insert a single qubit into a qubit register.
The slot must have been empty before and is marked as filled after the insertion.
ExtractSlice = 4
Extract a slice of qubits from a qubit register given a range of indices.
All slots in the range are marked as empty in the original register.
InsertSlice = 5
Insert a slice of qubits into a qubit register.
All slots in the inserted range in the original register must have been empty.
Length = 6
Returns the length of the qubit register.
Split = 7
Splits a qubit register into two qubit registers at a given index.
Join = 8
Joins together two qubit registers into a single qubit register.
Create = 9
Creates a qubit register from a variable number of input qubits.
Trait Implementations§
Source§impl Clone for QubitRegisterOp
impl Clone for QubitRegisterOp
Source§fn clone(&self) -> QubitRegisterOp
fn clone(&self) -> QubitRegisterOp
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for QubitRegisterOp
Auto Trait Implementations§
impl Freeze for QubitRegisterOp
impl RefUnwindSafe for QubitRegisterOp
impl Send for QubitRegisterOp
impl Sync for QubitRegisterOp
impl Unpin for QubitRegisterOp
impl UnsafeUnpin for QubitRegisterOp
impl UnwindSafe for QubitRegisterOp
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