Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F19250455
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
12 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/Helicity/LorentzTensor.cc b/Helicity/LorentzTensor.cc
--- a/Helicity/LorentzTensor.cc
+++ b/Helicity/LorentzTensor.cc
@@ -1,2 +1,39 @@
// non-inlined members of the LorentzTensor class
#include "LorentzTensor.h"
+
+using namespace ThePEG;
+using namespace Helicity;
+
+// general boost
+LorentzTensor LorentzTensor::boost(double bx, double by, double bz) const{
+ // basic definitions
+ double boostm[4][4];
+ double b2 = bx*bx+by*by+bz*bz;
+ double gamma = 1.0/sqrt(1.0-b2);
+ double gmmone = b2 >0 ? (gamma-1.)/b2 : 0.0;
+ double vec[3]={bx,by,bz};
+ // compute the lorentz boost matrix
+ for(unsigned int ix=0;ix<3;++ix)
+ {
+ for(unsigned int iy=0;iy<3;++iy){boostm[ix][iy]=vec[ix]*vec[iy]*gmmone;}
+ boostm[ix][ix]+=1;
+ boostm[ix][3]=gamma*vec[ix];
+ boostm[3][ix]=boostm[ix][3];
+ }
+ boostm[3][3]=gamma;
+ // apply the boost
+ LorentzTensor output;
+ Complex temp;
+ for(unsigned int ix=0;ix<4;++ix)
+ {for(unsigned int iy=0;iy<4;++iy)
+ {
+ temp=0.;
+ for(unsigned int ixa=0;ixa<4;++ixa)
+ {for(unsigned int iya=0;iya<4;++iya)
+ {temp+=boostm[ix][ixa]*boostm[iy][iya]*(*this)(ixa,iya);}
+ }
+ output(ix,iy)=temp;
+ }
+ }
+ return output;
+}
diff --git a/Helicity/LorentzTensor.h b/Helicity/LorentzTensor.h
--- a/Helicity/LorentzTensor.h
+++ b/Helicity/LorentzTensor.h
@@ -1,103 +1,136 @@
// -*- C++ -*-
#ifndef ThePEG_LorentzTensor_H
#define ThePEG_LorentzTensor_H
//
// This is the declaration of the <!id>LorentzTensor<!!id> class.
//
// CLASSDOC SUBSECTION Description:
//
// The LorentzTensor class is designed to implement the storage of a complex
// tensor to be used to representation the wavefunction of a spin-2 particle.
//
// At the moment it only implements the storage of the tensor components but
// it is envisaged that it will be extended to include boost methods etc.
//
// CLASSDOC SUBSECTION See also:
//
// <a href="http:.html">.h</a>,
// <a href="http:.html">.h</a>.
//
// Author: Peter Richardson
//
#include "ThePEG/Config/Complex.h"
#include "LorentzPolarizationVector.h"
namespace ThePEG {
namespace Helicity {
class LorentzTensor{
public:
// constructors
inline LorentzTensor();
// default zero constructor
LorentzTensor(Complex, Complex, Complex, Complex,
Complex, Complex, Complex, Complex,
Complex, Complex, Complex, Complex,
Complex, Complex, Complex, Complex);
// constructor specifyign all components
inline LorentzTensor(LorentzPolarizationVector, LorentzPolarizationVector);
// constructor in terms of two polarization vectors
+ inline LorentzTensor(LorentzVector p, LorentzVector q);
+ // constructor in terms of two lorentz5vectors
+
+ inline ~LorentzTensor();
+ // The destructor
+
inline Complex xx() const;
inline Complex yx() const;
inline Complex zx() const;
inline Complex tx() const;
inline Complex xy() const;
inline Complex yy() const;
inline Complex zy() const;
inline Complex ty() const;
inline Complex xz() const;
inline Complex yz() const;
inline Complex zz() const;
inline Complex tz() const;
inline Complex xt() const;
inline Complex yt() const;
inline Complex zt() const;
inline Complex tt() const;
// Get components
inline void setXX(Complex);
inline void setYX(Complex);
inline void setZX(Complex);
inline void setTX(Complex);
inline void setXY(Complex);
inline void setYY(Complex);
inline void setZY(Complex);
inline void setTY(Complex);
inline void setXZ(Complex);
inline void setYZ(Complex);
inline void setZZ(Complex);
inline void setTZ(Complex);
inline void setXT(Complex);
inline void setYT(Complex);
inline void setZT(Complex);
inline void setTT(Complex);
// Set components.
inline Complex operator () (int,int) const;
// Get components by index.
inline Complex & operator () (int,int);
// Set components by index.
inline LorentzTensor & operator = (const LorentzTensor &);
// Assignment.
+ // boost
+ LorentzTensor boost(double,double,double) const;
+ inline LorentzTensor boost(const Hep3Vector &) const;
+
+ // complex conjugate
+ inline LorentzTensor conjugate();
+
+ inline Complex operator * (const LorentzTensor &) const;
+ // Scalar product with other tensor
+
+ inline LorentzTensor operator *= (Complex);
+ // scaling with a complex number
+
+ // addition
+ inline LorentzTensor operator + (const LorentzTensor &) const;
+ // subtraction
+ inline LorentzTensor operator - (const LorentzTensor &) const;
+
private:
Complex _tensor[4][4];
};
+// multiplication by scalar
+inline LorentzTensor operator * (Complex a,const LorentzTensor &);
+
+inline LorentzPolarizationVector operator *
+(const LorentzPolarizationVector &, const LorentzTensor &);
+
+inline LorentzPolarizationVector operator *
+(const LorentzTensor &,const LorentzPolarizationVector &);
+
}
}
#include "LorentzTensor.icc"
#endif
diff --git a/Helicity/LorentzTensor.icc b/Helicity/LorentzTensor.icc
--- a/Helicity/LorentzTensor.icc
+++ b/Helicity/LorentzTensor.icc
@@ -1,110 +1,205 @@
// -*- C++ -*-
//
// This is the implementation of the inlined member functions of
// the LorentzTensor class.
//
// Author: Peter Richardson
//
#include "ThePEG/Helicity/HelicityDefinitions.h"
namespace ThePEG {
namespace Helicity {
// constructors
+// default zero constructor
inline LorentzTensor::LorentzTensor() {
for(int ix=0;ix<4;++ix) {
for(int iy=0;iy<4;++iy) {
_tensor[ix][iy]=0.;
}
}
}
-// default zero constructor
+// constructor in terms of two polarization vectors
inline LorentzTensor::
LorentzTensor(LorentzPolarizationVector p, LorentzPolarizationVector q) {
for(int ix=0;ix<4;++ix) {
for(int iy=0;iy<4;++iy) {
_tensor[ix][iy]=p[ix]*q[iy];
}
}
}
-// constructor in terms of two polarization vectors
+// constructor in terms of two momenta
+inline LorentzTensor::LorentzTensor(LorentzVector p, LorentzVector q) {
+ for(int ix=0;ix<4;++ix) {
+ for(int iy=0;iy<4;++iy) {
+ _tensor[ix][iy]=p[ix]*q[iy];
+ }
+ }
+}
+
// constructor specifying all components
inline LorentzTensor::
LorentzTensor(Complex xx, Complex xy, Complex xz, Complex xt,
Complex yx, Complex yy, Complex yz, Complex yt,
Complex zx, Complex zy, Complex zz, Complex zt,
Complex tx, Complex ty, Complex tz, Complex tt) {
_tensor[0][0]=xx;_tensor[0][1]=xy;_tensor[0][2]=xz;_tensor[0][3]=xt;
_tensor[1][0]=yx;_tensor[1][1]=yy;_tensor[1][2]=yz;_tensor[1][3]=yt;
_tensor[2][0]=zx;_tensor[2][1]=zy;_tensor[2][2]=zz;_tensor[2][3]=zt;
_tensor[3][0]=tx;_tensor[3][1]=ty;_tensor[3][2]=tz;_tensor[3][3]=tt;
}
+inline LorentzTensor::~LorentzTensor() {}
+// The destructor
+
inline Complex LorentzTensor::xx() const {return _tensor[0][0];}
inline Complex LorentzTensor::yx() const {return _tensor[1][0];}
inline Complex LorentzTensor::zx() const {return _tensor[2][0];}
inline Complex LorentzTensor::tx() const {return _tensor[3][0];}
inline Complex LorentzTensor::xy() const {return _tensor[0][1];}
inline Complex LorentzTensor::yy() const {return _tensor[1][1];}
inline Complex LorentzTensor::zy() const {return _tensor[2][1];}
inline Complex LorentzTensor::ty() const {return _tensor[3][1];}
inline Complex LorentzTensor::xz() const {return _tensor[0][2];}
inline Complex LorentzTensor::yz() const {return _tensor[1][2];}
inline Complex LorentzTensor::zz() const {return _tensor[2][2];}
inline Complex LorentzTensor::tz() const {return _tensor[3][2];}
inline Complex LorentzTensor::xt() const {return _tensor[0][3];}
inline Complex LorentzTensor::yt() const {return _tensor[1][3];}
inline Complex LorentzTensor::zt() const {return _tensor[2][3];}
inline Complex LorentzTensor::tt() const {return _tensor[3][3];}
// Get position and time.
inline void LorentzTensor::setXX(Complex a) {_tensor[0][0]=a;}
inline void LorentzTensor::setYX(Complex a) {_tensor[1][0]=a;}
inline void LorentzTensor::setZX(Complex a) {_tensor[2][0]=a;}
inline void LorentzTensor::setTX(Complex a) {_tensor[3][0]=a;}
inline void LorentzTensor::setXY(Complex a) {_tensor[0][1]=a;}
inline void LorentzTensor::setYY(Complex a) {_tensor[1][1]=a;}
inline void LorentzTensor::setZY(Complex a) {_tensor[2][1]=a;}
inline void LorentzTensor::setTY(Complex a) {_tensor[3][1]=a;}
inline void LorentzTensor::setXZ(Complex a) {_tensor[0][2]=a;}
inline void LorentzTensor::setYZ(Complex a) {_tensor[1][2]=a;}
inline void LorentzTensor::setZZ(Complex a) {_tensor[2][2]=a;}
inline void LorentzTensor::setTZ(Complex a) {_tensor[3][2]=a;}
inline void LorentzTensor::setXT(Complex a) {_tensor[0][3]=a;}
inline void LorentzTensor::setYT(Complex a) {_tensor[1][3]=a;}
inline void LorentzTensor::setZT(Complex a) {_tensor[2][3]=a;}
inline void LorentzTensor::setTT(Complex a) {_tensor[3][3]=a;}
// Set position and time
inline Complex LorentzTensor::operator () (int i,int j) const
{
if( i>=0 && i<=3 && j>=0 && j<=3) return _tensor[i][j];
throw HelicityLogicalError()
<< "Invalid component (" << i << "," << j
<< ") requested for LorentzTensor." << Exception::abortnow;
}
// Get components by index.
inline Complex & LorentzTensor::operator () (int i,int j)
{
if( i>=0 && i<=3 && j>=0 && j<=3) return _tensor[i][j];
throw HelicityLogicalError()
<< "Invalid component (" << i << "," << j
<< ") requested for LorentzTensor." << Exception::abortnow;
}
// Set components by index.
// Assignment
inline LorentzTensor & LorentzTensor::operator = (const LorentzTensor & q) {
for(int ix=0;ix<4;++ix) {
for(int iy=0;iy<4;++iy) _tensor[ix][iy]=q(ix,iy);
}
return *this;
}
-}
+// boost
+inline LorentzTensor LorentzTensor::boost(const Hep3Vector & b) const {
+ return boost(b.x(), b.y(), b.z());
}
+inline LorentzTensor LorentzTensor::conjugate()
+{
+ return LorentzTensor(conj(xx()), conj(xy()), conj(xz()), conj(xt()),
+ conj(yx()), conj(yy()), conj(yz()), conj(yt()),
+ conj(zx()), conj(zy()), conj(zz()), conj(zt()),
+ conj(tx()), conj(ty()), conj(tz()), conj(tt()));
+}
+
+// product with another tensor
+inline Complex LorentzTensor::operator * (const LorentzTensor & in) const
+{
+ Complex output=0.,temp;
+ for(unsigned int ix=0;ix<4;++ix)
+ {
+ temp = _tensor[ix][3]*in._tensor[ix][3];
+ for(unsigned int iy=0;iy<3;++iy)
+ {
+ temp+=_tensor[ix][iy]*in._tensor[ix][iy];
+ }
+ if(ix<3){output-=temp;}
+ else{output+=temp;}
+ }
+ return output;
+}
+
+// scaling with a complex number
+inline LorentzTensor LorentzTensor::operator *= (Complex a)
+{
+ for(int ix=0;ix<4;++ix){for(int iy=0;iy<4;++iy){_tensor[ix][iy]*=a;}}
+ return *this;
+}
+
+// multiplication by a complex number
+inline LorentzTensor operator * (Complex a, const LorentzTensor & t)
+{
+ return LorentzTensor(a*t.xx(), a*t.xy(), a*t.xz(), a*t.xt(),
+ a*t.yx(), a*t.yy(), a*t.yz(), a*t.yt(),
+ a*t.zx(), a*t.zy(), a*t.zz(), a*t.zt(),
+ a*t.tx(), a*t.ty(), a*t.tz(), a*t.tt());
+}
+inline LorentzTensor LorentzTensor::operator + (const LorentzTensor & in) const
+{
+ return LorentzTensor(xx()+in.xx(),xy()+in.xy(),xz()+in.xz(),xt()+in.xt(),
+ yx()+in.yx(),yy()+in.yy(),yz()+in.yz(),yt()+in.yt(),
+ zx()+in.zx(),zy()+in.zy(),zz()+in.zz(),zt()+in.zt(),
+ tx()+in.tx(),ty()+in.ty(),tz()+in.tz(),tt()+in.tt());
+}
+inline LorentzTensor LorentzTensor::operator - (const LorentzTensor & in) const
+{
+ return LorentzTensor(xx()-in.xx(),xy()-in.xy(),xz()-in.xz(),xt()-in.xt(),
+ yx()-in.yx(),yy()-in.yy(),yz()-in.yz(),yt()-in.yt(),
+ zx()-in.zx(),zy()-in.zy(),zz()-in.zz(),zt()-in.zt(),
+ tx()-in.tx(),ty()-in.ty(),tz()-in.tz(),tt()-in.tt());
+}
+
+inline LorentzPolarizationVector operator *
+(const LorentzPolarizationVector & invec, const LorentzTensor & inten)
+{
+ LorentzPolarizationVector outvec;
+ for(unsigned int ix=0;ix<4;++ix)
+ {
+ outvec[ix]=invec[3]*inten(3,ix)-invec[0]*inten(0,ix)
+ -invec[1]*inten(1,ix)-invec[2]*inten(2,ix);
+ }
+ return outvec;
+}
+inline LorentzPolarizationVector operator *
+(const LorentzTensor & inten, const LorentzPolarizationVector & invec)
+{
+ LorentzPolarizationVector outvec;
+ for(unsigned int ix=0;ix<4;++ix)
+ {
+ outvec[ix]=invec[3]*inten(ix,3)-invec[0]*inten(ix,0)
+ -invec[1]*inten(ix,1)-invec[2]*inten(ix,2);
+ }
+ return outvec;
+}
+
+}
+}
+
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Sep 30, 5:41 AM (1 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6550248
Default Alt Text
(12 KB)
Attached To
Mode
rTHEPEGHG thepeghg
Attached
Detach File
Event Timeline
Log In to Comment