@@ -38,22 +38,19 @@ function _differential_cross_section(
38
38
)
39
39
40
40
# TODO : replace this with some less computationally intensive way to figure out how many states there are
41
- photon_in_bstate = Vector {SLorentzVector{ComplexF64}} (
42
- base_state (
43
- Photon (), Incoming (), photon_in, _spin_or_pol (process, Photon (), Incoming ())
44
- ),
41
+ photon_in_bstate = base_state (
42
+ Photon (), Incoming (), photon_in, _spin_or_pol (process, Photon (), Incoming ())
45
43
)
46
- electron_in_bstate = Vector {BiSpinor} (
47
- base_state (
48
- Electron (),
49
- Incoming (),
50
- electron_in,
51
- _spin_or_pol (process, Electron (), Incoming ()),
52
- ),
44
+ electron_in_bstate = base_state (
45
+ Electron (), Incoming (), electron_in, _spin_or_pol (process, Electron (), Incoming ())
53
46
)
54
47
55
48
# average over incoming polarizations/spins, but sum over outgoing pols/spins
56
- normalization = 1.0 / (length (photon_in_bstate) * length (electron_in_bstate))
49
+ normalization =
50
+ 1.0 / (
51
+ length (QEDbase. _as_svec (photon_in_bstate)) *
52
+ length (QEDbase. _as_svec (electron_in_bstate))
53
+ )
57
54
I = photon_in * electron_in
58
55
59
56
return I *
@@ -67,9 +64,9 @@ function _perturbative_compton_matrix(
67
64
el_in:: NumericType ,
68
65
ph_out:: NumericType ,
69
66
el_out:: NumericType ,
70
- ph_in_bstate:: SLorentzVector{ComplexF64} ,
67
+ ph_in_bstate:: SLorentzVector ,
71
68
el_in_bstate:: BiSpinor ,
72
- ph_out_bstate:: SLorentzVector{ComplexF64} ,
69
+ ph_out_bstate:: SLorentzVector ,
73
70
el_out_bstate:: AdjointBiSpinor ,
74
71
) where {NumericType<: QEDbase.AbstractFourMomentum }
75
72
ph_in_slashed = slashed (ph_in_bstate)
@@ -130,36 +127,25 @@ function _matrix_el(
130
127
NumericType<: QEDbase.AbstractFourMomentum ,
131
128
}
132
129
# get base states of the particles
133
- photon_in_bstate = Vector {SLorentzVector{ComplexF64}} (
134
- base_state (
135
- Photon (), Incoming (), photon_in, _spin_or_pol (process, Photon (), Incoming ())
136
- ),
130
+ photon_in_bstate = base_state (
131
+ Photon (), Incoming (), photon_in, _spin_or_pol (process, Photon (), Incoming ())
137
132
)
138
- electron_in_bstate = Vector {BiSpinor} (
139
- base_state (
140
- Electron (),
141
- Incoming (),
142
- electron_in,
143
- _spin_or_pol (process, Electron (), Incoming ()),
144
- ),
133
+ electron_in_bstate = base_state (
134
+ Electron (), Incoming (), electron_in, _spin_or_pol (process, Electron (), Incoming ())
145
135
)
146
- photon_out_bstate = Vector {SLorentzVector{ComplexF64}} (
147
- base_state (
148
- Photon (), Outgoing (), photon_out, _spin_or_pol (process, Photon (), Outgoing ())
149
- ),
136
+ photon_out_bstate = base_state (
137
+ Photon (), Outgoing (), photon_out, _spin_or_pol (process, Photon (), Outgoing ())
150
138
)
151
- electron_out_bstate = Vector {AdjointBiSpinor} (
152
- base_state (
153
- Electron (),
154
- Outgoing (),
155
- electron_out,
156
- _spin_or_pol (process, Electron (), Outgoing ()),
157
- ),
139
+ electron_out_bstate = base_state (
140
+ Electron (), Outgoing (), electron_out, _spin_or_pol (process, Electron (), Outgoing ())
158
141
)
159
142
160
143
# if the particles had AllSpin or AllPol, the base states can be vectors and we need to consider every combination of the base states with each other
161
144
base_states_comb = Iterators. product (
162
- photon_in_bstate, electron_in_bstate, photon_out_bstate, electron_out_bstate
145
+ QEDbase. _as_svec (photon_in_bstate),
146
+ QEDbase. _as_svec (electron_in_bstate),
147
+ QEDbase. _as_svec (photon_out_bstate),
148
+ QEDbase. _as_svec (electron_out_bstate),
163
149
)
164
150
matrix_elements = Vector {ComplexF64} ()
165
151
sizehint! (matrix_elements, length (base_states_comb))
0 commit comments