pub struct PhaseSpace {
pub n: usize,
pub mul: Vec<Vec<usize>>,
pub identity: usize,
pub bot: Vec<bool>,
}Expand description
A phase space: a commutative monoid (M, ·, e) with distinguished subset bot. We represent M as integers mod p for concreteness.
Fields§
§n: usizeElements of the monoid (indices 0..n).
mul: Vec<Vec<usize>>Multiplication table: mul[i][j] = i · j.
identity: usizeIdentity element.
bot: Vec<bool>The distinguished subset ⊥ ⊆ M.
Implementations§
Source§impl PhaseSpace
impl PhaseSpace
Sourcepub fn new(_name: &str) -> Self
pub fn new(_name: &str) -> Self
Create a named trivial phase space {e} with ⊥ = {e}.
The _name parameter is informational only.
Sourcepub fn completeness_description(&self) -> String
pub fn completeness_description(&self) -> String
Description of completeness for phase semantics.
Sourcepub fn closure(&self, subset: &[bool]) -> Vec<bool>
pub fn closure(&self, subset: &[bool]) -> Vec<bool>
Closure A^⊥⊥: double orthogonal of a subset A ⊆ M. First computes A^⊥ = {m | ∀ a ∈ A, m·a ∈ ⊥}, then its orthogonal.
Sourcepub fn orthogonal(&self, subset: &[bool]) -> Vec<bool>
pub fn orthogonal(&self, subset: &[bool]) -> Vec<bool>
Orthogonal: A^⊥ = {m | ∀ a ∈ A, m·a ∈ ⊥}.
Sourcepub fn is_fact(&self, subset: &[bool]) -> bool
pub fn is_fact(&self, subset: &[bool]) -> bool
Check whether a subset is a fact (= ⊥-closed, i.e., A = A^⊥⊥).
Sourcepub fn subset_size(subset: &[bool]) -> usize
pub fn subset_size(subset: &[bool]) -> usize
Count elements in a subset.
Trait Implementations§
Source§impl Clone for PhaseSpace
impl Clone for PhaseSpace
Source§fn clone(&self) -> PhaseSpace
fn clone(&self) -> PhaseSpace
Returns a duplicate of the value. Read more
1.0.0 · 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 PhaseSpace
impl RefUnwindSafe for PhaseSpace
impl Send for PhaseSpace
impl Sync for PhaseSpace
impl Unpin for PhaseSpace
impl UnsafeUnpin for PhaseSpace
impl UnwindSafe for PhaseSpace
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