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]
impl<R: Rng, M: QmcManager> Qmc<R, M>
[src]pub fn new(nvars: usize, rng: R, do_loop_updates: bool) -> Self
[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]
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]
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]
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]
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]
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]
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]
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]
pub fn diagonal_update(&mut self, beta: f64)
[src]Perform a single diagonal update.
pub fn loop_update(&mut self)
[src]
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]
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]
pub fn flip_free_bits(&mut self)
[src]Flip spins using thermal fluctuations.
pub fn set_do_heatbath(&mut self, do_heatbath: bool)
[src]
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]
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]
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]
pub fn should_do_loop_update(&self) -> bool
[src]Should the model do loop updates.
pub fn should_do_cluster_update(&self) -> bool
[src]
pub fn should_do_cluster_update(&self) -> bool
[src]Should the model do cluster updates.
pub fn get_offset(&self) -> f64
[src]
pub fn get_offset(&self) -> f64
[src]Get the total energy offset.
pub fn get_manager_ref(&self) -> &M
[src]
pub fn get_manager_ref(&self) -> &M
[src]Get a reference to the diagonal op manager.
pub fn get_cutoff(&self) -> usize
[src]
pub fn get_cutoff(&self) -> usize
[src]Get the cutoff.
pub fn set_cutoff(&mut self, cutoff: usize)
[src]
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]
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]
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]
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]
pub fn clone_state(&self) -> Vec<bool>
[src]Clone the state at p=0.
Trait Implementations
impl<R, M> From<QmcIsingGraph<R, M>> for Qmc<R, M> where
R: Rng,
M: IsingManager + QmcManager,
[src]
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]
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]
impl<R, M> QmcStepper for Qmc<R, M> where
R: Rng,
M: QmcManager,
[src]fn timestep(&mut self, beta: f64) -> &[bool]
[src]
fn timestep(&mut self, beta: f64) -> &[bool]
[src]Take a single QMC step and return a reference to the state
fn get_energy_for_average_n(&self, average_n: f64, beta: f64) -> f64
[src]
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 get_bond_count(&self, bond: usize) -> usize
[src]
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]
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_sample(
&mut self,
t: usize,
beta: f64,
sampling_freq: Option<usize>
) -> (Vec<Vec<bool>>, f64)
[src]
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]
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]
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]
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]
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.
Auto Trait Implementations
impl<R, M> RefUnwindSafe for Qmc<R, M> where
M: RefUnwindSafe,
R: RefUnwindSafe,
M: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, M> Send for Qmc<R, M> where
M: Send,
R: Send,
M: Send,
R: Send,
impl<R, M> Sync for Qmc<R, M> where
M: Sync,
R: Sync,
M: Sync,
R: Sync,
impl<R, M> Unpin for Qmc<R, M> where
M: Unpin,
R: Unpin,
M: Unpin,
R: Unpin,
impl<R, M> UnwindSafe for Qmc<R, M> where
M: UnwindSafe,
R: UnwindSafe,
M: 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<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
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]
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<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,