File indexing completed on 2026-08-06 09:38:25
0001
0002
0003
0004
0005
0006
0007
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
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072 template<typename Value>
0073 class LorentzRSSpinor {
0074
0075 public:
0076
0077
0078
0079
0080
0081
0082 LorentzRSSpinor(SpinorType t = SpinorType::unknown) : _type(t), _spin() {}
0083
0084
0085
0086
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
0109
0110
0111
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
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
0128
0129 complex<Value> xs1() const {return _spin[0][0];}
0130
0131
0132
0133
0134 complex<Value> xs2() const {return _spin[0][1];}
0135
0136
0137
0138
0139 complex<Value> xs3() const {return _spin[0][2];}
0140
0141
0142
0143
0144 complex<Value> xs4() const {return _spin[0][3];}
0145
0146
0147
0148
0149 complex<Value> ys1() const {return _spin[1][0];}
0150
0151
0152
0153
0154 complex<Value> ys2() const {return _spin[1][1];}
0155
0156
0157
0158
0159 complex<Value> ys3() const {return _spin[1][2];}
0160
0161
0162
0163
0164 complex<Value> ys4() const {return _spin[1][3];}
0165
0166
0167
0168
0169 complex<Value> zs1() const {return _spin[2][0];}
0170
0171
0172
0173
0174 complex<Value> zs2() const {return _spin[2][1];}
0175
0176
0177
0178
0179 complex<Value> zs3() const {return _spin[2][2];}
0180
0181
0182
0183
0184 complex<Value> zs4() const {return _spin[2][3];}
0185
0186
0187
0188
0189 complex<Value> ts1() const {return _spin[3][0];}
0190
0191
0192
0193
0194 complex<Value> ts2() const {return _spin[3][1];}
0195
0196
0197
0198
0199 complex<Value> ts3() const {return _spin[3][2];}
0200
0201
0202
0203
0204 complex<Value> ts4() const {return _spin[3][3];}
0205
0206
0207
0208
0209 void setXS1(complex<Value> in) {_spin[0][0]=in;}
0210
0211
0212
0213
0214 void setXS2(complex<Value> in) {_spin[0][1]=in;}
0215
0216
0217
0218
0219 void setXS3(complex<Value> in) {_spin[0][2]=in;}
0220
0221
0222
0223
0224 void setXS4(complex<Value> in) {_spin[0][3]=in;}
0225
0226
0227
0228
0229 void setYS1(complex<Value> in) {_spin[1][0]=in;}
0230
0231
0232
0233
0234 void setYS2(complex<Value> in) {_spin[1][1]=in;}
0235
0236
0237
0238
0239 void setYS3(complex<Value> in) {_spin[1][2]=in;}
0240
0241
0242
0243
0244 void setYS4(complex<Value> in) {_spin[1][3]=in;}
0245
0246
0247
0248
0249 void setZS1(complex<Value> in) {_spin[2][0]=in;}
0250
0251
0252
0253
0254 void setZS2(complex<Value> in) {_spin[2][1]=in;}
0255
0256
0257
0258
0259 void setZS3(complex<Value> in) {_spin[2][2]=in;}
0260
0261
0262
0263
0264 void setZS4(complex<Value> in) {_spin[2][3]=in;}
0265
0266
0267
0268
0269 void setTS1(complex<Value> in) {_spin[3][0]=in;}
0270
0271
0272
0273
0274 void setTS2(complex<Value> in) {_spin[3][1]=in;}
0275
0276
0277
0278
0279 void setTS3(complex<Value> in) {_spin[3][2]=in;}
0280
0281
0282
0283
0284 void setTS4(complex<Value> in) {_spin[3][3]=in;}
0285
0286
0287
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
0321
0322
0323
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
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
0357
0358
0359
0360
0361 LorentzRSSpinorBar<Value> bar() const;
0362
0363
0364
0365
0366 LorentzRSSpinor & boost(double,double,double);
0367
0368
0369
0370
0371 LorentzRSSpinor & boost(const Boost &);
0372
0373
0374
0375
0376 LorentzRSSpinor & transform(const LorentzRotation &);
0377
0378
0379
0380
0381
0382
0383
0384
0385 SpinorType Type() const {return _type;}
0386
0387
0388
0389
0390
0391
0392
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
0414
0415
0416
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
0435
0436 SpinorType _type;
0437
0438
0439
0440
0441 std::array<std::array<complex<Value>,4>,4> _spin;
0442 };
0443
0444
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