Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

cps::Matrix Class Reference

A class of general 3x3 complex matrices. More...

#include <vector.h>

List of all members.

Public Member Functions

 Matrix ()
 General constructor; no initialisation.
 Matrix (IFloat c)
 Initialisation to real multiple of the unit matrix.
 Matrix (const Complex &c)
 Initialisation to complex multiple of the unit matrix.
 Matrix (const Matrix &m)
 Copy constructor.
Matrixoperator= (IFloat c)
 Assignment to real multiple of the unit matrix.
Matrixoperator= (const Complex &c)
 Assignment to complex multiple of the unit matrix.
Matrixoperator= (const Matrix &m)
 Overloaded assignment.
Matrixoperator+= (const Matrix &m)
 Adds a matrix m to this matrix.
Matrixoperator+= (IFloat c)
 Adds a real scalar multiple of the unit matrix to this one.
Matrixoperator-= (const Matrix &m)
 Subtracts a matrix m to this matrix.
Matrixoperator-= (IFloat c)
 Subtracts a real scalar multiple of the unit matrix from this one.
Matrixoperator *= (IFloat c)
 Multiplies this matrix by a real scalar.
void DotMEqual (const Matrix &a, const Matrix &b)
 Assignment to matrix product; ab.
void DotMPlus (const Matrix &a, const Matrix &b)
 Assignment to matrix product; ab.
void Trans (const IFloat *m)
 Assignment to Matrix transpose.
void Trans (const Matrix &m)
 Assignment to matrix transpose.
void Dagger (const IFloat *m)
 Hermitian conjugate.
void Dagger (const Matrix &m)
 Assignment to hermitian conjugate.
void TrLessAntiHermMatrix (const Matrix &this_dag)
 Not what you might think.
void TrLessAntiHermMatrix ()
void Cross2 (const Vector &v1, const Vector &v2)
 Assignment to tensor product of vectors.
void AntiHermMatrix (const IFloat *a)
 Assignment to an traceless antihermitian matrix.
void Unitarize (void)
 Force this matrix to be an SU(3) matrix.
int ProjSU3 (void)
void UnitMatrix (void)
 Assignment to a unit matrix.
void ZeroMatrix (void)
 Assignment to a zero matrix.
void NegMatrix (const Matrix &m)
 Assignment to a negated matrix.
void OneMinusfTimesM (IFloat x, const Matrix &m)
 Assignment to the matrix linear combination 1-xm.
Complexoperator() (int i, int j)
 Write access.
const Complexoperator() (int i, int j) const
 Read access.
Complexoperator[] (int i)
 Write access.
const Complexoperator[] (int i) const
 Read access.
IFloat elem (int i)
void Det (IFloat *c) const
 The determinant.
IFloat ReTr () const
 Returns the real part of the trace.
Complex Tr () const
 Returns the trace.
IFloat NegHalfTrSquare () const
 -1/2 times the trace of the square.
IFloat ErrorSU3 () const
 The deviation of this matrix from unitarity.
IFloat norm () const
Complex Char3 () const
Complex Char6 () const
Complex Char8 () const
Complex Char10 () const

Friends

class Vector


Detailed Description

A class of general 3x3 complex matrices.

Definition at line 142 of file vector.h.


Constructor & Destructor Documentation

cps::Matrix::Matrix  ) 
 

General constructor; no initialisation.

Definition at line 33 of file vector.C.

cps::Matrix::Matrix IFloat  c  ) 
 

Initialisation to real multiple of the unit matrix.

The diagonal matrix elements (0,0), (1,1) and (2,2) are set to the real number c; All other elements are zero.

Parameters:
c The diagonal matrix element

Definition at line 42 of file vector.C.

cps::Matrix::Matrix const Complex c  ) 
 

Initialisation to complex multiple of the unit matrix.

The diagonal matrix elements (0,0), (1,1) and (2,2) are set to the complex number c; All other elements are zero.

Parameters:
c The diagonal matrix element

Definition at line 52 of file vector.C.

References cps::Complex.

cps::Matrix::Matrix const Matrix m  ) 
 

Copy constructor.

The matrix is initialised as a copy of the matrix m.

Parameters:
m The initialising matrix.

Definition at line 61 of file vector.C.


Member Function Documentation

void cps::Matrix::AntiHermMatrix const IFloat a  ) 
 

Assignment to an traceless antihermitian matrix.

