pub trait LatticeStateWithEField<const D: usize>: LatticeState<D> {
// Required methods
fn e_field(&self) -> &EField<D>;
fn set_e_field(&mut self, e_field: EField<D>);
fn t(&self) -> usize;
fn derivative_u(
link: &LatticeLinkCanonical<D>,
link_matrix: &LinkMatrix,
e_field: &EField<D>,
lattice: &LatticeCyclic<D>
) -> Option<CMatrix3>;
fn derivative_e(
point: &LatticePoint<D>,
link_matrix: &LinkMatrix,
e_field: &EField<D>,
lattice: &LatticeCyclic<D>
) -> Option<SVector<Su3Adjoint, D>>;
fn hamiltonian_efield(&self) -> Real;
// Provided methods
fn reset_e_field<Rng>(
&mut self,
rng: &mut Rng
) -> Result<(), StateInitializationError>
where Rng: Rng + ?Sized { ... }
fn hamiltonian_total(&self) -> Real { ... }
}Expand description
Represent a lattice state where the conjugate momenta of the link matrices are included.
If you have a LatticeState and want the default way of adding the conjugate momenta look at
LatticeStateEFSyncDefault.
If you want to solve the equation of motion using an SymplecticIntegrator also implement
SimulationStateSynchronous and the wrapper SimulationStateLeap can give you an SimulationStateLeapFrog.
It is used for the super::monte_carlo::HybridMonteCarlo algorithm.
Required Methods§
sourcefn set_e_field(&mut self, e_field: EField<D>)
fn set_e_field(&mut self, e_field: EField<D>)
Replace the electrical field with the given input. It should panic if the input is not of the correct size.
Panic
Panic if the length of link_matrix is different from lattice.get_number_of_points()
sourcefn derivative_u(
link: &LatticeLinkCanonical<D>,
link_matrix: &LinkMatrix,
e_field: &EField<D>,
lattice: &LatticeCyclic<D>
) -> Option<CMatrix3>
fn derivative_u( link: &LatticeLinkCanonical<D>, link_matrix: &LinkMatrix, e_field: &EField<D>, lattice: &LatticeCyclic<D> ) -> Option<CMatrix3>
Get the derivative \partial_t U(link), returns None if the link is outside of the lattice.
It is used in order to apply the equation of motion.
sourcefn derivative_e(
point: &LatticePoint<D>,
link_matrix: &LinkMatrix,
e_field: &EField<D>,
lattice: &LatticeCyclic<D>
) -> Option<SVector<Su3Adjoint, D>>
fn derivative_e( point: &LatticePoint<D>, link_matrix: &LinkMatrix, e_field: &EField<D>, lattice: &LatticeCyclic<D> ) -> Option<SVector<Su3Adjoint, D>>
Get the derivative \partial_t E(point), returns None if the link is outside of the lattice.
It is used in order to apply the equation of motion.
sourcefn hamiltonian_efield(&self) -> Real
fn hamiltonian_efield(&self) -> Real
Get the energy of the conjugate momenta configuration
Provided Methods§
sourcefn reset_e_field<Rng>(
&mut self,
rng: &mut Rng
) -> Result<(), StateInitializationError>where
Rng: Rng + ?Sized,
fn reset_e_field<Rng>( &mut self, rng: &mut Rng ) -> Result<(), StateInitializationError>where Rng: Rng + ?Sized,
Reset the e_field with radom value distributed as N(0, 1 / beta)
rand_distr::StandardNormal.
Errors
Gives and error if N(0, 0.5/beta ) is not a valid distribution (for example beta = 0).
Gives StateInitializationError::GaussProjectionError if the Gauss projection failed
sourcefn hamiltonian_total(&self) -> Real
fn hamiltonian_total(&self) -> Real
Get the total energy, by default LatticeStateWithEField::hamiltonian_efield
Implementors§
impl<State, const D: usize> LatticeStateWithEField<D> for SimulationStateLeap<State, D>where State: LatticeStateWithEField<D> + SimulationStateSynchronous<D> + ?Sized,
We just transmit the function of State, there is nothing new.