EntangledSystem

Struct EntangledSystem 

Source
pub struct EntangledSystem {
    pub graph: FractalGraph<()>,
    pub particles: Vec<ParticleResonance>,
    pub grid_width: u64,
    pub grid_height: u64,
    pub adjacency_list: Vec<Vec<usize>>,
    pub particle_states: Vec<f64>,
}

Fields§

§graph: FractalGraph<()>§particles: Vec<ParticleResonance>§grid_width: u64§grid_height: u64§adjacency_list: Vec<Vec<usize>>§particle_states: Vec<f64>

Implementations§

Source§

impl EntangledSystem

Source

pub fn new(width: u64, height: u64, adjacency_list: Vec<Vec<usize>>) -> Self

Creates a new simulation environment with two entangled particles.

Source

pub fn update_curvature(&mut self, threshold: f64, max_distance: u32)

Modifies the graph’s topology based on the energy in particle_states. This simulates “curvature”. Modifies the graph’s topology based on the energy in particle_states.

Source

pub fn apply_pulses(&mut self, sources: &[PulseSource])

Applies the combined interference pattern from multiple pulse sources.

Source

pub fn bfs_distances(&self, start_node: usize) -> Vec<Option<u32>>

Calculates the shortest path distances from a start node to all other nodes in a graph.

§Arguments
  • start_node - The index of the node to start the search from.
  • adjacency_list - A reference to the graph’s structure.
§Returns

A vector where each index corresponds to a node and the value is the distance from the start_node. None if the node is unreachable. Calculates shortest path distances from a start node (BFS). Calculates shortest path distances from a start node (BFS).

Source

pub fn apply_pulse(&mut self, pulse: &EntropyPulse)

Applies a pulse to the entire system, causing decoherence. Applies a pulse to the entire system, causing decoherence.

Source

pub fn measure_correlation(&mut self) -> FeedbackSignal

Performs a simulated measurement and returns the correlation feedback.

Trait Implementations§

Source§

impl Debug for EntangledSystem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V