Struct qmc::sse::qmc_runner::Qmc[][src]

pub struct Qmc<R, M> where
    R: Rng,
    M: QmcManager
{ /* fields omitted */ }
Expand description

A manager for QMC and interactions.

Implementations

impl<R: Rng, M: QmcManager> Qmc<R, M>[src]

pub fn new(nvars: usize, rng: R, do_loop_updates: bool) -> Self[src]

Make a new QMC instance with nvars.

pub fn new_with_state<I: Into<Vec<bool>>>(
    nvars: usize,
    rng: R,
    state: I,
    do_loop_updates: bool
) -> Self
[src]

Make a new QMC instance with nvars.

pub fn new_with_state_with_manager_hook<F, I: Into<Vec<bool>>>(
    nvars: usize,
    rng: R,
    state: I,
    do_loop_updates: bool,
    f: F
) -> Self where
    F: Fn(usize) -> M, 
[src]

Make a new QMC instance with nvars. Allows hooking into manager construction with f.

pub fn get_bonds(&self) -> &[Interaction][src]

Get interactions.

pub fn make_interaction<MAT: Into<Vec<f64>>, VAR: Into<Vec<usize>>>(
    &mut self,
    mat: MAT,
    vars: VAR
) -> Result<(), String>
[src]

Add an interaction to the QMC instance.

pub fn make_interaction_and_offset<MAT: Into<Vec<f64>>, VAR: Into<Vec<usize>>>(
    &mut self,
    mat: MAT,
    vars: VAR
) -> Result<(), String>
[src]

Add an interaction to the QMC instance, adjust with a diagonal offset.

pub fn make_diagonal_interaction<MAT: Into<Vec<f64>>, VAR: Into<Vec<usize>>>(
    &mut self,
    mat: MAT,
    vars: VAR
) -> Result<(), String>
[src]

Add an interaction to the QMC instance.

pub fn make_diagonal_interaction_and_offset<MAT: Into<Vec<f64>>, VAR: Into<Vec<usize>>>(
    &mut self,
    mat: MAT,
    vars: VAR
) -> Result<(), String>
[src]

Add an interaction to the QMC instance, adjust with a diagonal offset.

pub fn diagonal_update(&mut self, beta: f64)[src]

Perform a single diagonal update.

pub fn loop_update(&mut self)[src]

Perform a single loop update. Will be inefficient without XX terms.

pub fn cluster_update(&mut self) -> Result<(), &str>[src]

Flip spins using quantum cluster updates if QMC has ising symmetry.

pub fn flip_free_bits(&mut self)[src]

Flip spins using thermal fluctuations.

pub fn set_do_heatbath(&mut self, do_heatbath: bool)[src]

Enable or disable the heatbath diagonal update.

pub fn should_do_heatbath(&self) -> bool[src]

Should the model do heatbath diagonal updates.

pub fn set_do_loop_updates(&mut self, do_loop_updates: bool)[src]

Change whether loop updates will be performed.

pub fn should_do_loop_update(&self) -> bool[src]

Should the model do loop updates.

pub fn should_do_cluster_update(&self) -> bool[src]

Should the model do cluster updates.

pub fn into_vec(self) -> Vec<bool>[src]

Convert the state to a vector.

pub fn get_offset(&self) -> f64[src]

Get the total energy offset.

pub fn get_manager_ref(&self) -> &M[src]

Get a reference to the diagonal op manager.

pub fn get_cutoff(&self) -> usize[src]

Get the cutoff.

pub fn set_cutoff(&mut self, cutoff: usize)[src]

Set the cutoff to a new value

pub fn increase_cutoff_to(&mut self, cutoff: usize)[src]

Set the cutoff to a new value so long as that new value is larger than the old one.

pub fn can_swap_managers(&self, other: &Self) -> Result<(), String>[src]

Check if two instances can safely swap managers and initial states

pub fn swap_manager_and_state(&mut self, other: &mut Self)[src]

Swap managers and initial states

pub fn clone_state(&self) -> Vec<bool>[src]

Clone the state at p=0.

Trait Implementations

