pub struct DecisionDiagram { /* private fields */ }Expand description
Decision diagram representing quantum states and operations
Implementations§
Source§impl DecisionDiagram
impl DecisionDiagram
Sourcepub fn create_computational_basis_state(&mut self, bits: &[bool]) -> Edge
pub fn create_computational_basis_state(&mut self, bits: &[bool]) -> Edge
Create a computational basis state |x₁x₂…xₙ⟩
Sourcepub fn create_uniform_superposition(&mut self) -> Edge
pub fn create_uniform_superposition(&mut self) -> Edge
Create uniform superposition state |+⟩^⊗n
Sourcepub fn apply_single_qubit_gate(
&mut self,
gate_matrix: &Array2<Complex64>,
target: usize,
) -> Result<()>
pub fn apply_single_qubit_gate( &mut self, gate_matrix: &Array2<Complex64>, target: usize, ) -> Result<()>
Apply single-qubit gate
Sourcepub fn apply_cnot(&mut self, control: usize, target: usize) -> Result<()>
pub fn apply_cnot(&mut self, control: usize, target: usize) -> Result<()>
Apply two-qubit gate (simplified CNOT implementation)
Sourcepub fn to_state_vector(&self) -> Array1<Complex64>
pub fn to_state_vector(&self) -> Array1<Complex64>
Convert decision diagram to state vector
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get number of nodes in the diagram
Sourcepub fn memory_usage(&self) -> usize
pub fn memory_usage(&self) -> usize
Get memory usage estimate
Sourcepub fn clear_computed_table(&mut self)
pub fn clear_computed_table(&mut self)
Clear computed table (for memory management)
Sourcepub fn garbage_collect(&mut self)
pub fn garbage_collect(&mut self)
Garbage collect unused nodes
Sourcepub fn inner_product(&self, other: &Self) -> Complex64
pub fn inner_product(&self, other: &Self) -> Complex64
Compute inner product ⟨ψ₁|ψ₂⟩
Trait Implementations§
Source§impl Clone for DecisionDiagram
impl Clone for DecisionDiagram
Source§fn clone(&self) -> DecisionDiagram
fn clone(&self) -> DecisionDiagram
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DecisionDiagram
impl RefUnwindSafe for DecisionDiagram
impl Send for DecisionDiagram
impl Sync for DecisionDiagram
impl Unpin for DecisionDiagram
impl UnsafeUnpin for DecisionDiagram
impl UnwindSafe for DecisionDiagram
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.