[−][src]Struct qmc::classical::graph::GraphState
A graph definition for use in classical monte carlo.
Implementations
impl GraphState
[src]
pub fn new(edges: &[(Edge, f64)], biases: &[f64]) -> Self
[src]
Make a new Graph from a list of edges [((vara, varb), j), ...]
and longitudinal fields.
pub fn new_with_state(
state: Vec<bool>,
edges: &[(Edge, f64)],
biases: &[f64]
) -> Self
[src]
state: Vec<bool>,
edges: &[(Edge, f64)],
biases: &[f64]
) -> Self
Make a new graph with an initial state, edges, and longitudinal fields.
pub fn do_spin_flip(
rng: &mut ThreadRng,
beta: f64,
binding_mat: &[Vec<(usize, f64)>],
biases: &[f64],
state: &mut [bool]
)
[src]
rng: &mut ThreadRng,
beta: f64,
binding_mat: &[Vec<(usize, f64)>],
biases: &[f64],
state: &mut [bool]
)
Perform a random single spin flip.
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 ThreadRng, 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]
&mut self,
beta: f64,
only_basic_moves: bool
) -> Result<(), String>
Perform a monte carlo time step.
pub fn get_state(self) -> Vec<bool>
[src]
Get the spin state.
pub fn clone_state(&self) -> Vec<bool>
[src]
Clone the spin state.
pub fn state_ref(&self) -> &[bool]
[src]
Get a ref of the spin state.
pub fn set_state(&mut self, state: Vec<bool>)
[src]
Overwrite the spin state.
pub fn get_energy(&self) -> f64
[src]
Get the energy of the system.
pub fn make_random_spin_state(n: usize) -> Vec<bool>
[src]
Randomly build a spin state.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for GraphState
[src]
impl Send for GraphState
[src]
impl Sync for GraphState
[src]
impl Unpin for GraphState
[src]
impl UnwindSafe for GraphState
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,