pub trait LatticeStateNew<const D: usize>: LatticeState<D> + Sized {
    type Error;

    // Required method
    fn new(
        lattice: LatticeCyclic<D>,
        beta: Real,
        link_matrix: LinkMatrix
    ) -> Result<Self, Self::Error>;
}
Expand description

Trait for a way to create a LatticeState from some parameters.

It is separated from the LatticeState because not all LatticeState can be create in this way. By instance when there is also a field of conjugate momenta of the link matrices.

This is used by the Monte Carlo algorithms to create the new states.

Required Associated Types§

source

type Error

Error type

Required Methods§

source

fn new( lattice: LatticeCyclic<D>, beta: Real, link_matrix: LinkMatrix ) -> Result<Self, Self::Error>

Create a new simulation state.

Errors

Give an error if the parameter are incorrect or the length of link_matrix does not correspond to lattice.

Example
use lattice_qcd_rs::field::LinkMatrix;
use lattice_qcd_rs::lattice::LatticeCyclic;
use lattice_qcd_rs::simulation::{LatticeStateDefault, LatticeStateNew};

let lattice = LatticeCyclic::new(1_f64, 4)?;
let links = LinkMatrix::new_cold(&lattice);
let state = LatticeStateDefault::<4>::new(lattice, 1_f64, links)?;

Implementors§