Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:10:06

0001 #ifndef METOOLS_Explicit_C_Spinor_H
0002 #define METOOLS_Explicit_C_Spinor_H
0003 
0004 #include "METOOLS/Currents/C_Vector.H"
0005 #include "ATOOLS/Phys/Spinor.H"
0006 #include "ATOOLS/Org/STL_Tools.H"
0007 
0008 #include <vector>
0009 
0010 namespace METOOLS {
0011 
0012   template <class Scalar>
0013   class CSpinor: public CObject {
0014   public:
0015 
0016     typedef std::complex<Scalar> SComplex;
0017 
0018   protected:
0019     
0020     static double s_accu;
0021 
0022     int m_r, m_b, m_on;
0023 
0024     SComplex m_u[4];
0025 
0026     static ATOOLS::AutoDelete_Vector<CSpinor> s_objects;
0027 
0028     template <class _Scalar> friend std::ostream &
0029     operator<<(std::ostream &ostr,const CSpinor<_Scalar> &s); 
0030 
0031   public:
0032 
0033     static CSpinor *New();
0034     static CSpinor *New(const CSpinor &s);
0035     static CSpinor *New(const int r,const int b,
0036             const int cr=0,const int ca=0,
0037             const size_t &h=0,const size_t &s=0,
0038             const int on=3);
0039 
0040     CObject* Copy() const;
0041 
0042     void Delete();
0043 
0044     bool IsZero() const;
0045 
0046     inline CSpinor(const int r=1,const int b=1,
0047            const int cr=0,const int ca=0,
0048            const size_t &h=0,const size_t &s=0,
0049            const int on=3): 
0050       m_r(r), m_b(b), m_on(on)
0051     { m_u[0]=m_u[1]=m_u[2]=m_u[3]=Scalar(0.0);
0052       m_h=h; m_s=s; m_c[0]=cr; m_c[1]=ca; }
0053     inline CSpinor(const int &r,const int &b,
0054            const SComplex &u1,const SComplex &u2,
0055            const SComplex &u3,const SComplex &u4,
0056            const int cr=0,const int ca=0,
0057            const size_t &h=0,const size_t &s=0,
0058            const int on=3): 
0059       m_r(r), m_b(b), m_on(on)
0060     { m_u[0]=u1; m_u[1]=u2; m_u[2]=u3; m_u[3]=u4;
0061       m_h=h; m_s=s; m_c[0]=cr; m_c[1]=ca; }
0062     inline CSpinor(const int &r,const int &b,const int &h,
0063            const ATOOLS::Vec4<Scalar> &p,
0064            const int cr=0,const int ca=0,
0065            const size_t &hh=0,const size_t &s=0,
0066            const Scalar &m2=-1.0,const int ms=1): 
0067       m_r(r), m_b(b)
0068     { m_h=hh; m_s=s; m_c[0]=cr; m_c[1]=ca; Construct(h,p,m2,ms); }
0069     
0070     // member functions
0071     void Add(const CObject *c);
0072     void Divide(const double &d);
0073     void Multiply(const Complex &c);
0074     void Invert();
0075 
0076     void Construct(const int h,const ATOOLS::Vec4<Scalar> &p,
0077            Scalar m2=-1.0,const int ms=1);
0078     bool SetOn();
0079 
0080     CSpinor CConj() const;
0081 
0082     SComplex operator*(const CSpinor &s) const;
0083 
0084     CSpinor operator*(const Scalar &d) const;
0085     CSpinor operator*(const SComplex &c) const;
0086     CSpinor operator/(const Scalar &d) const;
0087     CSpinor operator/(const SComplex &c) const;
0088 
0089     CSpinor operator*=(const Scalar &d); 
0090     CSpinor operator*=(const SComplex &c); 
0091     CSpinor operator/=(const Scalar &d);
0092     CSpinor operator/=(const SComplex &c); 
0093 
0094     CSpinor operator+(const CSpinor &s) const;
0095     CSpinor operator-(const CSpinor &s) const;
0096 
0097     CSpinor operator+=(const CSpinor &s); 
0098     CSpinor operator-=(const CSpinor &s);
0099 
0100     bool operator==(const CSpinor &s) const;
0101 
0102     // inline functions
0103     inline SComplex &operator[](const size_t &i) 
0104     { return m_u[i]; }
0105     inline const SComplex &operator[](const size_t &i) const 
0106     { return m_u[i]; }
0107 
0108     inline int R() const { return m_r; }
0109     inline int B() const { return m_b; }
0110 
0111     inline int On() const { return m_on; }
0112 
0113     inline CSpinor operator-() const
0114     { return CSpinor(m_r,m_b,-m_u[0],-m_u[1],-m_u[2],-m_u[3],
0115              m_c[0],m_c[1],m_h,m_s,m_on); }
0116 
0117     inline CSpinor Bar() const
0118     { return CSpinor(m_r,-m_b,std::conj(m_u[2]),std::conj(m_u[3]),
0119              std::conj(m_u[0]),std::conj(m_u[1]),m_c[0],m_c[1],
0120              m_h,m_s,(m_on&1)<<1|(m_on&2)>>1); }
0121     
0122     inline static void SetAccuracy(const double &accu) 
0123     { s_accu=accu; }
0124     inline static void ResetAccuracy() 
0125     { s_accu=1.0e-12; }
0126 
0127     inline static double Accuracy() { return s_accu; }
0128 
0129   };// end of class CSpinor
0130   /*!
0131     \class CSpinor
0132     \brief Class representing a Dirac spinor.
0133 
0134     We employ \f$\gamma\f$-matrices in the Weyl representation, i.e.
0135     \f[
0136       \gamma_\mu=\left(\begin{array}{cc}0&\sigma_\mu\\
0137         \bar{\sigma}_\mu&0\end{array}\right)
0138     \f]
0139     where \f$\sigma_\mu=\left(1,-\vec{\sigma}\right)\f$ and 
0140     \f$\bar{\sigma}_\mu=\left(1,\vec{\sigma}\right)\f$.
0141     The pauli matrices \f$\sigma^i\f$ are given by
0142     \f[
0143       \sigma^1=\left(\begin{array}{cc}0&1\\1&0\end{array}\right)\;,\quad
0144       \sigma^2=\left(\begin{array}{cc}0&-i\\i&0\end{array}\right)\;,\quad
0145       \sigma^3=\left(\begin{array}{cc}1&0\\0&-1\end{array}\right)\;.
0146     \f]
0147     In this basis
0148     \f[
0149       \gamma^5=\left(\begin{array}{cc}-1&0\\0&1\end{array}\right)
0150     \f]
0151     The dirac equation thus yields the Eigenspinor problem
0152     \f[
0153       0=\left(p^\mu\gamma_\mu-m\right)u\\
0154        =\left(\begin{array}{cccc}
0155          -m&0&p^0-p^3&-p^1+ip^2\\0&-m&-p^1-ip^2&p^0+p^3\\
0156          p^0+p^3&p^1-ip^2&-m&0\\p^1+ip^2&p^0-p^3&0&-m\end{array}\right)u
0157     \f]
0158     Employing \f$p^\pm=p^0\pm p^3\f$ and \f$p_\perp=p^1+ip^2\f$ 
0159     this can be rewritten to give
0160     \f[
0161       0=\left(\begin{array}{cccc}
0162         -m&0&p^-&-p_\perp^*\\0&-m&-p_\perp&p^+\\
0163         p^+&p_\perp^*&-m&0\\p_\perp&p^-&0&-m\end{array}\right)u
0164     \f]
0165     The Eigenvalues are \f$\lambda=m\pm\sqrt{p^2}\f$. Eigenspinors
0166     can be found by firstly constructing solutions for \f$m=0\f$.
0167     One possible set of such solutions is
0168     \f[
0169       u_+(p,0)=v_-(p,0)=\left(\begin{array}{c}
0170         0\\\chi_+(p)\end{array}\right)\;,\quad
0171       u_-(p,0)=v_+(p,0)=\left(\begin{array}{c}
0172         \chi_-(p)\\0\end{array}\right)\;.
0173     \f]
0174     where
0175     \f[
0176       \chi_+(p)=\frac{1}{\sqrt{p^+}}\left(\begin{array}{c}
0177         p^+\\p_\perp\end{array}\right)=\left(\begin{array}{c}
0178         \sqrt{p^+}\\\sqrt{p^-}e^{i\phi_p}\end{array}\right)\;,\quad
0179       \chi_-(p)=\frac{e^{i\pi}}{\sqrt{p^+}}\left(\begin{array}{c}
0180         -p_\perp^*\\p^+\end{array}\right)=\left(\begin{array}{c}
0181         \sqrt{p^-}e^{-i\phi_p}\\-\sqrt{p^+}\end{array}\right)\;.
0182     \f]
0183     The spinors \f$\chi_\pm(p)\f$ are normalized to \f$2\,p_0\f$.
0184     Defining \f$\bar p=|\vec p|\f$ and 
0185     \f$\hat p=(\,{\rm sgn}(p_0)\,\bar p,\vec p\;)\f$, possible solutions 
0186     for \f$m\neq 0\f$ are [Nucl. Phys. B274 (1986) 1-32]
0187     \f[
0188       u_+(p,m)=\frac{1}{\sqrt{2\,\bar p}}\left(\begin{array}{r}
0189           \sqrt{p_0-\bar p}\;\chi_+(\hat p)\\
0190       \sqrt{p_0+\bar p}\;\chi_+(\hat p)\end{array}\right)\;,\quad
0191       v_-(p,m)=\frac{1}{\sqrt{2\,\bar p}}\left(\begin{array}{r}
0192           -\sqrt{p_0-\bar p}\;\chi_+(\hat p)\\
0193       \sqrt{p_0+\bar p}\;\chi_+(\hat p)\end{array}\right)\;,
0194     \f]
0195     \f[
0196       u_-(p,m)=\frac{1}{\sqrt{2\,\bar p}}\left(\begin{array}{r}
0197           \sqrt{p_0+\bar p}\;\chi_-(\hat p)\\
0198           \sqrt{p_0-\bar p}\;\chi_-(\hat p)\end{array}\right)\;,\quad
0199       v_+(p,m)=\frac{1}{\sqrt{2\,\bar p}}\left(\begin{array}{r}
0200           \sqrt{p_0+\bar p}\;\chi_-(\hat p)\\
0201       -\sqrt{p_0-\bar p}\;\chi_-(\hat p)\end{array}\right)\;.
0202     \f]
0203     These Eigenspinors are orthogonal and satisfy the relations
0204     \f$\bar u_\lambda(p,m)u_\lambda(p,m)=2m\f$ 
0205     and \f$\bar v_\lambda(p,m)v_\lambda(p,m)=-2m\f$. 
0206     In the above spinor basis the color-ordered quark-quark-gluon vertex reads
0207     \f[
0208       \frac{i}{\sqrt{2}}\bar{u}\gamma^\mu v\\=
0209       \frac{i}{\sqrt{2}}\left(\bar{u}_0,\bar{u}_1,\bar{u}_2,\bar{u}_3\right)
0210       \left(\begin{array}{c}\left(\begin{array}{cc}0&1\\1&0\end{array}\right)\\
0211         \left(\begin{array}{cc}0&\sigma^1\\-\sigma^1&0\end{array}\right)\\
0212         \left(\begin{array}{cc}0&\sigma^2\\-\sigma^2&0\end{array}\right)\\
0213         \left(\begin{array}{cc}0&\sigma^3\\-\sigma^3&0\end{array}\right)
0214       \end{array}\right)
0215       \left(\begin{array}{c}v_0\\v_1\\v_2\\v_3\end{array}\right)\\=
0216       \frac{i}{\sqrt{2}}\left(\begin{array}{c}
0217         \bar{u}_0v_2+\bar{u}_1v_3+\bar{u}_2v_0+\bar{u}_3v_1\\
0218         \bar{u}_0v_3+\bar{u}_1v_2-\bar{u}_2v_1-\bar{u}_3v_0\\
0219         -i\left(\bar{u}_0v_3-\bar{u}_1v_2-\bar{u}_2v_1+\bar{u}_3v_0\right)\\
0220         \bar{u}_0v_2-\bar{u}_1v_3-\bar{u}_2v_0+\bar{u}_3v_1\end{array}\right)
0221     \f]
0222     The color-ordered quark-gluon-quark vertices read
0223     \f[
0224       \frac{i}{\sqrt{2}}j^\mu\gamma_\mu v\\=
0225       \frac{i}{\sqrt{2}}\left(\begin{array}{cccc}
0226         0&0&j^-&-j_\perp^*\\0&0&-j_\perp&j^+\\
0227         j^+&j_\perp^*&0&0\\j_\perp&j^-&0&0\end{array}\right)
0228       \left(\begin{array}{c}v_0\\v_1\\v_2\\v_3\end{array}\right)\\=
0229       \frac{i}{\sqrt{2}}\left(\begin{array}{c}
0230         j^-v_2-j_\perp^*v_3\\-j_\perp v_2+j^+v_3\\
0231         j^+v_0+j_\perp^*v_1\\j_\perp v_0+j^-v_1\end{array}\right)
0232     \f]
0233     and
0234     \f[
0235       \frac{i}{\sqrt{2}}\bar{u}j^\mu\gamma_\mu\\=
0236       \frac{i}{\sqrt{2}}\left(\bar{u}_0,\bar{u}_1,\bar{u}_2,\bar{u}_3\right)
0237       \left(\begin{array}{cccc}0&0&j^-&-j_\perp^*\\0&0&-j_\perp&j^+\\
0238         j^+&j_\perp^*&0&0\\j_\perp&j^-&0&0\end{array}\right)\\=
0239       \frac{i}{\sqrt{2}}\left(
0240         \bar{u}_2j^++\bar{u}_3j_\perp,\bar{u}_2j_\perp^*+\bar{u}_3j^-,
0241         \bar{u}_0j^--\bar{u}_1j_\perp,-\bar{u}_0j_\perp^*+\bar{u}_1j^+\right)
0242     \f]
0243   */
0244     
0245   template <class Scalar>
0246   std::ostream &operator<<(std::ostream &ostr,const CSpinor<Scalar> &s); 
0247 
0248 }// end of namespace BCF
0249 
0250 #define DDSpinor METOOLS::CSpinor<double>
0251 #define QDSpinor METOOLS::CSpinor<long double>
0252 
0253 #endif