Parameters:
a an array of 8 real numbers.
Postcondition:
This matrix is assigned the value
i Li * a[i]
where Li is the i 'th Gell-Mann matrix.

Definition at line 134 of file su3_util.C.

References cps::IFloat, and cps::p().

Referenced by cps::Lattice::RandGaussAntiHermMatrix(), and cps::AlgNoise::run().

Complex cps::Matrix::Char10  )  const
 

Definition at line 201 of file vector.C.

References cps::Complex, cps::IFloat, cps::imChar10(), and cps::reChar10().

Referenced by cps::AlgWline::run().

Complex cps::Matrix::Char3  )  const [inline]
 

Definition at line 361 of file vector.h.

References cps::Complex, and cps::Tr().

Referenced by cps::AlgWline::run(), and cps::AlgHQPotential::run().

Complex cps::Matrix::Char6  )  const
 

Definition at line 187 of file vector.C.

References cps::Complex, cps::IFloat, cps::imChar6(), and cps::reChar6().

Referenced by cps::AlgWline::run().

Complex cps::Matrix::Char8  )  const
 

Definition at line 194 of file vector.C.

References cps::Complex, cps::IFloat, and cps::reChar8().

Referenced by cps::AlgWline::run().

void cps::Matrix::Cross2 const Vector v1,
const Vector v2
 

Assignment to tensor product of vectors.

Parameters:
v1 A complex 3-vector u
v2 A complex 3-vector v
Postcondition:
This matrix is assigned the values M(i,j) = 2 u(i)v(j)*

Definition at line 108 of file su3_util.C.

References cps::IFloat, cps::p(), and cps::Vector::v.

Referenced by cps::Fstag::FforceSite(), and cps::pt_vvpd().

void cps::Matrix::Dagger const Matrix m  )  [inline]
 

Assignment to hermitian conjugate.

Parameters:
m A matrix.
Postcondition:
This matrix is the hermitian conjugate of m.
a must not be an alias of this matrix

Definition at line 260 of file vector.h.

References cps::IFloat.

void cps::Matrix::Dagger const IFloat a  ) 
 

Hermitian conjugate.

Parameters:
a A linear array representation of a 3x3 complex matrix, such that real part of the (i,j) element is at array position [6i+2j] and the imaginary part of the (i,j) element is at array position [6i+2j+1].
Postcondition:
This matrix is the hermitian conjugate of m.
a must not be an alias of this matrix.

Definition at line 46 of file su3_util.C.

Referenced by cps::CanonToAnything(), cps::Lattice::Convert(), cps::FixHPlane::delta(), ErrorSU3(), cps::FwilsonTm::EvolveMomFforce(), cps::Fwilson::EvolveMomFforce(), cps::FdwfBase::EvolveMomFforce(), cps::Fclover::EvolveMomFforce(), cps::GimprOLSym::EvolveMomGforce(), cps::Fstag::FforceSite(), cps::GtadpoleRect::GforceSite(), cps::GpowerRect::GforceSite(), cps::GpowerPlaq::GforceSite(), cps::GimprRect::GforceSite(), cps::GimprOLSym::GforceSite(), cps::FermionVectorTp::GFWallSource(), cps::Nuc3ptStru::InsertOp(), cps::QPropW::MeasConAxialOld(), cps::LatMatrix::MulDag(), cps::Lattice::PathOrdProd(), cps::Lattice::PathOrdProdPlus(), cps::Lattice::Plaq(), cps::GpowerRect::PowerRectStaple(), cps::GpowerRect::PowerStaple(), cps::GpowerPlaq::PowerStaple(), ProjSU3(), cps::pt_mat(), cps::pt_mat_norm(), cps::pt_shift_link(), cps::Lattice::RectStaple(), cps::Lattice::ReTrPlaq(), cps::Lattice::ReTrRect(), cps::AlgRotateGauge::run(), cps::AlgHQPotential::run(), cps::FermionVectorTp::SetLandauGaugeMomentaSource(), cps::DiracOpClover::SiteFuv(), cps::AlgHypSmear::smear_link(), cps::Lattice::Staple(), cps::su3_proj(), and cps::ZeroReal().

void cps::Matrix::Det IFloat c  )  const
 

The determinant.

Parameters:
i A number between 0 and 17
Returns:
element of the array

Definition at line 167 of file su3_util.C.

References cps::IFloat, and cps::p().

Referenced by ProjSU3().

