pub struct LinkMatrix { /* private fields */ }
Expand description

Represents the link matrices

Implementations§

source§

impl LinkMatrix

source

pub const fn new(data: Vec<Matrix3<Complex<Real>>>) -> Self

Create a new link matrix field from preexisting data.

source

pub const fn data(&self) -> &Vec<Matrix3<Complex<Real>>>

Get the raw data.

source

pub fn data_mut(&mut self) -> &mut Vec<Matrix3<Complex<Real>>>

Get a mutable reference to the data

source

pub const fn as_vec(&self) -> &Vec<Matrix3<Complex<Real>>>

Get the link_matrix as a Vec.

source

pub fn as_vec_mut(&mut self) -> &mut Vec<Matrix3<Complex<Real>>>

Get the link_matrix as a mutable Vec.

source

pub fn as_slice(&self) -> &[Matrix3<Complex<Real>>]

Get the link_matrix as a slice.

source

pub fn as_slice_mut(&mut self) -> &mut [Matrix3<Complex<Real>>]

Get the link_matrix as a mut ref to a slice

source

pub fn new_determinist<Rng: Rng + ?Sized, const D: usize>( l: &LatticeCyclic<D>, rng: &mut Rng ) -> Self

Single threaded generation with a given random number generator. useful to produce a deterministic set of data but slower than LinkMatrix::new_random_threaded.

Example
use lattice_qcd_rs::{field::LinkMatrix, lattice::LatticeCyclic};
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
let lattice = LatticeCyclic::<4>::new(1_f64, 4)?;
assert_eq!(
    LinkMatrix::new_determinist(&lattice, &mut rng_1),
    LinkMatrix::new_determinist(&lattice, &mut rng_2)
);
source

pub fn new_random_threaded<const D: usize>( l: &LatticeCyclic<D>, number_of_thread: usize ) -> Result<Self, ThreadError>

Multi threaded generation of random data. Due to the non deterministic way threads operate a set cannot be reduced easily. If you want deterministic generation you can use LinkMatrix::new_random_threaded.

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

let lattice = LatticeCyclic::<3>::new(1_f64, 4)?;
let links = LinkMatrix::new_random_threaded(&lattice, 4)?;
assert!(!links.is_empty());
Errors

Returns ThreadError::ThreadNumberIncorrect if number_of_thread is 0.

source

pub fn new_cold<const D: usize>(l: &LatticeCyclic<D>) -> Self

Create a cold configuration ( where the link matrices is set to the identity).

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

let lattice = LatticeCyclic::<3>::new(1_f64, 4)?;
let links = LinkMatrix::new_cold(&lattice);
assert!(!links.is_empty());
source

pub fn matrix<const D: usize>( &self, link: &LatticeLink<D>, l: &LatticeCyclic<D> ) -> Option<Matrix3<Complex<Real>>>

get the link matrix associated to given link using the notation $U_{-i}(x) = U^\dagger_{i}(x-i)$

source

pub fn sij<const D: usize>( &self, point: &LatticePoint<D>, dir_i: &Direction<D>, dir_j: &Direction<D>, lattice: &LatticeCyclic<D> ) -> Option<Matrix3<Complex<Real>>>

Get $S_ij(x) = U_j(x) U_i(x+j) U^\dagger_j(x+i)$.

source

pub fn pij<const D: usize>( &self, point: &LatticePoint<D>, dir_i: &Direction<D>, dir_j: &Direction<D>, lattice: &LatticeCyclic<D> ) -> Option<Matrix3<Complex<Real>>>

Get the plaquette $P_{ij}(x) = U_i(x) S^\dagger_ij(x)$.

source

pub fn average_trace_plaquette<const D: usize>( &self, lattice: &LatticeCyclic<D> ) -> Option<Complex<Real>>

Take the average of the trace of all plaquettes

source

pub fn clover<const D: usize>( &self, point: &LatticePoint<D>, dir_i: &Direction<D>, dir_j: &Direction<D>, lattice: &LatticeCyclic<D> ) -> Option<CMatrix3>

Get the clover, used for F_mu_nu tensor

source

