pub struct LatticeStateDefault<const D: usize> { /* private fields */ }
Expand description

Represent a simulation state at a set time.

It has the default pure gauge hamiltonian

Implementations

Create a cold configuration. i.e. all the links are set to the unit matrix.

With the lattice of size size and dimension number_of_points ( see LatticeCyclic::new ) and beta parameter beta.

Errors

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

Create a “hot” configuration, i.e. the link matrices are chosen randomly.

With the lattice of size size and dimension number_of_points ( see LatticeCyclic::new ) and beta parameter beta.

The creation is determinists meaning that it is reproducible:

Errors

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

Example

This example demonstrate how to reproduce the same configuration

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

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
assert_eq!(
    LatticeStateDefault::<4>::new_determinist(1_f64, 1_f64, 4, &mut rng_1).unwrap(),
    LatticeStateDefault::<4>::new_determinist(1_f64, 1_f64, 4, &mut rng_2).unwrap()
);

Correct the numerical drift, reprojecting all the link matrices to SU(3). see LinkMatrix::normalize.

Example
use lattice_qcd_rs::error::ImplementationError;
use lattice_qcd_rs::prelude::*;
use rand::SeedableRng;

let mut rng = rand::rngs::StdRng::seed_from_u64(0); // change with your seed

let size = 1_f64;
let number_of_pts = 3;
let beta = 1_f64;

let mut simulation =
    LatticeStateDefault::<4>::new_determinist(size, beta, number_of_pts, &mut rng)?;

let spread_parameter = 0.1_f64;
let mut mc = MetropolisHastingsSweep::new(1, spread_parameter, rng)
    .ok_or(ImplementationError::OptionWithUnexpectedNone)?;

for _ in 0..2 {
    for _ in 0..10 {
        simulation = simulation.monte_carlo_step(&mut mc)?;
    }
    // the more we advance te more the link matrices
    // will deviate form SU(3), so we reproject to SU(3)
    // every 10 steps.
    simulation.normalize_link_matrices();
}

Get a mutable reference to the link matrix at link

Absorbs self anf return the link_matrix as owned

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

The link matrices of this state.

Panic

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

Get the default pure gauge Hamiltonian.

Panic

Panic if plaquettes cannot be found

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.

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

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

Error type

Create a new simulation state. Read more

Error returned while getting the next element.

Do one Monte Carlo simulation step. Read more

Error returned while getting the next element.

Do one Monte Carlo simulation step. Read more

Error returned while getting the next element.

Do one Monte Carlo simulation step. Read more

Error returned while getting the next element.

Do one Monte Carlo simulation step. Read more

Error returned while getting the next element.

Do one Monte Carlo simulation step. 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

Auto Trait Implementations

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.