23 __device__ gpuLVec() { X = Y = Z = E = 0; };
37 __device__
fptype Dot(
const gpuLVec &rhs)
const {
return E * rhs.E - X * rhs.X - Y * rhs.Y - Z * rhs.Z; }
38 __device__
inline fptype GetX()
const {
return X; }
39 __device__
inline fptype GetY()
const {
return Y; }
40 __device__
inline fptype GetZ()
const {
return Z; }
41 __device__
inline fptype GetE()
const {
return E; }
43 __device__
inline fptype Mag2()
const {
return this->Dot(*
this); }
44 __device__
inline fptype M()
const {
return sqrt(this->Mag2()); }
45 __device__
inline void SetX(
fptype a) { X = a; }
46 __device__
inline void SetY(
fptype a) { Y = a; }
47 __device__
inline void SetZ(
fptype a) { Z = a; }
48 __device__
inline void SetE(
fptype a) { E = a; }
50 __device__ gpuLVec &operator+=(
const gpuLVec &rhs) {
57 __device__ gpuLVec &operator-=(
const gpuLVec &rhs) {
64 __device__ gpuLVec &operator*=(
const fptype rhs) {
72 __device__ gpuLVec
operator+(gpuLVec lhs,
const gpuLVec &rhs) {
return lhs += rhs; }
73 __device__ gpuLVec
operator-(gpuLVec lhs,
const gpuLVec &rhs) {
return lhs -= rhs; }
81 : gpuLVec(q - q.Dot(p) * p * (1. / (mR * mR))) {}
83 __device__
fptype Contract(
const gpuLVec &rhs)
const {
return this->Dot(rhs); }
95 __device__ gpuLVec
Dot(
const gpuLVec &rhs)
const {
return -1.0 * rhs + _p * (_p.Dot(rhs) / (_mR * _mR)); }
96 __device__
fptype Sandwich(
const gpuLVec &lhs,
const gpuLVec &rhs)
const {
return lhs.Dot(this->Dot(rhs)); }
106 __device__
fptype Sandwich(
const gpuLVec &lm,
const gpuLVec &ln,
const gpuLVec &ra,
const gpuLVec &rb) {
111 return (1. / 2.) * (manb + mbna) - (1. / 3.) * mnab;
120 X().SetXYZE(0, 0, 0, 0);
121 Y().SetXYZE(0, 0, 0, 0);
122 Z().SetXYZE(0, 0, 0, 0);
123 E().SetXYZE(0, 0, 0, 0);
128 __device__
const gpuLVec &
v(
int i)
const {
return _v[i]; }
133 for(
int i = 0; i < 4; i++)
137 for(
int i = 0; i < 4; i++)
140 __device__
const gpuLVec &
X()
const {
return _v[0]; }
141 __device__
const gpuLVec &
Y()
const {
return _v[1]; }
142 __device__
const gpuLVec &
Z()
const {
return _v[2]; }
143 __device__
const gpuLVec &
E()
const {
return _v[3]; }
145 __device__ gpuLVec &
X() {
return _v[0]; }
146 __device__ gpuLVec &
Y() {
return _v[1]; }
147 __device__ gpuLVec &
Z() {
return _v[2]; }
148 __device__ gpuLVec &
E() {
return _v[3]; }
150 __device__
const gpuLVec &
operator[](
int i)
const {
return _v[i]; }
154 for(
int i = 0; i < 4; i++)
155 _v[i] += other.
_v[i];
160 for(
int i = 0; i < 4; i++)
161 _v[i] -= other.
_v[i];
183 for(
int i = 0; i < 4; i++)
217 X().SetY(Y().GetX());
218 X().SetZ(Z().GetX());
219 X().SetE(E().GetX());
221 Y().SetX(X().GetY());
222 Y().SetZ(Z().GetY());
223 Y().SetE(E().GetY());
225 Z().SetX(X().GetZ());
226 Z().SetY(Y().GetZ());
227 Z().SetE(E().GetZ());
229 E().SetX(X().GetE());
230 E().SetY(Y().GetE());
231 E().SetZ(Z().GetE());
235 X().SetXYZE(0, 0, 0, 0);
236 Y().SetXYZE(0, 0, 0, 0);
237 Z().SetXYZE(0, 0, 0, 0);
238 E().SetXYZE(0, 0, 0, 0);
244 X().SetXYZE(-1, 0, 0, 0);
245 Y().SetXYZE(0, -1, 0, 0);
246 Z().SetXYZE(0, 0, -1, 0);
247 E().SetXYZE(0, 0, 0, 1);
256 X().SetX(p.GetX() * p.GetX());
257 X().SetY(p.GetX() * p.GetY());
258 X().SetZ(p.GetX() * p.GetZ());
259 X().SetE(p.GetX() * p.GetE());
261 Y().SetX(p.GetY() * p.GetX());
262 Y().SetY(p.GetY() * p.GetY());
263 Y().SetZ(p.GetY() * p.GetZ());
264 Y().SetE(p.GetY() * p.GetE());
266 Z().SetX(p.GetZ() * p.GetX());
267 Z().SetY(p.GetZ() * p.GetY());
268 Z().SetZ(p.GetZ() * p.GetZ());
269 Z().SetE(p.GetZ() * p.GetE());
271 E().SetX(p.GetE() * p.GetX());
272 E().SetY(p.GetE() * p.GetY());
273 E().SetZ(p.GetE() * p.GetZ());
274 E().SetE(p.GetE() * p.GetE());
279 for(
int i = 0; i < 4; i++)
280 _v[i] += other.
_v[i];
285 for(
int i = 0; i < 4; i++)
286 _v[i] -= other.
_v[i];
305 return vec.GetE() * E() - vec.GetX() * X() - vec.GetY() * Y() - vec.GetZ() * Z();
314 R.
X() = this->Contract(M.
X());
315 R.
Y() = this->Contract(M.
Y());
316 R.
Z() = this->Contract(M.
Z());
317 R.
E() = this->Contract(M.
E());
334 return tt - xx - yy - zz;
342 for(
int i = 0; i < 4; i++)
394 *
this = tt - (1. / 3.) * t.Mag2() * (gmunu - uu);
399 for(
int i = 0; i < 4; i++)
406 __device__
fptype LeviCivita(
const gpuLVec &p1,
const gpuLVec &p2,
const gpuLVec &p3,
const gpuLVec &p4) {
408 return p1.GetZ() * p2.GetY() * p3.GetX() * p4.GetE() - p1.GetY() * p2.GetZ() * p3.GetX() * p4.GetE()
409 - p1.GetZ() * p2.GetX() * p3.GetY() * p4.GetE() + p1.GetX() * p2.GetZ() * p3.GetY() * p4.GetE()
410 + p1.GetY() * p2.GetX() * p3.GetZ() * p4.GetE() - p1.GetX() * p2.GetY() * p3.GetZ() * p4.GetE()
411 - p1.GetZ() * p2.GetY() * p3.GetE() * p4.GetX() + p1.GetY() * p2.GetZ() * p3.GetE() * p4.GetX()
412 + p1.GetZ() * p2.GetE() * p3.GetY() * p4.GetX() - p1.GetE() * p2.GetZ() * p3.GetY() * p4.GetX()
413 - p1.GetY() * p2.GetE() * p3.GetZ() * p4.GetX() + p1.GetE() * p2.GetY() * p3.GetZ() * p4.GetX()
414 + p1.GetZ() * p2.GetX() * p3.GetE() * p4.GetY() - p1.GetX() * p2.GetZ() * p3.GetE() * p4.GetY()
415 - p1.GetZ() * p2.GetE() * p3.GetX() * p4.GetY() + p1.GetE() * p2.GetZ() * p3.GetX() * p4.GetY()
416 + p1.GetX() * p2.GetE() * p3.GetZ() * p4.GetY() - p1.GetE() * p2.GetX() * p3.GetZ() * p4.GetY()
417 - p1.GetY() * p2.GetX() * p3.GetE() * p4.GetZ() + p1.GetX() * p2.GetY() * p3.GetE() * p4.GetZ()
418 + p1.GetY() * p2.GetE() * p3.GetX() * p4.GetZ() - p1.GetE() * p2.GetY() * p3.GetX() * p4.GetZ()
419 - p1.GetX() * p2.GetE() * p3.GetY() * p4.GetZ() + p1.GetE() * p2.GetX() * p3.GetY() * p4.GetZ();
422 __device__
inline gpuLVec
LeviCivita(
const gpuLVec &a,
const gpuLVec &b,
const gpuLVec &c) {
425 v.SetE(-1. * a.GetX() * (b.GetY() * c.GetZ() - b.GetZ() * c.GetY())
426 - a.GetY() * (b.GetZ() * c.GetX() - b.GetX() * c.GetZ())
427 - a.GetZ() * (b.GetX() * c.GetY() - b.GetY() * c.GetX()));
429 v.SetZ(a.GetX() * (b.GetE() * c.GetY() - b.GetY() * c.GetE())
430 + a.GetY() * (b.GetX() * c.GetE() - b.GetE() * c.GetX())
431 + a.GetE() * (b.GetY() * c.GetX() - b.GetX() * c.GetY()));
433 v.SetY(a.GetX() * (b.GetZ() * c.GetE() - b.GetE() * c.GetZ())
434 + a.GetZ() * (b.GetE() * c.GetX() - b.GetX() * c.GetE())
435 + a.GetE() * (b.GetX() * c.GetZ() - b.GetZ() * c.GetX()));
437 v.SetX(a.GetY() * (b.GetE() * c.GetZ() - b.GetZ() * c.GetE())
438 + a.GetZ() * (b.GetY() * c.GetE() - b.GetE() * c.GetY())
439 + a.GetE() * (b.GetZ() * c.GetY() - b.GetY() * c.GetZ()));
__device__ LorentzMatrix & operator=(const LorentzMatrix &other)
__device__ SymmLorentzMatrix & mult(fptype s)
__device__ SymmLorentzMatrix & subtract(const SymmLorentzMatrix &other)
__device__ SymmLorentzMatrix & add(const SymmLorentzMatrix &other)
__device__ SpinSumT(const gpuLVec &p, fptype mR)
__device__ fptype Contract(const gpuLVec &rhs) const
__device__ LorentzMatrix operator+(const LorentzMatrix &rhs) const
__device__ gpuLVec Dot(const gpuLVec &rhs) const
__device__ SpinSumV(const gpuLVec &p, fptype mR)
__device__ SymmLorentzMatrix & operator*=(fptype rhs)
__device__ fptype Sandwich(const gpuLVec &lhs, const gpuLVec &rhs) const
__device__ SymmLorentzMatrix operator+(const SymmLorentzMatrix &rhs) const
__device__ const gpuLVec & Y() const
__device__ LorentzMatrix(const gpuLVec p[4])
__device__ gpuLVec Contract(const gpuLVec &vec)
__device__ LorentzMatrix & add(const LorentzMatrix &other)
__device__ LorentzMatrix & operator/=(fptype rhs)
__device__ const gpuLVec & E() const
__device__ SymmLorentzMatrix & div(fptype s)
__device__ SymmLorentzMatrix operator-(const SymmLorentzMatrix &rhs) const
__device__ fptype LeviCivita(const gpuLVec &p1, const gpuLVec &p2, const gpuLVec &p3, const gpuLVec &p4)
__device__ const gpuLVec & X() const
__device__ SymmLorentzMatrix operator/(fptype rhs) const
__device__ const gpuLVec & operator[](int i) const
__device__ SymmLorentzMatrix operator/(fptype lhs, const SymmLorentzMatrix &rhs)
__device__ SymmLorentzMatrix & operator/=(fptype rhs)
__device__ SymmLorentzMatrix operator*(fptype rhs) const
__device__ LorentzMatrix operator-(const LorentzMatrix &rhs) const
__device__ bool makeZero()
__device__ SymmLorentzMatrix(const gpuLVec p)
__device__ gpuLVec operator*(gpuLVec lhs, fptype rhs)
__device__ fptype Contract_2(const SymmLorentzMatrix &M)
__device__ LorentzMatrix & operator-=(const LorentzMatrix &rhs)
__device__ LorentzMatrix & mult(fptype s)
__device__ LorentzMatrix & subtract(const LorentzMatrix &other)
__device__ gpuLVec operator-(gpuLVec lhs, const gpuLVec &rhs)
__device__ bool makeZero()
__device__ gpuLVec operator+(gpuLVec lhs, const gpuLVec &rhs)
__device__ SymmLorentzMatrix & operator-=(const SymmLorentzMatrix &rhs)
__device__ LorentzMatrix operator/(fptype rhs) const
__device__ LorentzMatrix & operator*=(fptype rhs)
__device__ LorentzMatrix Contract_1(const SymmLorentzMatrix &M)
__device__ const gpuLVec & v(int i) const
__device__ LorentzMatrix & operator+=(const LorentzMatrix &rhs)
__device__ fptype Sandwich(const gpuLVec &lm, const gpuLVec &ln, const gpuLVec &ra, const gpuLVec &rb)
__device__ SymmLorentzMatrix & operator=(const SymmLorentzMatrix &other)
__device__ bool symmetrize()
__device__ ZTspin2(const gpuLVec &q, const gpuLVec &p, fptype mR)
__device__ LorentzMatrix & div(fptype s)
__device__ ZTspin2 & operator=(const SymmLorentzMatrix &other)
__device__ gpuLVec & operator[](int i)
__device__ void makeGmunu()
__device__ SymmLorentzMatrix & operator+=(const SymmLorentzMatrix &rhs)
class __align__(16) gpuLVec
__device__ SymmLorentzMatrix()
__device__ SymmLorentzMatrix(const gpuLVec p[4])
__device__ LorentzMatrix(const LorentzMatrix &other)
__device__ ZTspin1(const gpuLVec &q, const gpuLVec &p, fptype mR)
__device__ LorentzMatrix operator*(fptype rhs) const
__device__ const gpuLVec & Z() const