pub struct QuantumLattice {
pub propositions: HashMap<u64, QuantumProposition>,
pub lattice_order: Vec<u64>,
}Expand description
Orthomodular lattice for quantum propositional logic Implements non-distributive quantum logic with orthocomplementation
Fields§
§propositions: HashMap<u64, QuantumProposition>§lattice_order: Vec<u64>Implementations§
Source§impl QuantumLattice
impl QuantumLattice
Sourcepub fn add_proposition(&mut self, prop: QuantumProposition)
pub fn add_proposition(&mut self, prop: QuantumProposition)
Add a quantum proposition to the lattice
Sourcepub fn orthocomplement(&self, prop_id: u64) -> Option<u64>
pub fn orthocomplement(&self, prop_id: u64) -> Option<u64>
Compute orthocomplement of a proposition (quantum NOT)
Sourcepub fn are_compatible(&self, prop1_id: u64, prop2_id: u64) -> bool
pub fn are_compatible(&self, prop1_id: u64, prop2_id: u64) -> bool
Check if two propositions are compatible (commuting observables)
Sourcepub fn quantum_and(&self, prop1_id: u64, prop2_id: u64) -> Option<u64>
pub fn quantum_and(&self, prop1_id: u64, prop2_id: u64) -> Option<u64>
Quantum AND operation (meet in orthomodular lattice)
Sourcepub fn quantum_or(&self, prop1_id: u64, prop2_id: u64) -> Option<u64>
pub fn quantum_or(&self, prop1_id: u64, prop2_id: u64) -> Option<u64>
Quantum OR operation (join in orthomodular lattice)
Sourcepub fn measure(&mut self, prop_id: u64) -> Option<QuantumTruthValue>
pub fn measure(&mut self, prop_id: u64) -> Option<QuantumTruthValue>
Apply measurement to collapse superposition
Trait Implementations§
Source§impl Clone for QuantumLattice
impl Clone for QuantumLattice
Source§fn clone(&self) -> QuantumLattice
fn clone(&self) -> QuantumLattice
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 moreSource§impl Debug for QuantumLattice
impl Debug for QuantumLattice
Source§impl PartialEq for QuantumLattice
impl PartialEq for QuantumLattice
Source§fn eq(&self, other: &QuantumLattice) -> bool
fn eq(&self, other: &QuantumLattice) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for QuantumLattice
impl StructuralPartialEq for QuantumLattice
Auto Trait Implementations§
impl Freeze for QuantumLattice
impl RefUnwindSafe for QuantumLattice
impl Send for QuantumLattice
impl Sync for QuantumLattice
impl Unpin for QuantumLattice
impl UnsafeUnpin for QuantumLattice
impl UnwindSafe for QuantumLattice
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more