[−][src]Struct qip::qubits::Qubit
A qubit object, possible representing multiple physical qubit indices.
Fields
indices: Vec<u64>
The set of indices represented by this qubit.
parent: Option<Parent>
The parent(s) of this qubit (prior in time in the quantum circuit).
deps: Option<Vec<Rc<Qubit>>>
Additional dependencies for this qubit (such as if it relies on the classical measurements of other qubits).
id: u64
The unique ID of this qubit.
Methods
impl Qubit
[src]
pub fn handle(&self) -> QubitHandle
[src]
Create a handle for feeding values.
pub fn merge_with_modifier(
id: u64,
qubits: Vec<Qubit>,
modifier: Option<StateModifier>
) -> Qubit
[src]
id: u64,
qubits: Vec<Qubit>,
modifier: Option<StateModifier>
) -> Qubit
Merge qubits to for a new qubit object.
pub fn split(
ida: u64,
idb: u64,
q: Qubit,
indices: Vec<u64>
) -> Result<(Qubit, Qubit), &'static str>
[src]
ida: u64,
idb: u64,
q: Qubit,
indices: Vec<u64>
) -> Result<(Qubit, Qubit), &'static str>
Split the relative indices out of q
into its own qubit, remaining live in second qubit.
pub fn split_absolute(
ida: u64,
idb: u64,
q: Qubit,
selected_indices: Vec<u64>
) -> Result<(Qubit, Qubit), &'static str>
[src]
ida: u64,
idb: u64,
q: Qubit,
selected_indices: Vec<u64>
) -> Result<(Qubit, Qubit), &'static str>
Split a qubit in two, with one having the indices in selected_indices
pub fn make_measurement_handle(id: u64, q: Qubit) -> (Qubit, MeasurementHandle)
[src]
Make a measurement handle and a qubit which depends on that measurement.
pub fn add_deps(q: Qubit, deps: Vec<Rc<Qubit>>) -> Qubit
[src]
Add additional qubit dependencies to a given qubit.
pub fn n(&self) -> u64
[src]
Get number of qubits in this Qubit object
Trait Implementations
impl Ord for Qubit
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl PartialOrd<Qubit> for Qubit
[src]
fn partial_cmp(&self, other: &Qubit) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialEq<Qubit> for Qubit
[src]
fn eq(&self, other: &Qubit) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for Qubit
[src]
impl Debug for Qubit
[src]
Auto Trait Implementations
impl !Sync for Qubit
impl !Send for Qubit
impl Unpin for Qubit
impl !RefUnwindSafe for Qubit
impl !UnwindSafe for Qubit
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,