Struct qmc::classical::graph::GraphState [−][src]
pub struct GraphState<R: Rng> { /* fields omitted */ }
Expand description
A graph definition for use in classical monte carlo.
Implementations
impl<R: Rng> GraphState<R>
[src]
impl<R: Rng> GraphState<R>
[src]pub fn new(edges: &[(Edge, f64)], biases: &[f64], rng: R) -> Self
[src]
pub fn new(edges: &[(Edge, f64)], biases: &[f64], rng: R) -> Self
[src]Make a new Graph from a list of edges [((vara, varb), j), ...]
and longitudinal fields.
pub fn new_with_state_and_rng(
state: Vec<bool>,
edges: &[(Edge, f64)],
biases: &[f64],
rng: R
) -> Self
[src]
pub fn new_with_state_and_rng(
state: Vec<bool>,
edges: &[(Edge, f64)],
biases: &[f64],
rng: R
) -> Self
[src]Make a new graph with an initial state, edges, and longitudinal fields.
pub fn do_spin_flip(
rng: &mut R,
beta: f64,
binding_mat: &[Vec<(usize, f64)>],
biases: &[f64],
state: &mut [bool]
)
[src]
pub fn do_spin_flip(
rng: &mut R,
beta: f64,
binding_mat: &[Vec<(usize, f64)>],
biases: &[f64],
state: &mut [bool]
)
[src]Perform a random single spin flip.
pub fn enable_edge_importance_sampling(&mut self, enable: bool)
[src]
pub fn enable_edge_importance_sampling(&mut self, enable: bool)
[src]Use the weights of edges to decide how frequently to flip them.
pub fn should_flip(rng: &mut R, beta: f64, delta_e: f64) -> bool
[src]
pub fn should_flip(rng: &mut R, beta: f64, delta_e: f64) -> bool
[src]Randomly choose if a step should be made based on temperature and energy change.
pub fn do_time_step(
&mut self,
beta: f64,
only_basic_moves: bool
) -> Result<(), String>
[src]
pub fn do_time_step(
&mut self,
beta: f64,
only_basic_moves: bool
) -> Result<(), String>
[src]Perform a monte carlo time step.
pub fn clone_state(&self) -> Vec<bool>
[src]
pub fn clone_state(&self) -> Vec<bool>
[src]Clone the spin state.
pub fn get_energy(&self) -> f64
[src]
pub fn get_energy(&self) -> f64
[src]Get the energy of the system.
Trait Implementations
Auto Trait Implementations
impl<R> RefUnwindSafe for GraphState<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for GraphState<R> where
R: Send,
R: Send,
impl<R> Sync for GraphState<R> where
R: Sync,
R: Sync,
impl<R> Unpin for GraphState<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for GraphState<R> where
R: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,