pub struct SymplecticEulerRayon;
Expand description
Basic symplectic Euler integrator using Rayon.
It is slightly faster than super::SymplecticEuler
but use slightly more memory.
Example
use lattice_qcd_rs::integrator::{SymplecticEulerRayon, SymplecticIntegrator};
use lattice_qcd_rs::simulation::{
LatticeStateDefault, LatticeStateEFSyncDefault, LatticeStateWithEField,
};
use rand::SeedableRng;
let mut rng = rand::rngs::StdRng::seed_from_u64(0); // change with your seed
let state1 = LatticeStateEFSyncDefault::new_random_e_state(
LatticeStateDefault::<3>::new_determinist(1_f64, 2_f64, 4, &mut rng)?,
&mut rng,
);
let integrator = SymplecticEulerRayon::default();
let state2 = integrator.integrate_symplectic(&state1, 0.000_001_f64)?;
let h = state1.hamiltonian_total();
let h2 = state2.hamiltonian_total();
println!("The error on the Hamiltonian is {}", h - h2);
Implementations§
Trait Implementations§
source§impl Clone for SymplecticEulerRayon
impl Clone for SymplecticEulerRayon
source§fn clone(&self) -> SymplecticEulerRayon
fn clone(&self) -> SymplecticEulerRayon
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SymplecticEulerRayon
impl Debug for SymplecticEulerRayon
source§impl Default for SymplecticEulerRayon
impl Default for SymplecticEulerRayon
source§fn default() -> Self
fn default() -> Self
Identical to SymplecticEulerRayon::new
.
source§impl<'de> Deserialize<'de> for SymplecticEulerRayon
impl<'de> Deserialize<'de> for SymplecticEulerRayon
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for SymplecticEulerRayon
impl Display for SymplecticEulerRayon
source§impl Hash for SymplecticEulerRayon
impl Hash for SymplecticEulerRayon
source§impl Ord for SymplecticEulerRayon
impl Ord for SymplecticEulerRayon
source§fn cmp(&self, other: &SymplecticEulerRayon) -> Ordering
fn cmp(&self, other: &SymplecticEulerRayon) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<SymplecticEulerRayon> for SymplecticEulerRayon
impl PartialEq<SymplecticEulerRayon> for SymplecticEulerRayon
source§fn eq(&self, other: &SymplecticEulerRayon) -> bool
fn eq(&self, other: &SymplecticEulerRayon) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<SymplecticEulerRayon> for SymplecticEulerRayon
impl PartialOrd<SymplecticEulerRayon> for SymplecticEulerRayon
source§fn partial_cmp(&self, other: &SymplecticEulerRayon) -> Option<Ordering>
fn partial_cmp(&self, other: &SymplecticEulerRayon) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for SymplecticEulerRayon
impl Serialize for SymplecticEulerRayon
source§impl<State, const D: usize> SymplecticIntegrator<State, SimulationStateLeap<State, D>, D> for SymplecticEulerRayonwhere
State: SimulationStateSynchronous<D> + LatticeStateWithEField<D> + LatticeStateWithEFieldNew<D>,
impl<State, const D: usize> SymplecticIntegrator<State, SimulationStateLeap<State, D>, D> for SymplecticEulerRayonwhere State: SimulationStateSynchronous<D> + LatticeStateWithEField<D> + LatticeStateWithEFieldNew<D>,
§type Error = <State as LatticeStateWithEFieldNew<D>>::Error
type Error = <State as LatticeStateWithEFieldNew<D>>::Error
Type of error returned by the Integrator.
source§fn integrate_sync_sync(
&self,
l: &State,
delta_t: Real
) -> Result<State, Self::Error>
fn integrate_sync_sync( &self, l: &State, delta_t: Real ) -> Result<State, Self::Error>
Integrate a sync state to a sync state by advancing the link matrices and the electrical field simultaneously. Read more
source§fn integrate_leap_leap(
&self,
l: &SimulationStateLeap<State, D>,
delta_t: Real
) -> Result<SimulationStateLeap<State, D>, Self::Error>
fn integrate_leap_leap( &self, l: &SimulationStateLeap<State, D>, delta_t: Real ) -> Result<SimulationStateLeap<State, D>, Self::Error>
Integrate a leap state to a leap state using leap frog algorithm. Read more
source§fn integrate_sync_leap(
&self,
l: &State,
delta_t: Real
) -> Result<SimulationStateLeap<State, D>, Self::Error>
fn integrate_sync_leap( &self, l: &State, delta_t: Real ) -> Result<SimulationStateLeap<State, D>, Self::Error>
Integrate a sync state to a leap state by doing a half step for the conjugate momenta. Read more
source§fn integrate_leap_sync(
&self,
l: &SimulationStateLeap<State, D>,
delta_t: Real
) -> Result<State, Self::Error>
fn integrate_leap_sync( &self, l: &SimulationStateLeap<State, D>, delta_t: Real ) -> Result<State, Self::Error>
Integrate a leap state to a sync state by finishing doing a step for the position and finishing
the half step for the conjugate momenta. Read more
impl Copy for SymplecticEulerRayon
impl Eq for SymplecticEulerRayon
impl StructuralEq for SymplecticEulerRayon
impl StructuralPartialEq for SymplecticEulerRayon
Auto Trait Implementations§
impl RefUnwindSafe for SymplecticEulerRayon
impl Send for SymplecticEulerRayon
impl Sync for SymplecticEulerRayon
impl Unpin for SymplecticEulerRayon
impl UnwindSafe for SymplecticEulerRayon
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.