@@ -9,127 +9,127 @@ RTOL = sqrt(eps())
9
9
include (" utils/utils.jl" )
10
10
11
11
@testset " ($N_INCOMING ,$N_OUTGOING )" for (N_INCOMING, N_OUTGOING) in Iterators. product (
12
- (1 , rand (RNG, 2 : 8 )), (1 , rand (RNG, 2 : 8 ))
12
+ (1 , rand (RNG, 2 : 8 )), (1 , rand (RNG, 2 : 8 ))
13
13
)
14
14
INCOMING_PARTICLES = rand (RNG, PARTICLE_SET, N_INCOMING)
15
15
OUTGOING_PARTICLES = rand (RNG, PARTICLE_SET, N_OUTGOING)
16
16
17
17
QEDprocesses. incoming_particles (:: TestProcess ) = INCOMING_PARTICLES
18
18
QEDprocesses. outgoing_particles (:: TestProcess ) = OUTGOING_PARTICLES
19
19
20
- # single ps points
21
- p_in_phys= _rand_momenta (RNG, N_INCOMING)
22
- p_in_phys_invalid = _rand_momenta (RNG, N_INCOMING+ 1 )
23
- p_in_unphys = _rand_momenta_failed (RNG,N_INCOMING)
24
- p_in_unphys_invalid = _rand_momenta_failed (RNG,N_INCOMING+ 1 )
25
- p_out_phys= _rand_momenta (RNG, N_OUTGOING)
26
- p_out_phys_invaid = _rand_momenta (RNG, N_OUTGOING+ 1 )
27
-
28
- # sets of ps points
29
- p_in_set_phys= _rand_momenta (RNG, N_INCOMING, 2 )
30
- p_in_set_unphys_mix = _rand_momenta_failed_mix (RNG,N_INCOMING,2 )
31
- p_in_set_unphys_all = _rand_momenta_failed_all (RNG,N_INCOMING,2 )
32
- p_in_set_phys_invalid = _rand_momenta (RNG, N_INCOMING+ 1 , 2 )
33
- p_in_set_unphys_mix_invalid = _rand_momenta_failed_mix (RNG,N_INCOMING+ 1 ,2 )
34
- p_in_set_unphys_all_invalid = _rand_momenta_failed_all (RNG,N_INCOMING+ 1 ,2 )
35
- p_out_set_phys = _rand_momenta (RNG, N_OUTGOING, 2 )
36
- p_out_set_phys_invalid = _rand_momenta (RNG, N_OUTGOING+ 1 , 2 )
37
-
38
- p_in_all = (p_in_phys, p_in_unphys,
39
- p_in_phys_invalid,p_in_unphys_invalid,
40
- p_in_set_phys, p_in_set_unphys_mix, p_in_set_unphys_all,
41
- p_in_set_phys_invalid, p_in_set_unphys_mix_invalid, p_in_set_unphys_all_invalid)
42
-
43
- p_out_all = (p_out_phys,
44
- p_out_phys_invaid,
45
- p_out_set_phys,
46
- p_out_set_phys_invalid)
47
- # all combinations
48
- p_combs = Iterators. product (p_in_all,p_out_all)
49
-
50
- p_in_all_valid = (p_in_phys, p_in_unphys,
51
- p_in_set_phys, p_in_set_unphys_mix, p_in_set_unphys_all)
52
-
53
- p_out_all_valid = (p_out_phys, p_out_set_phys)
54
-
55
- # all valid combinations
56
- p_combs_valid = collect (Iterators. product (p_in_all_valid,p_out_all_valid))
57
-
58
- p_in_all_phys = (p_in_phys,p_in_set_phys)
59
- p_out_all_phys = (p_out_phys,p_out_set_phys)
60
-
61
- p_combs_phys = Iterators. product (p_in_all_phys, p_out_all_phys)
62
-
20
+ # single ps points
21
+ p_in_phys = _rand_momenta (RNG, N_INCOMING)
22
+ p_in_phys_invalid = _rand_momenta (RNG, N_INCOMING + 1 )
23
+ p_in_unphys = _rand_momenta_failed (RNG, N_INCOMING)
24
+ p_in_unphys_invalid = _rand_momenta_failed (RNG, N_INCOMING + 1 )
25
+ p_out_phys = _rand_momenta (RNG, N_OUTGOING)
26
+ p_out_phys_invaid = _rand_momenta (RNG, N_OUTGOING + 1 )
27
+
28
+ # sets of ps points
29
+ p_in_set_phys = _rand_momenta (RNG, N_INCOMING, 2 )
30
+ p_in_set_unphys_mix = _rand_momenta_failed_mix (RNG, N_INCOMING, 2 )
31
+ p_in_set_unphys_all = _rand_momenta_failed_all (RNG, N_INCOMING, 2 )
32
+ p_in_set_phys_invalid = _rand_momenta (RNG, N_INCOMING + 1 , 2 )
33
+ p_in_set_unphys_mix_invalid = _rand_momenta_failed_mix (RNG, N_INCOMING + 1 , 2 )
34
+ p_in_set_unphys_all_invalid = _rand_momenta_failed_all (RNG, N_INCOMING + 1 , 2 )
35
+ p_out_set_phys = _rand_momenta (RNG, N_OUTGOING, 2 )
36
+ p_out_set_phys_invalid = _rand_momenta (RNG, N_OUTGOING + 1 , 2 )
37
+
38
+ p_in_all = (
39
+ p_in_phys,
40
+ p_in_unphys,
41
+ p_in_phys_invalid,
42
+ p_in_unphys_invalid,
43
+ p_in_set_phys,
44
+ p_in_set_unphys_mix,
45
+ p_in_set_unphys_all,
46
+ p_in_set_phys_invalid,
47
+ p_in_set_unphys_mix_invalid,
48
+ p_in_set_unphys_all_invalid,
49
+ )
50
+
51
+ p_out_all = (p_out_phys, p_out_phys_invaid, p_out_set_phys, p_out_set_phys_invalid)
52
+ # all combinations
53
+ p_combs = Iterators. product (p_in_all, p_out_all)
54
+
55
+ p_in_all_valid = (
56
+ p_in_phys, p_in_unphys, p_in_set_phys, p_in_set_unphys_mix, p_in_set_unphys_all
57
+ )
58
+
59
+ p_out_all_valid = (p_out_phys, p_out_set_phys)
60
+
61
+ # all valid combinations
62
+ p_combs_valid = collect (Iterators. product (p_in_all_valid, p_out_all_valid))
63
+
64
+ p_in_all_phys = (p_in_phys, p_in_set_phys)
65
+ p_out_all_phys = (p_out_phys, p_out_set_phys)
66
+
67
+ p_combs_phys = Iterators. product (p_in_all_phys, p_out_all_phys)
68
+
63
69
@testset " cross section" begin
64
70
@testset " unsafe" begin
65
71
@testset " compute" begin
66
- for (P_IN,P_OUT) in p_combs_phys
72
+ for (P_IN, P_OUT) in p_combs_phys
67
73
diffCS = unsafe_differential_cross_section (
68
74
TestProcess (),
69
75
TestModel (),
70
76
TestPhasespaceDef (),
71
77
P_IN,
72
78
TestPhasespaceDef (),
73
- P_OUT
79
+ P_OUT,
74
80
)
75
81
groundtruth = _groundtruth_unsafe_diffCS (TestProcess (), P_IN, P_OUT)
76
82
@test isapprox (diffCS, groundtruth, atol= ATOL, rtol= RTOL)
77
83
end
78
84
end
79
85
80
86
@testset " invalid input" begin
81
- for (P_IN,P_OUT) in p_combs
87
+ for (P_IN, P_OUT) in p_combs
82
88
83
89
# filter out all valid combinations
84
- if ! ((P_IN,P_OUT) in p_combs_valid)
90
+ if ! ((P_IN, P_OUT) in p_combs_valid)
85
91
@test_throws DimensionMismatch unsafe_differential_cross_section (
86
92
TestProcess (),
87
93
TestModel (),
88
94
TestPhasespaceDef (),
89
95
P_IN,
90
96
TestPhasespaceDef (),
91
- P_OUT
97
+ P_OUT,
92
98
)
93
-
94
99
end
95
-
96
100
end
97
101
end
98
102
end
99
103
@testset " safe" begin
100
104
@testset " compute" begin
101
-
102
- for (P_IN,P_OUT) in p_combs_valid
105
+ for (P_IN, P_OUT) in p_combs_valid
103
106
diffCS = differential_cross_section (
104
107
TestProcess (),
105
108
TestModel (),
106
109
TestPhasespaceDef (),
107
110
P_IN,
108
111
TestPhasespaceDef (),
109
- P_OUT
112
+ P_OUT,
110
113
)
111
114
groundtruth = _groundtruth_safe_diffCS (TestProcess (), P_IN, P_OUT)
112
115
@test isapprox (diffCS, groundtruth, atol= ATOL, rtol= RTOL)
113
116
end
114
117
end
115
118
116
-
117
119
@testset " invalid input" begin
118
- for (P_IN,P_OUT) in p_combs
120
+ for (P_IN, P_OUT) in p_combs
119
121
120
122
# filter out all valid combinations
121
- if ! ((P_IN,P_OUT) in p_combs_valid)
123
+ if ! ((P_IN, P_OUT) in p_combs_valid)
122
124
@test_throws DimensionMismatch differential_cross_section (
123
125
TestProcess (),
124
126
TestModel (),
125
127
TestPhasespaceDef (),
126
128
P_IN,
127
129
TestPhasespaceDef (),
128
- P_OUT
130
+ P_OUT,
129
131
)
130
-
131
132
end
132
-
133
133
end
134
134
end
135
135
end
@@ -165,75 +165,69 @@ include("utils/utils.jl")
165
165
# end
166
166
# end
167
167
end
168
-
168
+
169
169
@testset " probability" begin
170
- @testset " unsafe compute" begin
171
- for (P_IN,P_OUT) in p_combs_phys
172
- prob = unsafe_probability (
170
+ @testset " unsafe compute" begin
171
+ for (P_IN, P_OUT) in p_combs_phys
172
+ prob = unsafe_probability (
173
+ TestProcess (),
174
+ TestModel (),
175
+ TestPhasespaceDef (),
176
+ P_IN,
177
+ TestPhasespaceDef (),
178
+ P_OUT,
179
+ )
180
+ groundtruth = _groundtruth_unsafe_probability (TestProcess (), P_IN, P_OUT)
181
+ @test isapprox (prob, groundtruth, atol= ATOL, rtol= RTOL)
182
+ end
183
+ end
184
+
185
+ @testset " unsafe invalid input" begin
186
+ for (P_IN, P_OUT) in p_combs
187
+
188
+ # filter out all valid combinations
189
+ if ! ((P_IN, P_OUT) in p_combs_valid)
190
+ @test_throws DimensionMismatch unsafe_probability (
173
191
TestProcess (),
174
192
TestModel (),
175
193
TestPhasespaceDef (),
176
194
P_IN,
177
195
TestPhasespaceDef (),
178
- P_OUT
196
+ P_OUT,
179
197
)
180
- groundtruth = _groundtruth_unsafe_probability (TestProcess (), P_IN, P_OUT)
181
- @test isapprox (prob, groundtruth, atol= ATOL, rtol= RTOL)
182
198
end
183
199
end
184
-
185
- @testset " unsafe invalid input" begin
186
- for (P_IN,P_OUT) in p_combs
187
-
188
- # filter out all valid combinations
189
- if ! ((P_IN,P_OUT) in p_combs_valid)
190
- @test_throws DimensionMismatch unsafe_probability (
191
- TestProcess (),
192
- TestModel (),
193
- TestPhasespaceDef (),
194
- P_IN,
195
- TestPhasespaceDef (),
196
- P_OUT
197
- )
198
-
199
- end
200
-
201
- end
200
+ end
201
+ @testset " safe compute" begin
202
+ for (P_IN, P_OUT) in p_combs_valid
203
+ prob = probability (
204
+ TestProcess (),
205
+ TestModel (),
206
+ TestPhasespaceDef (),
207
+ P_IN,
208
+ TestPhasespaceDef (),
209
+ P_OUT,
210
+ )
211
+ groundtruth = _groundtruth_safe_probability (TestProcess (), P_IN, P_OUT)
212
+ @test isapprox (prob, groundtruth, atol= ATOL, rtol= RTOL)
202
213
end
203
- @testset " safe compute" begin
214
+ end
215
+
216
+ @testset " safe invalid input" begin
217
+ for (P_IN, P_OUT) in p_combs
204
218
205
- for (P_IN,P_OUT) in p_combs_valid
206
- prob = probability (
219
+ # filter out all valid combinations
220
+ if ! ((P_IN, P_OUT) in p_combs_valid)
221
+ @test_throws DimensionMismatch probability (
207
222
TestProcess (),
208
223
TestModel (),
209
224
TestPhasespaceDef (),
210
225
P_IN,
211
226
TestPhasespaceDef (),
212
- P_OUT
227
+ P_OUT,
213
228
)
214
- groundtruth = _groundtruth_safe_probability (TestProcess (), P_IN, P_OUT)
215
- @test isapprox (prob, groundtruth, atol= ATOL, rtol= RTOL)
216
- end
217
- end
218
-
219
-
220
- @testset " safe invalid input" begin
221
- for (P_IN,P_OUT) in p_combs
222
-
223
- # filter out all valid combinations
224
- if ! ((P_IN,P_OUT) in p_combs_valid)
225
- @test_throws DimensionMismatch probability (
226
- TestProcess (),
227
- TestModel (),
228
- TestPhasespaceDef (),
229
- P_IN,
230
- TestPhasespaceDef (),
231
- P_OUT
232
- )
233
-
234
- end
235
-
236
229
end
237
230
end
231
+ end
238
232
end
239
233
end
0 commit comments