void cps::Matrix::DotMEqual const Matrix a,
const Matrix b
[inline]
 

Assignment to matrix product; ab.

Parameters:
a the matrix a
b the matrix b
Postcondition:
This matrix is the matrix product ab

Definition at line 224 of file vector.h.

References cps::IFloat, cps::mDotMEqual(), and u.

Referenced by ErrorSU3(), cps::FwilsonTm::EvolveMomFforce(), cps::Fwilson::EvolveMomFforce(), cps::FdwfBase::EvolveMomFforce(), cps::Fclover::EvolveMomFforce(), cps::QPropW::MeasConAxialOld(), cps::MkTop(), cps::LatMatrix::MulDag(), norm(), cps::operator *(), ProjSU3(), cps::AlgWline::run(), cps::AlgRotateGauge::run(), cps::AlgNoise::run(), cps::AlgInst::run(), cps::AlgHQPotential::run(), cps::DiracOpClover::SiteFuv(), cps::AlgHypSmear::smear_link(), and cps::su3_proj().

void cps::Matrix::DotMPlus const Matrix a,
const Matrix b
[inline]
 

Assignment to matrix product; ab.

Parameters:
a the matrix a
b the matrix b
Postcondition:
The matrix product ab is added to this matrix.

Definition at line 233 of file vector.h.

References cps::IFloat, cps::mDotMPlus(), and u.

Referenced by cps::MkTop(), cps::DiracOpClover::SiteFuv(), and cps::AlgHypSmear::smear_link().

IFloat cps::Matrix::elem int  i  )  [inline]
 

Definition at line 336 of file vector.h.

References cps::IFloat.

IFloat cps::Matrix::ErrorSU3  )  const
 

The deviation of this matrix from unitarity.

Returns:
|U^dagger U - I|^2, where the norm used is the L2 norm of the matrix elements.

Definition at line 148 of file vector.C.

References COLORS, Dagger(), DotMEqual(), cps::dotProduct(), cps::IFloat, and cps::p().

IFloat cps::Matrix::NegHalfTrSquare  )  const
 

-1/2 times the trace of the square.

This method is specifically for an anti-hermitian matrix only.

Definition at line 211 of file su3_util.C.

References cps::IFloat, and cps::p().

Referenced by cps::Lattice::MomHamiltonNode().

void cps::Matrix::NegMatrix const Matrix m  )  [inline]
 

Assignment to a negated matrix.

Parameters:
m A matrix.
Postcondition:
This matrix has the value -m.

Definition at line 302 of file vector.h.

References COLORS, cps::IFloat, and cps::vecNegative().

IFloat cps::Matrix::norm  )  const
 

Returns the SU(3) matrix norm, defined by ||X||^2 = -2 trace X^2

Definition at line 211 of file vector.C.

References DotMEqual(), cps::IFloat, and ReTr().

Referenced by cps::FwilsonTm::EvolveMomFforce(), cps::Fwilson::EvolveMomFforce(), cps::Fstag::EvolveMomFforce(), cps::FdwfBase::EvolveMomFforce(), cps::Fclover::EvolveMomFforce(), and cps::GimprOLSym::EvolveMomGforce().

void cps::Matrix::OneMinusfTimesM IFloat  x,
const Matrix m
[inline]
 

Assignment to the matrix linear combination 1-xm.

Parameters:
x A real scalar factor
m A matrix
Postcondition:
This matrix has the value 1-xm.

Definition at line 311 of file vector.h.

References COLORS, cps::IFloat, and cps::oneMinusfTimesMatrix().

Matrix& cps::Matrix::operator *= IFloat  c  )  [inline]
 

Multiplies this matrix by a real scalar.

Parameters:
c The real scalar
Returns:
The multiplied matrix

Definition at line 214 of file vector.h.

References COLORS, cps::IFloat, and cps::vecTimesEquFloat().

const Complex & cps::Matrix::operator() int  i,
int  j
const
 

Read access.

Parameters:
i The row index,
j The column index,
Returns:
The (i,j) matrix element

Definition at line 178 of file vector.C.

References COLORS, and cps::Complex.

Complex & cps::Matrix::operator() int  i,
int  j
 

Write access.

Parameters:
i The row index,
j The column index,
Returns:
The (i,j) matrix element

Definition at line 168 of file vector.C.

References COLORS, and cps::Complex.

