@@ -33,46 +33,8 @@ 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 (),
40
- photon_in,
41
- _spin_or_pol (process, Photon (), Incoming ()),
42
- )
43
- electron_in_bstate = base_state (
44
- Electron (),
45
- Incoming (),
46
- electron_in,
47
- _spin_or_pol (process, Electron (), Incoming ()),
48
- )
49
- photon_out_bstate = base_state (
50
- Photon (),
51
- Outgoing (),
52
- photon_out,
53
- _spin_or_pol (process, Photon (), Outgoing ()),
54
- )
55
- electron_out_bstate = base_state (
56
- Electron (),
57
- Outgoing (),
58
- 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
- )
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)
36
+ matrix_elements_sq =
37
+ _matrix_el_sq (process, model, photon_in, electron_in, photon_out, electron_out)
76
38
77
39
# average over incoming polarizations/spins, but sum over outgoing pols/spins
78
40
normalization = 1.0 / (length (photon_in_bstate) * length (electron_in_bstate))
@@ -85,13 +47,38 @@ function _differential_cross_section(
85
47
end
86
48
87
49
function _perturbative_compton_matrix (
50
+ ph_in:: NumericType ,
51
+ el_in:: NumericType ,
52
+ ph_out:: NumericType ,
53
+ el_out:: NumericType ,
88
54
ph_in_bstate:: SLorentzVector{ComplexF64} ,
89
55
el_in_bstate:: BiSpinor ,
90
56
ph_out_bstate:: SLorentzVector{ComplexF64} ,
91
57
el_out_bstate:: AdjointBiSpinor ,
92
- )
93
- # TODO
94
- return zero (ComplexF64)
58
+ ) where {NumericType<: QEDbase.AbstractFourMomentum }
59
+ ph_in_slashed = slashed (ph_in_bstate)
60
+ ph_out_slashed = slashed (ph_out_bstate)
61
+
62
+ # TODO : fermion propagator is not yet in QEDbase
63
+ diagram_1 =
64
+ ph_out_slashed *
65
+ _fermion_propagator (ph_in + el_in, mass (Electron ())) *
66
+ ph_in_slashed
67
+ diagram_2 =
68
+ ph_in_slashed *
69
+ _fermion_propagator (el_in - ph_out, mass (Electron ())) *
70
+ 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,107 @@ 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}} (
121
+ base_state (
122
+ Photon (),
123
+ Incoming (),
124
+ photon_in,
125
+ _spin_or_pol (process, Photon (), Incoming ()),
126
+ ),
127
+ )
128
+ electron_in_bstate = Vector {BiSpinor} (
129
+ base_state (
130
+ Electron (),
131
+ Incoming (),
132
+ electron_in,
133
+ _spin_or_pol (process, Electron (), Incoming ()),
134
+ ),
135
+ )
136
+ photon_out_bstate = Vector {SLorentzVector{ComplexF64}} (
137
+ base_state (
138
+ Photon (),
139
+ Outgoing (),
140
+ photon_out,
141
+ _spin_or_pol (process, Photon (), Outgoing ()),
142
+ ),
143
+ )
144
+ electron_out_bstate = Vector {AdjointBiSpinor} (
145
+ base_state (
146
+ Electron (),
147
+ Outgoing (),
148
+ electron_out,
149
+ _spin_or_pol (process, Electron (), Outgoing ()),
150
+ ),
151
+ )
152
+
153
+ # 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
154
+ base_states_comb = Iterators. product (
155
+ photon_in_bstate,
156
+ electron_in_bstate,
157
+ photon_out_bstate,
158
+ electron_out_bstate,
159
+ )
160
+ matrix_elements = Vector {ComplexF64} ()
161
+ sizehint! (matrix_elements, length (base_states_comb))
162
+ for (ph_in, el_in, ph_out, el_out) in base_states_comb
163
+ push! (
164
+ matrix_elements,
165
+ _perturbative_compton_matrix (
166
+ photon_in,
167
+ electron_in,
168
+ photon_out,
169
+ electron_out,
170
+ ph_in,
171
+ el_in,
172
+ ph_out,
173
+ el_out,
174
+ ),
175
+ )
176
+ end
177
+
178
+ return matrix_elements
179
+ end
180
+
181
+ function _matrix_el_sq (
182
+ process:: Compton{InPol,InSpin,OutPol,OutSpin} ,
183
+ model:: PerturbativeQED ,
184
+ photon_in:: NumericType ,
185
+ electron_in:: NumericType ,
186
+ photon_out:: NumericType ,
187
+ electron_out:: NumericType ,
188
+ ) where {
189
+ NumericType<: QEDbase.AbstractFourMomentum ,
190
+ InPol<: AbstractPolarization ,
191
+ InSpin<: AbstractSpin ,
192
+ OutPol<: AbstractPolarization ,
193
+ OutSpin<: AbstractSpin ,
194
+ }
195
+ return abs2 .(
196
+ _matrix_el (process, model, photon_in, electron_in, photon_out, electron_out)
197
+ )
198
+ end
199
+
200
+ # TODO : should be implemented in QEDbase instead
201
+ function _fermion_propagator (mom:: QEDbase.AbstractFourMomentum , mass:: Float64 )
202
+ slashed_mom = slashed (mom)
203
+
204
+ i = ComplexF64 (0.0 , 1.0 )
205
+ # might not be correct, but this is just a mock implementation to have something to test until its available from QEDbase
206
+ return (i * (slashed_mom + mass * one (DiracMatrix))) / (mom * mom - mass * mass)
207
+ end
0 commit comments