9 #ifndef ThePEG_RhoDMatrix_H 10 #define ThePEG_RhoDMatrix_H 13 #include "ThePEG/PDT/PDT.h" 14 #include "ThePEG/Helicity/HelicityDefinitions.h" 46 for(
size_t ix=0; ix<
_ispin; ++ix)
47 for(
size_t iy=0; iy<
_ispin; ++iy)
48 _matrix[ix][iy] = (average && ix==iy) ? 1./_ispin : 0.;
79 static const double epsa=1e-30, epsb=1e-10;
82 for(
size_t ix=0; ix<
_ispin; ++ix)
84 assert(norm.real() > epsa);
85 assert(norm.imag()/norm.real() < epsb);
86 double invnorm = 1./norm.real();
87 for(
size_t ix=0; ix<
_ispin; ++ix)
88 for(
size_t iy=0; iy<
_ispin; ++iy)
122 enum { MAXSPIN = 5 };
135 for (
size_t ix = 0; ix < rd.
_ispin; ++ix) {
136 for (
size_t iy = 0; iy < rd.
_ispin; ++iy)
137 os << rd.
_matrix[ix][iy] <<
" ";
RhoDMatrix()
Default constructor with undefined spin.
size_t _ispin
Storage of 2s+1 for speed.
std::complex< double > Complex
ThePEG code should use Complex for all complex scalars.
PDT::Spin iSpin() const
Get the spin.
This is the main namespace within which all identifiers in ThePEG are declared.
Complex _matrix[MAXSPIN][MAXSPIN]
Storage for the matrix allowing up to spin 2 particles.
RhoDMatrix(PDT::Spin inspin, bool average=true)
Standard constructor giving the spin as 2s+1.
Spin
Definition of enumerated values used for spin information.
void normalize()
renormalise the matrix so it has unit trace
Complex operator()(size_t ix, size_t iy) const
Return an element of the matrix.
friend ostream & operator<<(ostream &os, const RhoDMatrix &rd)
Output the spin density matrix for debugging purposes.
PDT::Spin _spin
2s+1 for the particle.
The RhoDMatrix class is designed to implement the storage of the rho and D matrices which are require...