Matrix& cps::Matrix::operator+= IFloat  c  )  [inline]
 

Adds a real scalar multiple of the unit matrix to this one.

Parameters:
c The real scalar multiple
Returns:
The matrix sum

Definition at line 189 of file vector.h.

Matrix& cps::Matrix::operator+= const Matrix m  )  [inline]
 

Adds a matrix m to this matrix.

Parameters:
m The matrix to be added.
Returns:
The matrix sum.

Definition at line 180 of file vector.h.

References COLORS, cps::IFloat, u, and cps::vecAddEquVec().

Matrix& cps::Matrix::operator-= IFloat  c  )  [inline]
 

Subtracts a real scalar multiple of the unit matrix from this one.

Parameters:
c The real scalar multiple
Returns:
The matrix difference

Definition at line 206 of file vector.h.

Matrix& cps::Matrix::operator-= const Matrix m  )  [inline]
 

Subtracts a matrix m to this matrix.

Parameters:
m The matrix to be subtracted.
Returns:
The matrix difference.

Definition at line 197 of file vector.h.

References COLORS, cps::IFloat, u, and cps::vecMinusEquVec().

Matrix& cps::Matrix::operator= const Matrix m  )  [inline]
 

Overloaded assignment.

m should not alias this matrix

Definition at line 166 of file vector.h.

References COLORS, cps::Float, and cps::moveMem().

Matrix & cps::Matrix::operator= const Complex c  ) 
 

Assignment to complex multiple of the unit matrix.

The diagonal matrix elements (0,0), (1,1) and (2,2) are set to the complex number c; All other elements are zero.

Parameters:
c The diagonal matrix element

Definition at line 84 of file vector.C.

References cps::Complex, and ZeroMatrix().

Matrix & cps::Matrix::operator= IFloat  c  ) 
 

Assignment to real multiple of the unit matrix.

The diagonal matrix elements (0,0), (1,1) and (2,2) are set to the real number c; All other elements are zero.

Parameters:
c The diagonal matrix element

Definition at line 71 of file vector.C.

References ZeroMatrix().

const Complex& cps::Matrix::operator[] int  i  )  const [inline]
 

Read access.

Parameters:
i A number between 0 and 8
Returns:
The ([i - i mod 3]/3, i mod 3) matrix element

Definition at line 335 of file vector.h.

References cps::Complex.

Complex& cps::Matrix::operator[] int  i  )  [inline]
 

Write access.

Parameters:
i A number between 0 and 8
Returns:
The ([i - i mod 3]/3, i mod 3) matrix element
Should this method not be private?

Definition at line 329 of file vector.h.

References cps::Complex.

int cps::Matrix::ProjSU3 void   ) 
 

Project this matrix onto SU(3) according to its polar decomposition Added by Thomas Dumitrescu 06/2006

Definition at line 61 of file projsu3.C.

References COLORS, cps::Complex, cps::conj(), Dagger(), Det(), cps::diagonalize(), DotMEqual(), DOUBLE_EQUAL, cps::Float, cps::Rcomplex::imag(), cps::k, MAX_JACOBI_SWEEPS, cps::MPISCU::printf(), and cps::Rcomplex::real().

Referenced by cps::AlgOlegSmear::run().

IFloat cps::Matrix::ReTr  )  const
 

Returns the real part of the trace.

Definition at line 202 of file su3_util.C.

References cps::IFloat, and cps::p().

Referenced by cps::QPropW::MeasConAxialOld(), norm(), cps::GpowerRect::PowerRectStaple(), cps::GpowerRect::PowerStaple(), cps::GpowerPlaq::PowerStaple(), cps::Lattice::ReTrLoop(), cps::Lattice::ReTrPlaq(), cps::Lattice::ReTrRect(), and cps::su3_proj().

Complex cps::Matrix::Tr  )  const
 

Returns the trace.

Definition at line 183 of file vector.C.

References cps::Complex.

Referenced by cps::FixHPlane::delta(), cps::Nuc3ptStru::InsertOp(), cps::MkTop(), cps::AlgPot2::run(), and cps::AlgPot::run().

void cps::Matrix::Trans const Matrix m  )  [inline]
 

Assignment to matrix transpose.

Parameters:
m A matrix.
Postcondition:
This matrix is the transpose of m.
m must not be an alias of this matrix/

Definition at line 247 of file vector.h.

References cps::IFloat, cps::MPISCU::Trans(), and u.

