LatticeState

Trait LatticeState 

Source
pub trait LatticeState<const D: usize> {
    const CA: Real;

    // Required methods
    fn link_matrix(&self) -> &LinkMatrix;
    fn set_link_matrix(&mut self, link_matrix: LinkMatrix);
    fn lattice(&self) -> &LatticeCyclic<D>;
    fn beta(&self) -> Real;
    fn hamiltonian_links(&self) -> Real;

    // Provided methods
    fn monte_carlo_step<M>(self, m: &mut M) -> Result<Self, M::Error>
       where Self: Sized,
             M: MonteCarlo<Self, D> + ?Sized { ... }
    fn average_trace_plaquette(&self) -> Option<Complex> { ... }
}
Expand description

Trait to represent a pure gauge lattice state of dimension D.

It defines only one field: link_matrix of type LinkMatrix.

§Example

They are many examples throughout the carte see by instance super::monte_carlo::hybrid_monte_carlo.

Required Associated Constants§

Source

const CA: Real

C_A constant of the model, usually it is 3.

Required Methods§

Get the link matrices of this state.

This is the field that stores the link matrices.

§Example
use lattice_qcd_rs::lattice::{DirectionEnum, LatticePoint};
use lattice_qcd_rs::simulation::{LatticeState, LatticeStateDefault};

let point = LatticePoint::new_zero();
let state = LatticeStateDefault::<4>::new_cold(1_f64, 10_f64, 4)?;
let _plaquette = state.link_matrix().pij(
    &point,
    &DirectionEnum::XPos.into(),
    &DirectionEnum::YPos.into(),
    state.lattice(),
);

Replace the links matrices with the given input. It should panic if link matrix is not of the correct size.

§Panic

Panic if the length of link_matrix is different from lattice.get_number_of_canonical_links_space()

Source

fn lattice(&self) -> &LatticeCyclic<D>

Get the lattice into which the state exists.

Source

fn beta(&self) -> Real

Returns the beta parameter of the states.

Returns the Hamiltonian of the links configuration.

Provided Methods§

Source

fn monte_carlo_step<M>(self, m: &mut M) -> Result<Self, M::Error>
where Self: Sized, M: MonteCarlo<Self, D> + ?Sized,

Do one monte carlo step with the given method.

§Errors

The error form MonteCarlo::get_next_element is propagated.

§Example

see super::monte_carlo::hybrid_monte_carlo.

Source

fn average_trace_plaquette(&self) -> Option<Complex>

Take the average of the trace of all plaquettes.

§Example

see the crate documentation crate.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<State, const D: usize> LatticeState<D> for LatticeStateEFSyncDefault<State, D>
where State: LatticeState<D> + ?Sized,

Source§

const CA: Real = State::CA

Source§

impl<State, const D: usize> LatticeState<D> for SimulationStateLeap<State, D>

We just transmit the function of State, there is nothing new.

Source§

const CA: Real = State::CA

Source§

impl<const D: usize> LatticeState<D> for LatticeStateDefault<D>

Source§

const CA: Real = 3f64