Struct lattice_qcd_rs::field::LinkMatrix
source · pub struct LinkMatrix { /* private fields */ }
Expand description
Represents the link matrices
Implementations§
source§impl LinkMatrix
impl LinkMatrix
sourcepub const fn new(data: Vec<Matrix3<Complex<Real>>>) -> Self
pub const fn new(data: Vec<Matrix3<Complex<Real>>>) -> Self
Create a new link matrix field from preexisting data.
sourcepub fn data_mut(&mut self) -> &mut Vec<Matrix3<Complex<Real>>>
pub fn data_mut(&mut self) -> &mut Vec<Matrix3<Complex<Real>>>
Get a mutable reference to the data
sourcepub fn as_vec_mut(&mut self) -> &mut Vec<Matrix3<Complex<Real>>>
pub fn as_vec_mut(&mut self) -> &mut Vec<Matrix3<Complex<Real>>>
Get the link_matrix as a mutable Vec
.
sourcepub fn as_slice_mut(&mut self) -> &mut [Matrix3<Complex<Real>>]
pub fn as_slice_mut(&mut self) -> &mut [Matrix3<Complex<Real>>]
Get the link_matrix as a mut ref to a slice
sourcepub fn new_determinist<Rng: Rng + ?Sized, const D: usize>(
l: &LatticeCyclic<D>,
rng: &mut Rng
) -> Self
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)
);
sourcepub fn new_random_threaded<const D: usize>(
l: &LatticeCyclic<D>,
number_of_thread: usize
) -> Result<Self, ThreadError>
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.
sourcepub fn new_cold<const D: usize>(l: &LatticeCyclic<D>) -> Self
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());
sourcepub fn matrix<const D: usize>(
&self,
link: &LatticeLink<D>,
l: &LatticeCyclic<D>
) -> Option<Matrix3<Complex<Real>>>
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)
$
sourcepub fn sij<const D: usize>(
&self,
point: &LatticePoint<D>,
dir_i: &Direction<D>,
dir_j: &Direction<D>,
lattice: &LatticeCyclic<D>
) -> Option<Matrix3<Complex<Real>>>
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)
$.
sourcepub fn pij<const D: usize>(
&self,
point: &LatticePoint<D>,
dir_i: &Direction<D>,
dir_j: &Direction<D>,
lattice: &LatticeCyclic<D>
) -> Option<Matrix3<Complex<Real>>>
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)
$.
sourcepub fn average_trace_plaquette<const D: usize>(
&self,
lattice: &LatticeCyclic<D>
) -> Option<Complex<Real>>
pub fn average_trace_plaquette<const D: usize>( &self, lattice: &LatticeCyclic<D> ) -> Option<Complex<Real>>
Take the average of the trace of all plaquettes
sourcepub fn clover<const D: usize>(
&self,
point: &LatticePoint<D>,
dir_i: &Direction<D>,
dir_j: &Direction<D>,
lattice: &LatticeCyclic<D>
) -> Option<CMatrix3>
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
sourcepub fn f_mu_nu<const D: usize>(
&self,
point: &LatticePoint<D>,
dir_i: &Direction<D>,
dir_j: &Direction<D>,
lattice: &LatticeCyclic<D>
) -> Option<CMatrix3>
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.
sourcepub fn magnetic_field_vec<const D: usize>(
&self,
point: &LatticePoint<D>,
lattice: &LatticeCyclic<D>
) -> Option<SVector<CMatrix3, D>>
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.
sourcepub fn magnetic_field<const D: usize>(
&self,
point: &LatticePoint<D>,
dir: &Direction<D>,
lattice: &LatticeCyclic<D>
) -> Option<CMatrix3>
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.
sourcepub fn magnetic_field_link<const D: usize>(
&self,
link: &LatticeLink<D>,
lattice: &LatticeCyclic<D>
) -> Option<Matrix3<Complex<Real>>>
pub fn magnetic_field_link<const D: usize>( &self, link: &LatticeLink<D>, lattice: &LatticeCyclic<D> ) -> Option<Matrix3<Complex<Real>>>
Get the chromomagnetic field at a given point alongside a given direction given by lattice link.
sourcepub fn normalize(&mut self)
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
sourcepub fn iter(
&self
) -> impl Iterator<Item = &CMatrix3> + ExactSizeIterator + FusedIterator
pub fn iter( &self ) -> impl Iterator<Item = &CMatrix3> + ExactSizeIterator + FusedIterator
Iter on the data.
sourcepub fn iter_mut(
&mut self
) -> impl Iterator<Item = &mut CMatrix3> + ExactSizeIterator + FusedIterator
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
impl AsMut<[Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>]> for LinkMatrix
source§impl AsMut<Vec<Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>, Global>> for LinkMatrix
impl AsMut<Vec<Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>, Global>> for LinkMatrix
source§impl AsRef<[Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>]> for LinkMatrix
impl AsRef<[Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>]> for LinkMatrix
source§impl AsRef<Vec<Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>, Global>> for LinkMatrix
impl AsRef<Vec<Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>, Global>> for LinkMatrix
source§impl Clone for LinkMatrix
impl Clone for LinkMatrix
source§fn clone(&self) -> LinkMatrix
fn clone(&self) -> LinkMatrix
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for LinkMatrix
impl Debug for LinkMatrix
source§impl<'de> Deserialize<'de> for LinkMatrix
impl<'de> Deserialize<'de> for LinkMatrix
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>,
source§impl<A> Extend<A> for LinkMatrixwhere
Vec<CMatrix3>: Extend<A>,
impl<A> Extend<A> for LinkMatrixwhere Vec<CMatrix3>: Extend<A>,
source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = A>,
fn extend<T>(&mut self, iter: T)where T: IntoIterator<Item = A>,
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl<A> FromIterator<A> for LinkMatrixwhere
Vec<CMatrix3>: FromIterator<A>,
impl<A> FromIterator<A> for LinkMatrixwhere Vec<CMatrix3>: FromIterator<A>,
source§fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = A>,
fn from_iter<T>(iter: T) -> Selfwhere T: IntoIterator<Item = A>,
source§impl<A> FromParallelIterator<A> for LinkMatrixwhere
Vec<CMatrix3>: FromParallelIterator<A>,
A: Send,
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>,
fn from_par_iter<I>(par_iter: I) -> Selfwhere I: IntoParallelIterator<Item = A>,
par_iter
. Read moresource§impl Index<usize> for LinkMatrix
impl Index<usize> for LinkMatrix
source§impl IndexMut<usize> for LinkMatrix
impl IndexMut<usize> for LinkMatrix
source§impl<'a> IntoIterator for &'a LinkMatrix
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
type IntoIter = <&'a Vec<Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>, Global> as IntoIterator>::IntoIter
source§impl<'a> IntoIterator for &'a mut LinkMatrix
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
type IntoIter = <&'a mut Vec<Matrix<Complex<f64>, Const<3>, Const<3>, ArrayStorage<Complex<f64>, 3, 3>>, Global> as IntoIterator>::IntoIter
source§impl<T> ParallelExtend<T> for LinkMatrixwhere
Vec<CMatrix3>: ParallelExtend<T>,
T: Send,
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>,
fn par_extend<I>(&mut self, par_iter: I)where I: IntoParallelIterator<Item = T>,
par_iter
. Read moresource§impl PartialEq<LinkMatrix> for LinkMatrix
impl PartialEq<LinkMatrix> for LinkMatrix
source§fn eq(&self, other: &LinkMatrix) -> bool
fn eq(&self, other: &LinkMatrix) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for LinkMatrix
impl Serialize for LinkMatrix
impl StructuralPartialEq for LinkMatrix
Auto Trait Implementations§
impl RefUnwindSafe for LinkMatrix
impl Send for LinkMatrix
impl Sync for LinkMatrix
impl Unpin for LinkMatrix
impl UnwindSafe for LinkMatrix
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>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.