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.

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>where State: LatticeStateWithEField<D> + SimulationStateSynchronous<D> + ?Sized,

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