# Struct lattice_qcd_rs::simulation::state::LatticeStateEFSyncDefault

pub struct LatticeStateEFSyncDefault<State, const D: usize> where    State: LatticeState<D> + ?Sized,  { /* private fields */ }
Expand description

wrapper to implement LatticeStateWithEField from a LatticeState using the default implementation of conjugate momenta.

It also implement SimulationStateSynchronous.

## Implementations

Absorbs self and return the state as owned. It essentially deconstruct the structure.

Get a reference to the state.

Get a mutable reference to the state.

Take a state and generate a new random one and try projecting it to the Gauss law.

##### Panic

Panics if N(0, 0.5/beta ) is not a valid distribution (for example beta = 0). Panics if the field could not be projected to the Gauss law.

Create a new Self from a state and a cold configuration of the e field (i.e. set to 0)

Get a mutable reference to the efield

Get the gauss coefficient G(x) = \sum_i E_i(x) - U_{-i}(x) E_i(x - i) U^\dagger_{-i}(x).

Generate a hot (i.e. random) initial state.

Single threaded generation with a given random number generator. size is the size parameter of the lattice and number_of_points is the number of points in each spatial dimension of the lattice. See LatticeCyclic::new for more info.

useful to reproduce a set of data but slower than LatticeStateEFSyncDefault::new_random_threaded.

##### Errors

Return StateInitializationError::LatticeInitializationError if the parameter is invalid for LatticeCyclic. Or propagates the error form Self::new.

##### Example
use rand::{SeedableRng,rngs::StdRng};

let mut rng_1 = StdRng::seed_from_u64(0);
let mut rng_2 = StdRng::seed_from_u64(0);
// They have the same seed and should generate the same numbers
let distribution = rand::distributions::Uniform::from(-1_f64..1_f64);
assert_eq!(
LatticeStateEFSyncDefault::<LatticeStateDefault<4>, 4>::new_determinist(1_f64, 1_f64, 4, &mut rng_1, &distribution).unwrap(),
LatticeStateEFSyncDefault::<LatticeStateDefault<4>, 4>::new_determinist(1_f64, 1_f64, 4, &mut rng_2, &distribution).unwrap()
);

Generate a configuration with cold e_field and hot link matrices

##### Errors

Return StateInitializationError::LatticeInitializationError if the parameter is invalid for LatticeCyclic. Or propagates the error form Self::new.

Generate a new cold state.

It meas that the link matrices are set to the identity and electrical field are set to 0.

##### Errors

Return StateInitializationError::LatticeInitializationError if the parameter is invalid for LatticeCyclic. Or propagates the error form Self::new.

Generate a hot (i.e. random) initial state.

Multi threaded generation of random data. Due to the non deterministic way threads operate a set cannot be reproduce easily, In that case use LatticeStateEFSyncDefault::new_determinist.

##### Errors

Return StateInitializationError::LatticeInitializationError if the parameter is invalid for LatticeCyclic. Return ThreadError::ThreadNumberIncorrect if number_of_points = 0. Returns an error if a thread panicked. Finally, propagates the error form Self::new.

## Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

##### Panic

panic under the same condition as State::set_link_matrix

C_A constant of the model, usually it is 3.

Get the lattice into which the state exists.

Returns the beta parameter of the states.

Returns the Hamiltonian of the links configuration.

Do one monte carlo step with the given method. Read more

Take the average of the trace of all plaquettes. Read more

By default \sum_x Tr(E_i E_i)

The “Electrical” field of this state.

##### Panic

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

return the time state, i.e. the number of time the simulation ran.

Get the derive of U_i(x).

Get the derive of E(x) (as a vector of Su3Adjoint).

Reset the e_field with radom value distributed as N(0, 1 / beta) rand_distr::StandardNormal. Read more

create a new simulation state. If e_field or link_matrix does not have the corresponding amount of data compared to lattice it fails to create the state. t is the number of time the simulation ran. i.e. the time sate.

Error type

Create a new state with e_field randomly distributed as rand_distr::Normal^. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

This is an sync State

does half a step for the conjugate momenta. Read more

Does number_of_steps with delta_t at each step using a leap_frog algorithm by fist doing half a step and then finishing by doing half step. Read more

Does the same thing as SimulationStateSynchronous::simulate_using_leapfrog_n but use the default wrapper SimulationStateLeap for the leap frog state. Read more

Does a simulation step using the sync algorithm Read more

Does numbers_of_times of step of size delta_t using the sync algorithm Read more

Integrate the state using the symplectic algorithm ( by going to leapfrog and back to sync) Read more

Does numbers_of_times of step of size delta_t using the symplectic algorithm Read more

Does the same thing as SimulationStateSynchronous::simulate_symplectic_n but use the default wrapper SimulationStateLeap for the leap frog state. Read more

## Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.