Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:38:25

0001 // -*- C++ -*-
0002 //
0003 // LorentzRSSpinor.h is a part of ThePEG - Toolkit for HEP Event Generation
0004 // Copyright (C) 2003-2019 Peter Richardson, Leif Lonnblad
0005 //
0006 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef ThePEG_LorentzRSSpinor_H
0010 #define ThePEG_LorentzRSSpinor_H
0011 
0012 #include "ThePEG/Config/ThePEG.h"
0013 #include "ThePEG/Vectors/ThreeVector.h"
0014 #include "HelicityDefinitions.h"
0015 #include "LorentzRSSpinor.fh"
0016 #include "LorentzRSSpinorBar.h"
0017 #include "LorentzSpinorBar.h"
0018 #include "LorentzSpinor.h"
0019 #include "LorentzPolarizationVector.h"
0020 
0021 namespace ThePEG{
0022 namespace Helicity{
0023 
0024 /**
0025  *  The LorentzRSSpinor class is designed to store a Rarita-Schwinger
0026  *  spinor for a spin-3/2 particle. In addition to storing the
0027  *  components of the spinor information is stored on the type of
0028  *  spinor, for example u or v type.
0029  *
0030  *  At the moment only one choice of the Dirac matrix representation
0031  *  is supported. For high-energy calculations the choice made by the
0032  *  HELAS collaboration is more efficient for numerical
0033  *  calculations. In this representation
0034  *
0035  *  \f[
0036  * \gamma_{i=1,2,3}=\left(\begin{array}{cc}
0037  *                          0 & \sigma_i \\
0038  *                          -\sigma_i & 0
0039  *                        \end{array}\right)
0040  *          \quad
0041  * \gamma_0=\left(\begin{array}{cc}
0042  *                  0 & 1 \\
0043  *                  1 & 0
0044  *                \end{array}\right)
0045  *          \quad
0046  * \gamma_5=\left(\begin{array}{cc}
0047  *                  -1 & 0 \\
0048  *                  0 & 1
0049  *                \end{array}\right)
0050  * \f]
0051  *
0052  *  The type of the spinor is also stored using the SpinorType
0053  *  enumeration.  There are three types supported SpinorType::u,
0054  *  SpinorType::v, SpinorType::unknown.  This information is intended
0055  *  mainly for use in the case of Majorana particles where matrix
0056  *  elements can be calculated with either u or v type spinors and
0057  *  knowledge of which was used will be needed in order to give the
0058  *  correct correlations. The SpinorType::unknowne is intended for
0059  *  cases where either the spinor for an off-shell line in a matrix
0060  *  element calculation or the information is genuinely unknown.
0061  *
0062  *  The LorentzRSSpinorBar class is also provided to store the barred
0063  *  spinor.
0064  *
0065  *
0066  * @see HelicityDefinitions
0067  * @see LorentzRSSpinorBar
0068  *
0069  * \author Peter Richardson
0070  *
0071  */
0072 template<typename Value>
0073 class LorentzRSSpinor {
0074 
0075 public:
0076 
0077   /** @name Standard constructors. */
0078   //@{
0079   /**
0080    * Default zero constructor, optionally specifying \a t, the type.
0081    */
0082   LorentzRSSpinor(SpinorType t = SpinorType::unknown) : _type(t), _spin() {}
0083 
0084   /**
0085    * Constructor with complex numbers specifying the components,
0086    * optionally specifying \a t, the type.
0087    */
0088   LorentzRSSpinor(complex<Value> a1, complex<Value> b1,
0089           complex<Value> c1, complex<Value> d1,
0090           complex<Value> a2, complex<Value> b2,
0091           complex<Value> c2, complex<Value> d2,
0092           complex<Value> a3, complex<Value> b3,
0093           complex<Value> c3, complex<Value> d3,
0094           complex<Value> a4, complex<Value> b4,
0095           complex<Value> c4, complex<Value> d4,
0096           SpinorType t=SpinorType::unknown) 
0097     : _type(t), _spin{{ {{a1,b1,c1,d1}},
0098                         {{a2,b2,c2,d2}},
0099                         {{a3,b3,c3,d3}},
0100                         {{a4,b4,c4,d4}}
0101                       }} {}
0102   
0103   template <typename U>
0104   LorentzRSSpinor(const LorentzRSSpinor<U> & other)
0105     : _type(other._type), _spin(other._spin) {}
0106   //@}
0107 
0108   /** @name Access the components. */
0109   //@{
0110   /**
0111    * Subscript operator to return spinor components
0112    */
0113   complex<Value> operator()(int i, int j) const {
0114     assert( i >= 0 && i <= 3 && j>=0 && j<=3);
0115     return _spin[i][j];
0116   }
0117 
0118   /**
0119    * Set components by index
0120    */
0121   complex<Value> & operator () (int i, int j) {
0122     assert( i >= 0 && i <= 3 && j>=0 && j<=3);
0123     return _spin[i][j];
0124   }
0125 
0126   /**
0127    * Get first spinor component for the x vector
0128    */
0129   complex<Value> xs1() const {return _spin[0][0];}
0130 
0131   /**
0132    * Get second spinor component for the x vector
0133    */
0134   complex<Value> xs2() const {return _spin[0][1];}
0135 
0136   /**
0137    * Get third  spinor component for the x vector
0138    */
0139   complex<Value> xs3() const {return _spin[0][2];}
0140 
0141   /**
0142    * Get fourth  spinor component for the x vector
0143    */
0144   complex<Value> xs4() const {return _spin[0][3];}
0145 
0146   /**
0147    * Get first spinor component for the y vector
0148    */
0149   complex<Value> ys1() const {return _spin[1][0];}
0150 
0151   /**
0152    * Get second spinor component for the y vector
0153    */
0154   complex<Value> ys2() const {return _spin[1][1];}
0155   
0156   /**
0157    * Get third spinor component for the y vector
0158    */
0159   complex<Value> ys3() const {return _spin[1][2];}
0160   
0161   /**
0162    * Get fourth spinor component for the y vector
0163    */
0164   complex<Value> ys4() const {return _spin[1][3];}
0165   
0166   /**
0167    * Get first spinor component for the z vector
0168    */
0169   complex<Value> zs1() const {return _spin[2][0];}
0170   
0171   /**
0172    * Get second spinor component for the z vector
0173    */
0174   complex<Value> zs2() const {return _spin[2][1];}
0175   
0176   /**
0177    * Get third spinor component for the z vector
0178    */
0179   complex<Value> zs3() const {return _spin[2][2];}
0180   
0181   /**
0182    * Get fourth spinor component for the z vector
0183    */
0184   complex<Value> zs4() const {return _spin[2][3];}
0185   
0186   /**
0187    * Get first spinor component for the t vector
0188    */
0189   complex<Value> ts1() const {return _spin[3][0];}
0190   
0191   /**
0192    * Get second spinor component for the t vector
0193    */
0194   complex<Value> ts2() const {return _spin[3][1];}
0195   
0196   /**
0197    * Get third spinor component for the t vector
0198    */
0199   complex<Value> ts3() const {return _spin[3][2];}
0200   
0201   /**
0202    * Get fourth spinor component for the t vector
0203    */
0204   complex<Value> ts4() const {return _spin[3][3];}
0205   
0206   /**
0207    * Set first spinor component for the x vector
0208    */
0209   void setXS1(complex<Value> in) {_spin[0][0]=in;}
0210   
0211   /**
0212    * Set second spinor component for the x vector
0213    */
0214   void setXS2(complex<Value> in) {_spin[0][1]=in;}
0215   
0216   /**
0217    * Set third spinor component for the x vector
0218    */
0219   void setXS3(complex<Value> in) {_spin[0][2]=in;}
0220   
0221   /**
0222    * Set fourth spinor component for the x vector
0223    */
0224   void setXS4(complex<Value> in) {_spin[0][3]=in;}
0225   
0226   /**
0227    * Set first spinor component for the y vector
0228    */
0229   void setYS1(complex<Value> in) {_spin[1][0]=in;}
0230   
0231   /**
0232    * Set second spinor component for the y vector
0233    */
0234   void setYS2(complex<Value> in) {_spin[1][1]=in;}
0235   
0236   /**
0237    * Set third spinor component for the y vector
0238    */
0239   void setYS3(complex<Value> in) {_spin[1][2]=in;}
0240   
0241   /**
0242    * Set fourth spinor component for the y vector
0243    */
0244   void setYS4(complex<Value> in) {_spin[1][3]=in;}
0245   
0246   /**
0247    * Set first spinor component for the z vector
0248    */
0249   void setZS1(complex<Value> in) {_spin[2][0]=in;}
0250   
0251   /**
0252    * Set second spinor component for the z vector
0253    */
0254   void setZS2(complex<Value> in) {_spin[2][1]=in;}
0255   
0256   /**
0257    * Set third spinor component for the z vector
0258    */
0259   void setZS3(complex<Value> in) {_spin[2][2]=in;}
0260   
0261   /**
0262    * Set fourth spinor component for the z vector
0263    */
0264   void setZS4(complex<Value> in) {_spin[2][3]=in;}
0265   
0266   /**
0267    * Set first spinor component for the t vector
0268    */
0269   void setTS1(complex<Value> in) {_spin[3][0]=in;}
0270   
0271   /**
0272    * Set second spinor component for the t vector
0273    */
0274   void setTS2(complex<Value> in) {_spin[3][1]=in;}
0275   
0276   /**
0277    * Set third spinor component for the t vector
0278    */
0279   void setTS3(complex<Value> in) {_spin[3][2]=in;}
0280   
0281   /**
0282    * Set fourth spinor component for the t vector
0283    */
0284   void setTS4(complex<Value> in) {_spin[3][3]=in;}
0285   //@}
0286 
0287   /// @name Mathematical assignment operators.
0288   //@{
0289   template <typename ValueB>
0290   LorentzRSSpinor<Value> & operator+=(const LorentzRSSpinor<ValueB> & a) {
0291     for(unsigned int ix=0;ix<4;++ix)
0292       for(unsigned int iy=0;iy<4;++iy)
0293     _spin[ix][iy] += a._spin[ix][iy];
0294     return *this;
0295   }
0296   
0297   template <typename ValueB>
0298   LorentzRSSpinor<Value> & operator-=(const LorentzRSSpinor<ValueB> & a) {
0299     for(unsigned int ix=0;ix<4;++ix)
0300       for(unsigned int iy=0;iy<4;++iy)
0301     _spin[ix][iy] -= a._spin[ix][iy];
0302     return *this;
0303   }
0304   
0305   LorentzRSSpinor<Value> & operator*=(double a) {
0306     for(unsigned int ix=0;ix<4;++ix)
0307       for(unsigned int iy=0;iy<4;++iy)
0308     _spin[ix][iy] *=a;
0309     return *this;
0310   }
0311   
0312   LorentzRSSpinor<Value> & operator/=(double a) {
0313     for(unsigned int ix=0;ix<4;++ix)
0314       for(unsigned int iy=0;iy<4;++iy)
0315     _spin[ix][iy] /=a;
0316     return *this;
0317   }
0318   //@}
0319   
0320   /** @name Arithmetic operators. */
0321   //@{
0322   /**
0323    * dot product with a polarization vector
0324    */
0325   LorentzSpinor<Value> dot(const LorentzPolarizationVector & vec) const {
0326     LorentzSpinor<Value> output(_type);
0327     complex<Value> temp;
0328     unsigned int ix;
0329     for(ix=0;ix<4;++ix) {
0330       temp  = _spin[3][ix]*vec.t();
0331       temp -= _spin[0][ix]*vec.x();
0332       temp -= _spin[1][ix]*vec.y();
0333       temp -= _spin[2][ix]*vec.z();
0334       output[ix]=temp;
0335     }
0336     return output;
0337   }
0338 
0339   /**
0340    * dot product with a 4-vector
0341    */
0342   LorentzSpinor<Value> dot(const LorentzMomentum & invec) const {
0343     LorentzSpinor<Value> output(_type);
0344     complex<Value> temp;
0345     LorentzVector<double> vec = UnitRemoval::InvE * invec;
0346     unsigned int ix;
0347     for(ix=0;ix<4;++ix) {
0348       temp  = - ( _spin[0][ix]*vec.x() + _spin[1][ix]*vec.y()+
0349           _spin[2][ix]*vec.z() ) +  _spin[3][ix]*vec.t();
0350       output[ix]=temp;
0351     }
0352     return output;
0353   }
0354   //@}
0355 
0356   /** @name Transformations. */
0357   //@{
0358   /**
0359    * return the barred spinor
0360    */
0361   LorentzRSSpinorBar<Value> bar() const;
0362 
0363   /**
0364    * Standard Lorentz boost specifying the components of the beta vector.
0365    */
0366   LorentzRSSpinor & boost(double,double,double);
0367 
0368   /**
0369    * Standard Lorentz boost specifying the beta vector.
0370    */
0371   LorentzRSSpinor & boost(const Boost &);
0372 
0373   /**
0374    * General transform
0375    */
0376   LorentzRSSpinor & transform(const LorentzRotation &);
0377   //@}
0378 
0379   /** @name Functions related to type. */
0380   //@{
0381 
0382   /**
0383    * Return the type of the spinor.
0384    */
0385   SpinorType Type() const {return _type;}
0386   //@}
0387 
0388   /**
0389    * Scalar product \f$\bar{f}^\alpha(c_LP_L+c_RP_R)f_\alpha\f$ for general couplings
0390    * @param fbar The barred spinor
0391    * @param left The left-handed coupling, \f$c_L\f$.
0392    * @param right The right-handed coupling, \f$c_R\f$.
0393    */
0394   template <typename ValueB>
0395   auto generalScalar(LorentzRSSpinorBar<ValueB>& fbar, 
0396                      Complex left, Complex right) 
0397   -> decltype(left*fbar(3,0)*this->ts1())
0398   {
0399     decltype(left*fbar(3,0)*ts1()) output; 
0400     unsigned int iz;
0401     output = 
0402       left*(fbar(3,0)*_spin[3][0]+fbar(3,1)*_spin[3][1])
0403       +right*(fbar(3,2)*_spin[3][2]+fbar(3,3)*_spin[3][3]);
0404     for(iz=0;iz<3;++iz) {
0405       output -=
0406     left*(fbar(iz,0)*_spin[iz][0]+fbar(iz,1)*_spin[iz][1])
0407     +right*(fbar(iz,2)*_spin[iz][2]+fbar(iz,3)*_spin[iz][3]);
0408     }
0409     return output;
0410   }
0411   
0412   /**
0413    *  Current \f$\bar{f}(c_LP_L+c_RP_R)f^\alpha\f$ for general couplings.
0414    * @param fbar The barred spinor
0415    * @param left The left-handed coupling, \f$c_L\f$.
0416    * @param right The right-handed coupling, \f$c_R\f$.
0417    */
0418   template <typename ValueB>
0419   auto generalCurrent(LorentzSpinorBar<ValueB>& fbar, 
0420                       Complex left, Complex right) 
0421   -> LorentzVector<decltype(left*fbar.s1()*this->ts1())>
0422   {
0423     typedef decltype(left*fbar.s1()*ts1()) ResultT;
0424     ResultT output[4];
0425     for(size_t iz=0;iz<4;++iz)
0426       output[iz]= left*(fbar.s1()*_spin[iz][0]+fbar.s2()*_spin[iz][1])
0427     +right*(fbar.s3()*_spin[iz][2]+fbar.s4()*_spin[iz][3]);
0428     return LorentzVector<ResultT>(output[0],output[1],output[2],output[3]);
0429   }
0430   
0431 private:
0432 
0433   /**
0434    * Type of spinor
0435    */
0436   SpinorType _type;
0437 
0438   /**
0439    * Storage of the components.
0440    */
0441   std::array<std::array<complex<Value>,4>,4> _spin;
0442 };
0443 
0444 /// @name Basic mathematical operations
0445 //@{
0446 template <typename Value>
0447 inline LorentzRSSpinor<double>
0448 operator/(const LorentzRSSpinor<Value> & v, Value a) {
0449   return LorentzRSSpinor<double>(v.xs1()/a, v.xs2()/a, v.xs3()/a, v.xs4()/a,
0450                    v.ys1()/a, v.ys2()/a, v.ys3()/a, v.ys4()/a,
0451                    v.zs1()/a, v.zs2()/a, v.zs3()/a, v.zs4()/a,
0452                    v.ts1()/a, v.ts2()/a, v.ts3()/a, v.ts4()/a,
0453                    v.Type());
0454 }
0455 
0456 inline LorentzRSSpinor<double>
0457 operator/(const LorentzRSSpinor<double> & v, Complex a) {
0458   return LorentzRSSpinor<double>(v.xs1()/a, v.xs2()/a, v.xs3()/a, v.xs4()/a,
0459                  v.ys1()/a, v.ys2()/a, v.ys3()/a, v.ys4()/a,
0460                  v.zs1()/a, v.zs2()/a, v.zs3()/a, v.zs4()/a,
0461                  v.ts1()/a, v.ts2()/a, v.ts3()/a, v.ts4()/a,
0462                  v.Type());
0463 }
0464 
0465 template <typename Value>
0466 inline LorentzRSSpinor<Value> operator-(const LorentzRSSpinor<Value> & v) {
0467   return LorentzRSSpinor<Value>(-v.xs1(),-v.xs2(),-v.xs3(),-v.xs4(),
0468                 -v.ys1(),-v.ys2(),-v.ys3(),-v.ys4(),
0469                 -v.zs1(),-v.zs2(),-v.zs3(),-v.zs4(),
0470                 -v.ts1(),-v.ts2(),-v.ts3(),-v.ts4(),
0471                 v.Type());
0472 }
0473 
0474 template <typename ValueA, typename ValueB>
0475 inline LorentzRSSpinor<ValueA>
0476 operator+(LorentzRSSpinor<ValueA> a, const LorentzRSSpinor<ValueB> & b) {
0477   return a += b;
0478 }
0479 
0480 template <typename ValueA, typename ValueB>
0481 inline LorentzRSSpinor<ValueA>
0482 operator-(LorentzRSSpinor<ValueA> a, const LorentzRSSpinor<ValueB> & b) {
0483   return a -= b;
0484 }
0485 
0486 template <typename Value>
0487 inline LorentzRSSpinor<Value>
0488 operator*(const LorentzRSSpinor<Value> & a, double b) {
0489   return LorentzRSSpinor<Value>(a.xs1()*b, a.xs2()*b, a.xs3()*b, a.xs4()*b,
0490                 a.ys1()*b, a.ys2()*b, a.ys3()*b, a.ys4()*b,
0491                 a.zs1()*b, a.zs2()*b, a.zs3()*b, a.zs4()*b,
0492                 a.ts1()*b, a.ts2()*b, a.ts3()*b, a.ts4()*b,a.Type());
0493 }
0494 
0495 template <typename Value>
0496 inline LorentzRSSpinor<Value>
0497 operator*(double b, LorentzRSSpinor<Value> a) {
0498   return a *= b;
0499 }
0500   
0501 template <typename Value>
0502 inline LorentzRSSpinor<Value>
0503 operator*(const LorentzRSSpinor<Value> & a, Complex b) {
0504   return LorentzRSSpinor<Value>(a.xs1()*b, a.xs2()*b, a.xs3()*b, a.xs4()*b,
0505                 a.ys1()*b, a.ys2()*b, a.ys3()*b, a.ys4()*b,
0506                 a.zs1()*b, a.zs2()*b, a.zs3()*b, a.zs4()*b,
0507                 a.ts1()*b, a.ts2()*b, a.ts3()*b, a.ts4()*b,a.Type());
0508 }
0509 
0510 template <typename ValueA, typename ValueB>
0511 inline auto operator*(complex<ValueB> a, const LorentzRSSpinor<ValueA> & v) 
0512   -> LorentzRSSpinor<decltype(a.real()*v.xs1().real())>
0513 {
0514   return {a*v.xs1(), a*v.xs2(), a*v.xs3(), a*v.xs4(),
0515           a*v.ys1(), a*v.ys2(), a*v.ys3(), a*v.ys4(),
0516           a*v.zs1(), a*v.zs2(), a*v.zs3(), a*v.zs4(),
0517           a*v.ts1(), a*v.ts2(), a*v.ts3(), a*v.ts4(),v.Type()};
0518 }
0519 
0520 template <typename ValueA, typename ValueB>
0521 inline auto operator*(const LorentzRSSpinor<ValueA> & v, complex<ValueB> b) 
0522   -> LorentzRSSpinor<decltype(b.real()*v.xs1().real())>
0523 {
0524   return b*v;
0525 }
0526 
0527 template <typename ValueA, typename ValueB>
0528 inline auto operator/(const LorentzRSSpinor<ValueA> & v, complex<ValueB> b) 
0529   -> LorentzRSSpinor<decltype(v.xs1().real()/b.real())>
0530 {
0531   return {v.xs1()/b, v.xs2()/b, v.xs3()/b, v.xs4()/b,
0532           v.ys1()/b, v.ys2()/b, v.ys3()/b, v.ys4()/b,
0533           v.zs1()/b, v.zs2()/b, v.zs3()/b, v.zs4()/b,
0534           v.ts1()/b, v.ts2()/b, v.ts3()/b, v.ts4()/b,v.Type()};
0535 }
0536   
0537 template <typename ValueA, typename ValueB>
0538 inline auto operator*(ValueB a, const LorentzRSSpinor<ValueA> & v) 
0539   -> LorentzRSSpinor<decltype(a*v.xs1().real())>
0540 {
0541   return {a*v.xs1(), a*v.xs2(), a*v.xs3(), a*v.xs4(),
0542           a*v.ys1(), a*v.ys2(), a*v.ys3(), a*v.ys4(),
0543           a*v.zs1(), a*v.zs2(), a*v.zs3(), a*v.zs4(),
0544           a*v.ts1(), a*v.ts2(), a*v.ts3(), a*v.ts4(),v.Type()};
0545 }
0546 
0547 template <typename ValueA, typename ValueB>
0548 inline auto operator*(const LorentzRSSpinor<ValueA> & v, ValueB b) 
0549   -> LorentzRSSpinor<decltype(b*v.xs1().real())>
0550 {
0551   return b*v;
0552 }
0553 
0554 template <typename ValueA, typename ValueB>
0555 inline auto operator/(const LorentzRSSpinor<ValueA> & v, ValueB b) 
0556   -> LorentzRSSpinor<decltype(v.xs1().real()/b)>
0557 {
0558   return {v.xs1()/b, v.xs2()/b, v.xs3()/b, v.xs4()/b,
0559           v.ys1()/b, v.ys2()/b, v.ys3()/b, v.ys4()/b,
0560           v.zs1()/b, v.zs2()/b, v.zs3()/b, v.zs4()/b,
0561           v.ts1()/b, v.ts2()/b, v.ts3()/b, v.ts4()/b,v.Type()};
0562 }
0563 //@}
0564 
0565 }
0566 }
0567 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
0568 #include "LorentzRSSpinor.tcc"
0569 #endif 
0570 
0571 #endif