impl<R, M> Clone for Qmc<R, M> where
    R: Rng + Clone,
    M: QmcManager + Clone
[src]

fn clone(&self) -> Self[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<R: Debug, M: Debug> Debug for Qmc<R, M> where
    R: Rng,
    M: QmcManager
[src]

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

Formats the value using the given formatter. Read more

impl<R, M> From<QmcIsingGraph<R, M>> for Qmc<R, M> where
    R: Rng,
    M: IsingManager + QmcManager
[src]

fn from(g: QmcIsingGraph<R, M>) -> Self[src]

Performs the conversion.

impl<R, M> QmcStepper for Qmc<R, M> where
    R: Rng,
    M: QmcManager
[src]

fn timestep(&mut self, beta: f64) -> &[bool][src]

Take a single QMC step and return a reference to the state

fn get_n(&self) -> usize[src]

Get the current number of operators in the graph

fn get_energy_for_average_n(&self, average_n: f64, beta: f64) -> f64[src]

Get the average energy given the average number of ops and beta.

fn state_ref(&self) -> &[bool][src]

Get a reference to the state.

fn get_bond_count(&self, bond: usize) -> usize[src]

Get the number of a given bond

fn imaginary_time_fold<F, T>(&self, fold_fn: F, init: T) -> T where
    F: Fn(T, &[bool]) -> T, 
[src]

Fold through imaginary time states.

fn timesteps(&mut self, t: usize, beta: f64) -> f64[src]

Take t qmc timesteps at beta.

fn timesteps_sample(
    &mut self,
    t: usize,
    beta: f64,
    sampling_freq: Option<usize>
) -> (Vec<Vec<bool>>, f64)
[src]

Take t qmc timesteps at beta and sample states.

fn timesteps_sample_iter<F>(
    &mut self,
    t: usize,
    beta: f64,
    sampling_freq: Option<usize>,
    iter_fn: F
) -> f64 where
    F: Fn(&[bool]), 
[src]

Take t qmc timesteps at beta and sample states, apply f to each.

fn timesteps_sample_iter_zip<F, I, T>(
    &mut self,
    t: usize,
    beta: f64,
    sampling_freq: Option<usize>,
    zip_with: I,
    iter_fn: F
) -> f64 where
    F: Fn(T, &[bool]),
    I: IntoIterator<Item = T>, 
[src]

Take t qmc timesteps at beta and sample states, apply f to each and the zipped iterator.

fn timesteps_measure<F, T>(
    &mut self,
    timesteps: usize,
    beta: f64,
    init_t: T,
    state_fold: F,
    sampling_freq: Option<usize>
) -> (T, f64) where
    F: Fn(T, &[bool]) -> T, 
[src]

Take t qmc timesteps at beta and sample states, fold across states and output results.

fn timesteps_iter_zip_with_self<F, I, T>(
    &mut self,
    t: usize,
    beta: f64,
    sampling_freq: Option<usize>,
    zip_with: I,
    iter_fn: F
) -> f64 where
    F: Fn(T, &Self),
    I: IntoIterator<Item = T>, 
[src]

Take t qmc timesteps at beta and sample states, apply f to each and the zipped iterator.

fn timesteps_measure_with_self<F, T>(
    &mut self,
    timesteps: usize,
    beta: f64,
    init_t: T,
    state_fold: F,
    sampling_freq: Option<usize>
) -> (T, f64) where
    F: Fn(T, &Self) -> T, 
[src]

Take t qmc timesteps at beta and sample states, fold across states and output results.

Auto Trait Implementations

impl<R, M> RefUnwindSafe for Qmc<R, M> where
    M: RefUnwindSafe,
    R: RefUnwindSafe

impl<R, M> Send for Qmc<R, M> where
    M: Send,
    R: Send

impl<R, M> Sync for Qmc<R, M> where
    M: Sync,
    R: Sync

impl<R, M> Unpin for Qmc<R, M> where
    M: Unpin,
    R: Unpin

impl<R, M> UnwindSafe for Qmc<R, M> where
    M: UnwindSafe,
    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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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