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.
Matrixoperator*= (const Complex &c)
 Multiplies this matrix by a complex scalar.
Matrix operator+ (const Matrix &m) const
Matrix operator- (const Matrix &m) const
Matrix operator* (const Matrix &m) const
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 Matrix &m)
 Hermitian conjugate.
void Transpose (const IFloat *m)
void Transpose ()
void Dagger (const IFloat *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
 Read access.
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
void FTimesV1PlusV2 (Float fb, Matrix *c, Matrix *d, int len)

Friends

class Vector

Detailed Description

A class of general 3x3 complex matrices.

Definition at line 246 of file vector.h.


Constructor & Destructor Documentation

cps::Matrix::Matrix (  )  [inline]

General constructor; no initialisation.

Definition at line 256 of file vector.h.

cps::Matrix::Matrix ( IFloat  c  )  [inline]

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 265 of file vector.h.

cps::Matrix::Matrix ( const Complex c  )  [inline]

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 274 of file vector.h.

cps::Matrix::Matrix ( const Matrix m  )  [inline]

Copy constructor.

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

Parameters:
m The initialising matrix.

Definition at line 282 of file vector.h.

References COLORS.


Member Function Documentation

void Matrix< T >::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 110 of file su3_util.C.

References cps::p().

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

Here is the call graph for this function:

Complex Matrix< T >::Char10 (  )  const

Definition at line 104 of file vector.C.

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

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

Here is the call graph for this function:

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

Definition at line 643 of file vector.h.

References cps::Tr().

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

Here is the call graph for this function:

Complex Matrix< T >::Char6 (  )  const

Definition at line 90 of file vector.C.

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

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

Here is the call graph for this function:

Complex Matrix< T >::Char8 (  )  const

Definition at line 97 of file vector.C.

References cps::reChar8().

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

Here is the call graph for this function:

void Matrix< T >::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 84 of file su3_util.C.

References cps::p().

Referenced by cps::Fstag::FforceSite().

Here is the call graph for this function:

void Matrix< T >::Dagger ( const IFloat a  ) 

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

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.

void cps::Matrix::Dagger ( const Matrix m  )  [inline]
void Matrix< T >::Det ( IFloat q  )  const

Read access.

Parameters:
i A number between 0 and 17
Returns:
element of the array The determinant.
Parameters:
q An array of length at least 2.
Postcondition:
The real and imaginarey parts of the determinant of this matrix are written to the 0 and 1 elements of q.

Definition at line 143 of file su3_util.C.

References cps::p().

Referenced by ProjSU3().

Here is the call graph for this function:

void cps::Matrix::DotMEqual ( const Matrix a,
const Matrix b 
) [inline]
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 416 of file vector.h.

References cps::mDotMPlus().

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

Here is the call graph for this function:

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

Definition at line 603 of file vector.h.

IFloat Matrix< T >::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 55 of file vector.C.

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

Here is the call graph for this function:

void cps::Matrix::FTimesV1PlusV2 ( Float  fb,
Matrix c,
Matrix d,
int  len 
) [inline]

Definition at line 651 of file vector.h.

References vaxpy3_m().

Referenced by cps::GimprRect::EvolveMomGforce().

Here is the call graph for this function:

IFloat Matrix< T >::NegHalfTrSquare (  )  const

-1/2 times the trace of the square.

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

Definition at line 180 of file su3_util.C.

References cps::p().

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

Here is the call graph for this function:

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 567 of file vector.h.

References COLORS.

IFloat cps::Matrix::norm (  )  const [inline]

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

Definition at line 632 of file vector.h.

References DotMEqual(), and ReTr().

Referenced by cps::Fwilson::EvolveMomFforce(), cps::FdwfBase::EvolveMomFforce(), cps::Fclover::EvolveMomFforce(), cps::FdwfBase::EvolveMomFforceInt(), cps::ForceArg::measure(), and cps::Lattice::updateForce().

Here is the call graph for this function:

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 578 of file vector.h.

References COLORS, and cps::oneMinusfTimesMatrix().

Here is the call graph for this function:

const Complex & Matrix< T >::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 85 of file vector.C.

References COLORS.

Complex & Matrix< T >::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 75 of file vector.C.

References COLORS.

Matrix cps::Matrix::operator* ( const Matrix m  )  const [inline]

Definition at line 395 of file vector.h.

References DotMEqual().

Here is the call graph for this function:

Matrix& cps::Matrix::operator*= ( const Complex c  )  [inline]

Multiplies this matrix by a complex scalar.

Parameters:
c The complex scalar
Returns:
The multiplied matrix

Definition at line 375 of file vector.h.

References COLORS.

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 363 of file vector.h.

References COLORS.

Matrix cps::Matrix::operator+ ( const Matrix m  )  const [inline]

Definition at line 383 of file vector.h.

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 338 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 327 of file vector.h.

References COLORS.

Matrix cps::Matrix::operator- ( const Matrix m  )  const [inline]

Definition at line 389 of file vector.h.

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 355 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 346 of file vector.h.

References COLORS, and cps::vecMinusEquVecSingle().

Here is the call graph for this function:

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

Overloaded assignment.

m should not alias this matrix

Definition at line 315 of file vector.h.

References COLORS.

Matrix& cps::Matrix::operator= ( const Complex c  )  [inline]

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 306 of file vector.h.

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

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 293 of file vector.h.

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 602 of file vector.h.

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 596 of file vector.h.

int Matrix< T >::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, conj(), Dagger(), Det(), cps::diagonalize(), DotMEqual(), DOUBLE_EQUAL, k, MAX_JACOBI_SWEEPS, norm(), and cps::MPISCU::printf().

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

Here is the call graph for this function:

IFloat cps::Matrix::ReTr (  )  const [inline]

Returns the real part of the trace.

Definition at line 613 of file vector.h.

Referenced by cps::QPropW::MeasConAxialOld(), norm(), and cps::su3_proj().

Complex cps::Matrix::Tr (  )  const [inline]

Returns the trace.

Definition at line 618 of file vector.h.

Referenced by cps::FixHPlane::delta(), 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 430 of file vector.h.

References Trans().

Referenced by Trans().

Here is the call graph for this function:

void Matrix< T >::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 42 of file vector.C.

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

void Matrix< T >::Transpose (  ) 

Definition at line 51 of file su3_util.C.

void Matrix< T >::Transpose ( const IFloat m  ) 

Definition at line 39 of file su3_util.C.

void cps::Matrix::TrLessAntiHermMatrix (  )  [inline]

Definition at line 452 of file vector.h.

References Dagger().

Here is the call graph for this function:

void Matrix< T >::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::p(), and cps::vecTimesEquFloat().

Referenced by cps::Fwilson::EvolveMomFforce(), cps::FdwfBase::EvolveMomFforce(), cps::Fclover::EvolveMomFforce(), cps::FdwfBase::EvolveMomFforceInt(), cps::GimprRect::EvolveMomGforce(), cps::Gwilson::GforceSite(), and cps::GimprRect::GforceSite().

Here is the call graph for this function:

void Matrix< T >::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(), normalize(), and cps::orthogonalize().

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

Here is the call graph for this function:

void cps::Matrix::UnitMatrix ( void   )  [inline]

Assignment to a unit matrix.

Postcondition:
This matrix is a 3x3 unit matrix.

Definition at line 546 of file vector.h.

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

void cps::Matrix::ZeroMatrix ( void   )  [inline]

Friends And Related Function Documentation

friend class Vector [friend]

Definition at line 250 of file vector.h.


The documentation for this class was generated from the following files:

Generated on 19 Mar 2015 for Columbia Physics System by  doxygen 1.6.1