@@ -24,7 +24,7 @@ function _differential_cross_section(
24
24
in_phase_space:: AbstractVector{NumericType} ,
25
25
out_phase_space:: AbstractVector{NumericType} ,
26
26
):: Float64 where {NumericType<: QEDbase.AbstractFourMomentum }
27
- if (! isapprox (sum (in_phase_space), sum (out_phase_space); rtol = sqrt (eps ())))
27
+ if (! isapprox (sum (in_phase_space), sum (out_phase_space); rtol= sqrt (eps ())))
28
28
return zero (Float64)
29
29
end
30
30
@@ -33,46 +33,14 @@ function _differential_cross_section(
33
33
photon_out = out_phase_space[1 ]
34
34
electron_out = out_phase_space[2 ]
35
35
36
- # get base states of the particles
37
- photon_in_bstate = base_state (
38
- Photon (),
39
- Incoming (),
36
+ matrix_elements_sq = _matrix_el_sq (
37
+ process,
38
+ model,
40
39
photon_in,
41
- _spin_or_pol (process, Photon (), Incoming ()),
42
- )
43
- electron_in_bstate = base_state (
44
- Electron (),
45
- Incoming (),
46
40
electron_in,
47
- _spin_or_pol (process, Electron (), Incoming ()),
48
- )
49
- photon_out_bstate = base_state (
50
- Photon (),
51
- Outgoing (),
52
41
photon_out,
53
- _spin_or_pol (process, Photon (), Outgoing ()),
54
- )
55
- electron_out_bstate = base_state (
56
- Electron (),
57
- Outgoing (),
58
42
electron_out,
59
- _spin_or_pol (process, Electron (), Outgoing ()),
60
- )
61
-
62
- # 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
63
- base_states_comb = Iterators. product (
64
- photon_in_bstate,
65
- electron_in_bstate,
66
- photon_out_bstate,
67
- electron_out_bstate,
68
43
)
69
- matrix_elements = Vector {ComplexF64} ()
70
- sizehint! (matrix_elements, length (base_states_comb))
71
- for (phin, ein, phout, eout) in base_states_comb
72
- push! (matrix_elements, _perturbative_compton_matrix (phin, ein, phout, eout))
73
- end
74
-
75
- matrix_elements_sq = abs2 .(matrix_elements)
76
44
77
45
# average over incoming polarizations/spins, but sum over outgoing pols/spins
78
46
normalization = 1.0 / (length (photon_in_bstate) * length (electron_in_bstate))
@@ -85,13 +53,32 @@ function _differential_cross_section(
85
53
end
86
54
87
55
function _perturbative_compton_matrix (
56
+ ph_in:: NumericType ,
57
+ el_in:: NumericType ,
58
+ ph_out:: NumericType ,
59
+ el_out:: NumericType ,
88
60
ph_in_bstate:: SLorentzVector{ComplexF64} ,
89
61
el_in_bstate:: BiSpinor ,
90
62
ph_out_bstate:: SLorentzVector{ComplexF64} ,
91
63
el_out_bstate:: AdjointBiSpinor ,
92
- )
93
- # TODO
94
- return zero (ComplexF64)
64
+ ) where {NumericType<: QEDbase.AbstractFourMomentum }
65
+ ph_in_slashed = slashed (ph_in_bstate)
66
+ ph_out_slashed = slashed (ph_out_bstate)
67
+
68
+ # TODO : fermion propagator is not yet in QEDbase
69
+ diagram_1 = ph_out_slashed * _fermion_propagator (ph_in + el_in, mass (Electron ())) * ph_in_slashed
70
+ diagram_2 = ph_in_slashed * _fermion_propagator (el_in - ph_out, mass (Electron ())) * ph_out_slashed
71
+
72
+ result = diagram_1 + diagram_2
73
+ result = result * el_in_bstate
74
+ result = el_out_bstate * result
75
+
76
+ # TODO : find (preferably unitful) global provider for physical constants
77
+ # elementary charge
78
+ alpha = 1 / 137.035999084
79
+ e = sqrt (4 * pi * alpha)
80
+
81
+ return - e * e * result
95
82
end
96
83
97
84
function _phase_space_factor (
@@ -114,3 +101,83 @@ function _post_process_dcs(
114
101
# generally nothing to be done here
115
102
return result
116
103
end
104
+
105
+ function _matrix_el (
106
+ process:: Compton{InPol,InSpin,OutPol,OutSpin} ,
107
+ model:: PerturbativeQED ,
108
+ photon_in:: NumericType ,
109
+ electron_in:: NumericType ,
110
+ photon_out:: NumericType ,
111
+ electron_out:: NumericType ,
112
+ ) where {
113
+ InPol<: AbstractPolarization ,
114
+ InSpin<: AbstractSpin ,
115
+ OutPol<: AbstractPolarization ,
116
+ OutSpin<: AbstractSpin ,
117
+ NumericType<: QEDbase.AbstractFourMomentum
118
+ }
119
+ # get base states of the particles
120
+ photon_in_bstate = Vector {SLorentzVector{ComplexF64}} (base_state (
121
+ Photon (),
122
+ Incoming (),
123
+ photon_in,
124
+ _spin_or_pol (process, Photon (), Incoming ()),
125
+ ))
126
+ electron_in_bstate = Vector {BiSpinor} (base_state (
127
+ Electron (),
128
+ Incoming (),
129
+ electron_in,
130
+ _spin_or_pol (process, Electron (), Incoming ()),
131
+ ))
132
+ photon_out_bstate = Vector {SLorentzVector{ComplexF64}} (base_state (
133
+ Photon (),
134
+ Outgoing (),
135
+ photon_out,
136
+ _spin_or_pol (process, Photon (), Outgoing ()),
137
+ ))
138
+ electron_out_bstate = Vector {AdjointBiSpinor} (base_state (
139
+ Electron (),
140
+ Outgoing (),
141
+ electron_out,
142
+ _spin_or_pol (process, Electron (), Outgoing ()),
143
+ ))
144
+
145
+ # 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
146
+ base_states_comb =
147
+ Iterators. product (photon_in_bstate, electron_in_bstate, photon_out_bstate, electron_out_bstate)
148
+ matrix_elements = Vector {ComplexF64} ()
149
+ sizehint! (matrix_elements, length (base_states_comb))
150
+ for (ph_in, el_in, ph_out, el_out) in base_states_comb
151
+ push! (matrix_elements, _perturbative_compton_matrix (photon_in, electron_in, photon_out, electron_out, ph_in, el_in, ph_out, el_out))
152
+ end
153
+
154
+ return matrix_elements
155
+ end
156
+
157
+ function _matrix_el_sq (
158
+ process:: Compton{InPol,InSpin,OutPol,OutSpin} ,
159
+ model:: PerturbativeQED ,
160
+ photon_in:: NumericType ,
161
+ electron_in:: NumericType ,
162
+ photon_out:: NumericType ,
163
+ electron_out:: NumericType ,
164
+ ) where {
165
+ NumericType<: QEDbase.AbstractFourMomentum ,
166
+ InPol<: AbstractPolarization ,
167
+ InSpin<: AbstractSpin ,
168
+ OutPol<: AbstractPolarization ,
169
+ OutSpin<: AbstractSpin ,
170
+ }
171
+ return abs2 .(
172
+ _matrix_el (process, model, photon_in, electron_in, photon_out, electron_out)
173
+ )
174
+ end
175
+
176
+ # TODO : should be implemented in QEDbase instead
177
+ function _fermion_propagator (mom:: QEDbase.AbstractFourMomentum , mass:: Float64 )
178
+ slashed_mom = slashed (mom)
179
+
180
+ i = ComplexF64 (0.0 , 1.0 )
181
+ # might not be correct, but this is just a mock implementation to have something to test until its available from QEDbase
182
+ return (i * (slashed_mom + mass * one (DiracMatrix))) / (mom * mom - mass * mass)
183
+ end
0 commit comments