thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
Helicity
LorentzRank3Tensor.h
1
// -*- C++ -*-
2
//
3
// LorentzRank3Tensor.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 2003-2019 Peter Richardson, Leif Lonnblad
5
//
6
// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8
//
9
#ifndef ThePEG_LorentzRank3Tensor_H
10
#define ThePEG_LorentzRank3Tensor_H
11
// This is the declaration of the LorentzRank3Tensor class.
12
13
#include "
ThePEG/Config/PhysicalQtyComplex.h
"
14
#include "
ThePEG/Config/ThePEG.h
"
15
#include "LorentzTensor.h"
16
17
namespace
ThePEG
{
18
namespace
Helicity {
19
20
// compiler magic needs these pre-declarations to make friend templates work
21
template
<
typename
Value>
class
LorentzRank3Tensor;
22
36
template
<
typename
Value>
37
class
LorentzRank3Tensor
{
38
39
public
:
40
44
LorentzRank3Tensor
() =
default
;
45
49
complex<Value>
operator ()
(
int
i,
int
j,
int
k)
const
{
50
assert( i>=0 && i<=3 && j>=0 && j<=3 && k>=0 && k<=3);
51
return
_tensor
[i][j][k];
52
}
53
57
complex<Value> &
operator ()
(
int
i,
int
j,
int
k) {
58
assert( i>=0 && i<=3 && j>=0 && j<=3 && k>=0 && k<=3);
59
return
_tensor
[i][j][k];
60
}
62
68
LorentzRank3Tensor
&
boost
(
double
,
double
,
double
);
69
73
LorentzRank3Tensor<Value>
&
boost
(
const
Boost
& b) {
74
return
boost
(b.x(), b.y(), b.z());
75
}
76
80
LorentzRank3Tensor
&
transform
(
const
SpinOneLorentzRotation
& r){
81
unsigned
int
ix,iy,iz,ixa,iya,iza;
82
LorentzRank3Tensor<Value>
output;
83
complex<Value> temp;
84
for
(ix=0;ix<4;++ix) {
85
for
(iy=0;iy<4;++iy) {
86
for
(iz=0;iz<4;++iz) {
87
output(ix,iy,iz) = complex<Value>();
88
for
(ixa=0;ixa<4;++ixa) {
89
for
(iya=0;iya<4;++iya) {
90
for
(iza=0;iza<4;++iza)
91
output(ix,iy,iz) += r(ix,ixa)*r(iy,iya)*r(iz,iza)*(*this)(ixa,iya,iza);
92
}
93
}
94
}
95
}
96
}
97
*
this
=output;
98
return
*
this
;
99
}
100
104
LorentzRank3Tensor<Value>
conjugate
() {
105
LorentzRank3Tensor<Value>
output;
106
for
(
unsigned
int
ix=0;ix<4;++ix) {
107
for
(
unsigned
int
iy=0;iy<4;++iy) {
108
for
(
unsigned
int
iz=0;iz<4;++iz) {
109
output(ix,iy,iz) = conj(
_tensor
[ix][iy][iz]);
110
}
111
}
112
}
113
return
output;
114
}
115
117
123
LorentzRank3Tensor<Value>
operator*=
(
Complex
a) {
124
for
(
int
ix=0;ix<4;++ix)
125
for
(
int
iy=0;iy<4;++iy)
126
for
(
int
iz=0;iz<4;++iz)
_tensor
[ix][iy][iz]*=a;
127
return
*
this
;
128
}
129
133
template
<
typename
T,
typename
U>
134
friend
auto
135
operator*
(
const
LorentzRank3Tensor<T>
& t,
const
LorentzRank3Tensor<U>
&
u
) ->
decltype
(t.xx()*
u
.xx());
136
140
LorentzRank3Tensor<Value>
operator+
(
const
LorentzRank3Tensor<Value>
& in)
const
{
141
LorentzRank3Tensor<Value>
output;
142
for
(
int
ix=0;ix<4;++ix)
143
for
(
int
iy=0;iy<4;++iy)
144
for
(
int
iz=0;iz<4;++iz) output(ix,iy,iz) =
_tensor
[ix][iy][iz] + in(ix,iy,iz);
145
}
146
150
LorentzRank3Tensor<Value>
operator-
(
const
LorentzRank3Tensor<Value>
& in)
const
{
151
LorentzRank3Tensor<Value>
output;
152
for
(
int
ix=0;ix<4;++ix)
153
for
(
int
iy=0;iy<4;++iy)
154
for
(
int
iz=0;iz<4;++iz) output(ix,iy,iz) =
_tensor
[ix][iy][iz] - in(ix,iy,iz);
155
}
156
160
template
<
typename
ValueB>
161
auto
dot
(
const
LorentzVector
<complex<ValueB> > & vec,
unsigned
int
iloc)
const
162
->
LorentzTensor
<
decltype
(ValueB()*Value())> {
163
LorentzTensor
<
decltype
(ValueB()*Value())> output;
164
if
(iloc==0) {
165
for
(
unsigned
int
iy=0;iy<4;++iy) {
166
for
(
unsigned
int
iz=0;iz<4;++iz) {
167
output(iy,iz) =
168
vec.t()*
_tensor
[3][iy][iz] - vec.x()*
_tensor
[0][iy][iz] -
169
vec.y()*
_tensor
[1][iy][iz] - vec.z()*
_tensor
[2][iy][iz];
170
}
171
}
172
}
173
else
if
(iloc==1) {
174
for
(
unsigned
int
iy=0;iy<4;++iy) {
175
for
(
unsigned
int
iz=0;iz<4;++iz) {
176
output(iy,iz) =
177
vec.t()*
_tensor
[iy][3][iz] - vec.x()*
_tensor
[iy][0][iz] -
178
vec.y()*
_tensor
[iy][1][iz] - vec.z()*
_tensor
[iy][2][iz];
179
}
180
}
181
}
182
else
if
(iloc==2) {
183
for
(
unsigned
int
iy=0;iy<4;++iy) {
184
for
(
unsigned
int
iz=0;iz<4;++iz) {
185
output(iy,iz) =
186
vec.t()*
_tensor
[iy][iz][3] - vec.x()*
_tensor
[iy][iz][0] -
187
vec.y()*
_tensor
[iy][iz][1] - vec.z()*
_tensor
[iy][iz][2];
188
}
189
}
190
}
191
else
192
assert(
false
);
193
return
output;
194
}
195
199
auto
dot
(
const
Lorentz5Momentum
& vec,
unsigned
int
iloc)
const
200
->
LorentzTensor
<
decltype
(vec.x()*Value())>
201
{
202
LorentzTensor
<
decltype
(vec.x()*Value())> output;
203
if
(iloc==0) {
204
for
(
unsigned
int
iy=0;iy<4;++iy) {
205
for
(
unsigned
int
iz=0;iz<4;++iz) {
206
output(iy,iz) =
207
vec.t()*
_tensor
[3][iy][iz] - vec.x()*
_tensor
[0][iy][iz] -
208
vec.y()*
_tensor
[1][iy][iz] - vec.z()*
_tensor
[2][iy][iz];
209
}
210
}
211
}
212
else
if
(iloc==1) {
213
for
(
unsigned
int
iy=0;iy<4;++iy) {
214
for
(
unsigned
int
iz=0;iz<4;++iz) {
215
output(iy,iz) =
216
vec.t()*
_tensor
[iy][3][iz] - vec.x()*
_tensor
[iy][0][iz] -
217
vec.y()*
_tensor
[iy][1][iz] - vec.z()*
_tensor
[iy][2][iz];
218
}
219
}
220
}
221
else
if
(iloc==2) {
222
for
(
unsigned
int
iy=0;iy<4;++iy) {
223
for
(
unsigned
int
iz=0;iz<4;++iz) {
224
output(iy,iz) =
225
vec.t()*
_tensor
[iy][iz][3] - vec.x()*
_tensor
[iy][iz][0] -
226
vec.y()*
_tensor
[iy][iz][1] - vec.z()*
_tensor
[iy][iz][2];
227
}
228
}
229
}
230
else
231
assert(
false
);
232
return
output;
233
}
235
236
private
:
237
241
std::array<std::array<std::array<complex<Value>,4>,4>,4>
_tensor
;
242
243
};
244
248
template
<
typename
T,
typename
U>
249
inline
auto
250
operator*(complex<U> a,
const
LorentzRank3Tensor<T>
& t) ->
LorentzRank3Tensor
<
decltype
(a.real()*t.xx().real())> {
251
LorentzRank3Tensor
<
decltype
(a.real()*t.xx().real())> output;
252
for
(
int
ix=0;ix<4;++ix)
253
for
(
int
iy=0;iy<4;++iy)
254
for
(
int
iz=0;iz<4;++iz) output(ix,iy,iz) = a*t(ix,iy,iz);
255
return
output;
256
}
257
261
template
<
typename
T,
typename
U>
262
inline
auto
263
operator*(
const
LorentzRank3Tensor<T>
& t,complex<U> a) ->
LorentzRank3Tensor
<
decltype
(a.real()*t.xx().real())> {
264
LorentzRank3Tensor
<
decltype
(a.real()*t.xx().real())> output;
265
for
(
int
ix=0;ix<4;++ix)
266
for
(
int
iy=0;iy<4;++iy)
267
for
(
int
iz=0;iz<4;++iz) output(ix,iy,iz) = a*t(ix,iy,iz);
268
return
output;
269
}
270
271
}
272
}
273
274
#ifndef ThePEG_TEMPLATES_IN_CC_FILE
275
#include "LorentzRank3Tensor.tcc"
276
#endif
277
278
#endif
PhysicalQtyComplex.h
Overloads for operations on complex physical quantities.
ThePEG.h
This is the main config header file for ThePEG.
ThePEG::Helicity::LorentzRank3Tensor
The LorentzRank3Tensor class is designed to implement the storage of a complex tensor to be used to r...
Definition:
LorentzRank3Tensor.h:37
ThePEG::Helicity::LorentzRank3Tensor::dot
auto dot(const Lorentz5Momentum &vec, unsigned int iloc) const -> LorentzTensor< decltype(vec.x() *Value())>
dot product with momentum
Definition:
LorentzRank3Tensor.h:199
ThePEG::Helicity::LorentzRank3Tensor::operator+
LorentzRank3Tensor< Value > operator+(const LorentzRank3Tensor< Value > &in) const
Addition.
Definition:
LorentzRank3Tensor.h:140
ThePEG::Helicity::LorentzRank3Tensor::LorentzRank3Tensor
LorentzRank3Tensor()=default
Default zero constructor.
ThePEG::Helicity::LorentzRank3Tensor::dot
auto dot(const LorentzVector< complex< ValueB > > &vec, unsigned int iloc) const -> LorentzTensor< decltype(ValueB() *Value())>
Dot product with the ith index.
Definition:
LorentzRank3Tensor.h:161
ThePEG::Helicity::LorentzRank3Tensor::boost
LorentzRank3Tensor & boost(double, double, double)
Standard Lorentz boost specifying the components of the beta vector.
ThePEG::Helicity::LorentzRank3Tensor::operator*
friend auto operator*(const LorentzRank3Tensor< T > &t, const LorentzRank3Tensor< U > &u) -> decltype(t.xx() *u.xx())
Scalar product with other tensor.
ThePEG::Helicity::LorentzRank3Tensor::conjugate
LorentzRank3Tensor< Value > conjugate()
Return the complex conjugate.
Definition:
LorentzRank3Tensor.h:104
ThePEG::Helicity::LorentzRank3Tensor::operator-
LorentzRank3Tensor< Value > operator-(const LorentzRank3Tensor< Value > &in) const
Subtraction.
Definition:
LorentzRank3Tensor.h:150
ThePEG::Helicity::LorentzRank3Tensor::_tensor
std::array< std::array< std::array< complex< Value >, 4 >, 4 >, 4 > _tensor
The components.
Definition:
LorentzRank3Tensor.h:241
ThePEG::Helicity::LorentzRank3Tensor::transform
LorentzRank3Tensor & transform(const SpinOneLorentzRotation &r)
General Lorentz transformation.
Definition:
LorentzRank3Tensor.h:80
ThePEG::Helicity::LorentzRank3Tensor::boost
LorentzRank3Tensor< Value > & boost(const Boost &b)
Standard Lorentz boost specifying the beta vector.
Definition:
LorentzRank3Tensor.h:73
ThePEG::Helicity::LorentzRank3Tensor::operator()
complex< Value > operator()(int i, int j, int k) const
Get components by indices.
Definition:
LorentzRank3Tensor.h:49
ThePEG::Helicity::LorentzRank3Tensor::operator*=
LorentzRank3Tensor< Value > operator*=(Complex a)
Scaling with a complex number.
Definition:
LorentzRank3Tensor.h:123
ThePEG::Helicity::LorentzTensor
The LorentzTensor class is designed to implement the storage of a complex tensor to be used to repres...
Definition:
LorentzTensor.h:37
ThePEG::Lorentz5Vector< Energy >
ThePEG::LorentzVector
A 4-component Lorentz vector.
Definition:
LorentzVector.h:44
ThePEG::SpinOneLorentzRotation
The SpinOneLorentzRotation class is ...
Definition:
SpinOneLorentzRotation.h:25
ThePEG::ThreeVector
A 3-component vector.
Definition:
ThreeVector.h:35
ThePEG::Helicity::SpinorType::u
@ u
u spinor.
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::Complex
std::complex< double > Complex
ThePEG code should use Complex for all complex scalars.
Definition:
Complex.h:23
Generated on Thu Jun 20 2024 14:47:00 for ThePEG by
1.9.6