[][src]Struct qmc::classical::graph::GraphState

pub struct GraphState { /* fields omitted */ }

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]

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]

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]

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

impl Debug for GraphState[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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