@@ -16,7 +16,7 @@ function _differential_cross_section(
16
16
in_phase_space:: AbstractVector{NumericType} ,
17
17
out_phase_space:: AbstractVector{NumericType} ,
18
18
):: Float64 where {NumericType<: QEDbase.AbstractFourMomentum }
19
- if (! isapprox (sum (in_phase_space), sum (out_phase_space); rtol= sqrt (eps ())))
19
+ if (! isapprox (sum (in_phase_space), sum (out_phase_space); rtol = sqrt (eps ())))
20
20
return zero (Float64)
21
21
end
22
22
@@ -26,13 +26,38 @@ function _differential_cross_section(
26
26
electron_out = out_phase_space[2 ]
27
27
28
28
# get base states of the particles
29
- photon_in_bstate = base_state (Photon (), Incoming (), photon_in, _spin_or_pol (process, Photon (), Incoming ()))
30
- electron_in_bstate = base_state (Electron (), Incoming (), electron_in, _spin_or_pol (process, Electron (), Incoming ()))
31
- photon_out_bstate = base_state (Photon (), Outgoing (), photon_out, _spin_or_pol (process, Photon (), Outgoing ()))
32
- electron_out_bstate = base_state (Electron (), Outgoing (), electron_out, _spin_or_pol (process, Electron (), Outgoing ()))
29
+ photon_in_bstate = base_state (
30
+ Photon (),
31
+ Incoming (),
32
+ photon_in,
33
+ _spin_or_pol (process, Photon (), Incoming ()),
34
+ )
35
+ electron_in_bstate = base_state (
36
+ Electron (),
37
+ Incoming (),
38
+ electron_in,
39
+ _spin_or_pol (process, Electron (), Incoming ()),
40
+ )
41
+ photon_out_bstate = base_state (
42
+ Photon (),
43
+ Outgoing (),
44
+ photon_out,
45
+ _spin_or_pol (process, Photon (), Outgoing ()),
46
+ )
47
+ electron_out_bstate = base_state (
48
+ Electron (),
49
+ Outgoing (),
50
+ electron_out,
51
+ _spin_or_pol (process, Electron (), Outgoing ()),
52
+ )
33
53
34
54
# 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
35
- base_states_comb = Iterators. product (photon_in_bstate, electron_in_bstate, photon_out_bstate, electron_out_bstate)
55
+ base_states_comb = Iterators. product (
56
+ photon_in_bstate,
57
+ electron_in_bstate,
58
+ photon_out_bstate,
59
+ electron_out_bstate,
60
+ )
36
61
matrix_elements = Vector {ComplexF64} ()
37
62
sizehint! (matrix_elements, length (base_states_comb))
38
63
for (phin, ein, phout, eout) in base_states_comb
@@ -45,15 +70,28 @@ function _differential_cross_section(
45
70
normalization = 1.0 / (length (photon_in_bstate) * length (electron_in_bstate))
46
71
I = photon_in * electron_in
47
72
48
- return I * normalization * sum (matrix_elements_sq) * _phase_space_factor (photon_in, electron_in, photon_out, electron_out)
73
+ return I *
74
+ normalization *
75
+ sum (matrix_elements_sq) *
76
+ _phase_space_factor (photon_in, electron_in, photon_out, electron_out)
49
77
end
50
78
51
- function _perturbative_compton_matrix (ph_in_bstate:: SLorentzVector{ComplexF64} , el_in_bstate:: BiSpinor , ph_out_bstate:: SLorentzVector{ComplexF64} , el_out_bstate:: AdjointBiSpinor )
79
+ function _perturbative_compton_matrix (
80
+ ph_in_bstate:: SLorentzVector{ComplexF64} ,
81
+ el_in_bstate:: BiSpinor ,
82
+ ph_out_bstate:: SLorentzVector{ComplexF64} ,
83
+ el_out_bstate:: AdjointBiSpinor ,
84
+ )
52
85
# TODO
53
86
return zero (ComplexF64)
54
87
end
55
88
56
- function _phase_space_factor (ph_in:: NumericType , el_in:: NumericType , ph_out:: NumericType , el_out:: NumericType ) where {NumericType<: QEDbase.AbstractFourMomentum }
89
+ function _phase_space_factor (
90
+ ph_in:: NumericType ,
91
+ el_in:: NumericType ,
92
+ ph_out:: NumericType ,
93
+ el_out:: NumericType ,
94
+ ) where {NumericType<: QEDbase.AbstractFourMomentum }
57
95
# TODO
58
96
return zero (ComplexF64)
59
97
end
0 commit comments