pub struct DDSimulator { /* private fields */ }
Expand description
Decision diagram-based quantum simulator
Implementations§
Source§impl DDSimulator
impl DDSimulator
Sourcepub fn with_scirs2_backend(self) -> Result<Self>
pub fn with_scirs2_backend(self) -> Result<Self>
Initialize with SciRS2 backend
Sourcepub fn set_initial_state(&mut self, bits: &[bool]) -> Result<()>
pub fn set_initial_state(&mut self, bits: &[bool]) -> Result<()>
Set initial state
Sourcepub fn set_uniform_superposition(&mut self)
pub fn set_uniform_superposition(&mut self)
Set to uniform superposition
Sourcepub fn apply_hadamard(&mut self, target: usize) -> Result<()>
pub fn apply_hadamard(&mut self, target: usize) -> Result<()>
Apply Hadamard gate
Sourcepub fn apply_pauli_x(&mut self, target: usize) -> Result<()>
pub fn apply_pauli_x(&mut self, target: usize) -> Result<()>
Apply Pauli X gate
Sourcepub fn get_state_vector(&self) -> Array1<Complex64>
pub fn get_state_vector(&self) -> Array1<Complex64>
Get current state vector
Sourcepub fn get_measurement_probability(&self, qubit: usize, outcome: bool) -> f64
pub fn get_measurement_probability(&self, qubit: usize, outcome: bool) -> f64
Get probability of measuring |0⟩ or |1⟩ for a qubit
Sourcepub fn garbage_collect(&mut self)
pub fn garbage_collect(&mut self)
Periodic garbage collection
Sourcepub fn is_classical_state(&self) -> bool
pub fn is_classical_state(&self) -> bool
Check if state is classical (all amplitudes real and positive)
Sourcepub fn estimate_entanglement(&self) -> f64
pub fn estimate_entanglement(&self) -> f64
Estimate entanglement (simplified)
Auto Trait Implementations§
impl Freeze for DDSimulator
impl !RefUnwindSafe for DDSimulator
impl Send for DDSimulator
impl Sync for DDSimulator
impl Unpin for DDSimulator
impl !UnwindSafe for DDSimulator
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
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
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.