void cps::Matrix::Trans const IFloat m  ) 
 

Assignment to Matrix transpose.

Parameters:
m A linear array representation of a 3x3 complex matrix, such that real part of the (i,j) element is at array position [6i+2j] and the imaginary part of the (i,j) element is at array position [6i+2j+1].
Postcondition:
This matrix is the transpose of m.
m must not be an alias of this matrix/

Definition at line 103 of file vector.C.

References cps::Complex.

Referenced by cps::qload_unpackstrip(), cps::qsave_packstrip(), cps::DiracOpClover::SiteFuv(), cps::WilsonMatrix::UdagMultSource(), and cps::WilsonMatrix::UMultSource().

void cps::Matrix::TrLessAntiHermMatrix  ) 
 

Definition at line 79 of file su3_util.C.

References cps::IFloat, and cps::p().

void cps::Matrix::TrLessAntiHermMatrix const Matrix dag  ) 
 

Not what you might think.

Parameters:
dag A matrix A.
Postcondition:
This matrix is set to
1/2(M-A) - 1/6 Trace M-A)
where M is the original value of this matrix.

Definition at line 65 of file su3_util.C.

References cps::IFloat, cps::p(), and cps::vecTimesEquFloat().

Referenced by cps::FwilsonTm::EvolveMomFforce(), cps::Fwilson::EvolveMomFforce(), cps::FdwfBase::EvolveMomFforce(), cps::Fclover::EvolveMomFforce(), cps::GimprOLSym::EvolveMomGforce(), cps::Fstag::FforceSite(), cps::GtadpoleRect::GforceSite(), cps::GpowerRect::GforceSite(), cps::GpowerPlaq::GforceSite(), cps::GimprRect::GforceSite(), cps::GimprOLSym::GforceSite(), and cps::LatMatrix::TrLessAntiHermMatrix().

void cps::Matrix::Unitarize void   ) 
 

Force this matrix to be an SU(3) matrix.

Postcondition:
This matrix is a member of the SU(3) group.

Definition at line 44 of file unitarize.C.

References cps::crossProductConj(), cps::Float, cps::normalize(), and cps::orthogonalize().

Referenced by cps::Lattice::Reunitarize(), and cps::FixHPlane::unitarize().

void cps::Matrix::UnitMatrix void   ) 
 

Assignment to a unit matrix.

Postcondition:
This matrix is a 3x3 unit matrix.

Definition at line 116 of file vector.C.

References cps::IFloat, and cps::p().

Referenced by cps::Lattice::FixGaugeAllocate(), cps::AlgWline::run(), cps::AlgInst::run(), cps::Lattice::SetGfieldOrd(), and cps::su3_proj().

void cps::Matrix::ZeroMatrix void   ) 
 

Assignment to a zero matrix.

Postcondition:
This matrix is a 3x3 zero matrix.

Definition at line 134 of file vector.C.

References cps::IFloat, and cps::p().

Referenced by cps::Lattice::BufferedChairStaple(), cps::Lattice::BufferedCubeStaple(), cps::Lattice::BufferedRectStaple(), cps::Lattice::BufferedStaple(), cps::CloverLeaf(), cps::CloverLeaf1x3(), cps::CloverLeaf2x2(), cps::CloverLeaf3x3(), cps::CloverLeafRect(), cps::Fp4::EvolveMomFforce(), cps::Fasqtad::EvolveMomFforce(), cps::Fnone::FforceSite(), cps::five_staple(), cps::Gnone::GforceSite(), cps::Nuc3ptStru::InsertOp(), cps::lepage_staple(), operator=(), cps::GpowerRect::PowerRectStaple(), cps::pt_vvpd(), cps::Lattice::RectStaple(), cps::Lattice::ReTrLoop(), cps::Fp4::RHMC_EvolveMomFforce(), cps::Fasqtad::RHMC_EvolveMomFforce(), cps::AlgPot2::run(), cps::AlgPot::run(), cps::seven_staple(), cps::Fp4::Smear(), cps::Fasqtad::Smear(), cps::AlgHypSmear::smear_link(), cps::three_staple(), and cps::three_staple2().


Friends And Related Function Documentation

friend class Vector [friend]
 

Definition at line 146 of file vector.h.


The documentation for this class was generated from the following files:
Generated on Sat Oct 10 14:12:15 2009 for Columbia Physics System by  doxygen 1.3.9.1