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]

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]

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]

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 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]

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.

Trait Implementations

impl<R: Rng> Debug for GraphState<R>[src]

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

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<R> RefUnwindSafe for GraphState<R> where
    R: RefUnwindSafe

impl<R> Send for GraphState<R> where
    R: Send

impl<R> Sync for GraphState<R> where
    R: Sync

impl<R> Unpin for GraphState<R> where
    R: Unpin

impl<R> UnwindSafe for GraphState<R> where
    R: UnwindSafe

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

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

Performs the conversion.

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.

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

Performs the conversion.

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

pub fn vzip(self) -> V