pub fn f_mu_nu<const D: usize>( &self, point: &LatticePoint<D>, dir_i: &Direction<D>, dir_j: &Direction<D>, lattice: &LatticeCyclic<D> ) -> Option<CMatrix3>

Get the F^{ij} tensor using the clover appropriation. The direction should be set to positive. See https://arxiv.org/abs/1512.02374.

source

pub fn magnetic_field_vec<const D: usize>( &self, point: &LatticePoint<D>, lattice: &LatticeCyclic<D> ) -> Option<SVector<CMatrix3, D>>

Get the chromomagnetic field at a given point.

source

pub fn magnetic_field<const D: usize>( &self, point: &LatticePoint<D>, dir: &Direction<D>, lattice: &LatticeCyclic<D> ) -> Option<CMatrix3>

Get the chromomagnetic field at a given point alongside a given direction.

Get the chromomagnetic field at a given point alongside a given direction given by lattice link.

source

pub fn len(&self) -> usize

Return the number of elements.

source

pub fn is_empty(&self) -> bool

Returns wether the there is no data.

source

pub fn normalize(&mut self)

Correct the numerical drift, reprojecting all the matrices to SU(3).

You can look at the example of super::simulation::LatticeStateDefault::normalize_link_matrices

source

pub fn iter( &self ) -> impl Iterator<Item = &CMatrix3> + ExactSizeIterator + FusedIterator

Iter on the data.

source

pub fn iter_mut( &mut self ) -> impl Iterator<Item = &mut CMatrix3> + ExactSizeIterator + FusedIterator

Iter mutably on the data.

Trait Implementations§

source§

impl AsMut<[Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>]> for LinkMatrix

source§

fn as_mut(&mut self) -> &mut [CMatrix3]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsMut<Vec<Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>, Global>> for LinkMatrix

source§

fn as_mut(&mut self) -> &mut Vec<CMatrix3>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsRef<[Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>]> for LinkMatrix

source§

fn as_ref(&self) -> &[CMatrix3]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<Vec<Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>, Global>> for LinkMatrix

source§

fn as_ref(&self) -> &Vec<CMatrix3>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for LinkMatrix

source§

fn clone(&self) -> LinkMatrix

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LinkMatrix

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for LinkMatrix

source§

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<A> Extend<A> for LinkMatrixwhere Vec<CMatrix3>: Extend<A>,

source§

fn extend<T>(&mut self, iter: T)where T: IntoIterator<Item = A>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<A> FromIterator<A> for LinkMatrixwhere Vec<CMatrix3>: FromIterator<A>,

source§

fn from_iter<T>(iter: T) -> Selfwhere T: IntoIterator<Item = A>,

Creates a value from an iterator. Read more
source§

impl<A> FromParallelIterator<A> for LinkMatrixwhere Vec<CMatrix3>: FromParallelIterator<A>, A: Send,

source§

fn from_par_iter<I>(par_iter: I) -> Selfwhere I: IntoParallelIterator<Item = A>,

Creates an instance of the collection from the parallel iterator par_iter. Read more
source§

impl Index<usize> for LinkMatrix

§

type Output = Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>

The returned type after indexing.
source§

fn index(&self, pos: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl IndexMut<usize> for LinkMatrix

source§

fn index_mut(&mut self, pos: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'a> IntoIterator for &'a LinkMatrix

§

type IntoIter = <&'a Vec<Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>, Global> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
§

type Item = &'a Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>

The type of the elements being iterated over.
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a> IntoIterator for &'a mut LinkMatrix

§

type IntoIter = <&'a mut Vec<Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>, Global> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
§

type Item = &'a mut Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>

The type of the elements being iterated over.
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T> ParallelExtend<T> for LinkMatrixwhere Vec<CMatrix3>: ParallelExtend<T>, T: Send,

source§

fn par_extend<I>(&mut self, par_iter: I)where I: IntoParallelIterator<Item = T>,

Extends an instance of the collection with the elements drawn from the parallel iterator par_iter. Read more
source§

impl PartialEq<LinkMatrix> for LinkMatrix

source§

fn eq(&self, other: &LinkMatrix) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for LinkMatrix

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for LinkMatrix

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

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

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

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

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

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,

source§

impl<T> Scalar for Twhere T: 'static + Clone + PartialEq<T> + Debug,