madspace 0.3.1__cp314-cp314-macosx_14_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. madspace/__init__.py +1 -0
  2. madspace/_madspace_py.cpython-314-darwin.so +0 -0
  3. madspace/_madspace_py.pyi +2189 -0
  4. madspace/_madspace_py_loader.py +111 -0
  5. madspace/include/madspace/constants.h +17 -0
  6. madspace/include/madspace/madcode/function.h +102 -0
  7. madspace/include/madspace/madcode/function_builder_mixin.h +591 -0
  8. madspace/include/madspace/madcode/instruction.h +208 -0
  9. madspace/include/madspace/madcode/opcode_mixin.h +134 -0
  10. madspace/include/madspace/madcode/optimizer.h +31 -0
  11. madspace/include/madspace/madcode/type.h +203 -0
  12. madspace/include/madspace/madcode.h +6 -0
  13. madspace/include/madspace/phasespace/base.h +74 -0
  14. madspace/include/madspace/phasespace/channel_weight_network.h +46 -0
  15. madspace/include/madspace/phasespace/channel_weights.h +51 -0
  16. madspace/include/madspace/phasespace/chili.h +32 -0
  17. madspace/include/madspace/phasespace/cross_section.h +47 -0
  18. madspace/include/madspace/phasespace/cuts.h +34 -0
  19. madspace/include/madspace/phasespace/discrete_flow.h +44 -0
  20. madspace/include/madspace/phasespace/discrete_sampler.h +53 -0
  21. madspace/include/madspace/phasespace/flow.h +53 -0
  22. madspace/include/madspace/phasespace/histograms.h +26 -0
  23. madspace/include/madspace/phasespace/integrand.h +204 -0
  24. madspace/include/madspace/phasespace/invariants.h +26 -0
  25. madspace/include/madspace/phasespace/luminosity.h +41 -0
  26. madspace/include/madspace/phasespace/matrix_element.h +70 -0
  27. madspace/include/madspace/phasespace/mlp.h +37 -0
  28. madspace/include/madspace/phasespace/multichannel.h +49 -0
  29. madspace/include/madspace/phasespace/observable.h +85 -0
  30. madspace/include/madspace/phasespace/pdf.h +78 -0
  31. madspace/include/madspace/phasespace/phasespace.h +67 -0
  32. madspace/include/madspace/phasespace/rambo.h +26 -0
  33. madspace/include/madspace/phasespace/scale.h +52 -0
  34. madspace/include/madspace/phasespace/t_propagator_mapping.h +34 -0
  35. madspace/include/madspace/phasespace/three_particle.h +68 -0
  36. madspace/include/madspace/phasespace/topology.h +116 -0
  37. madspace/include/madspace/phasespace/two_particle.h +63 -0
  38. madspace/include/madspace/phasespace/vegas.h +53 -0
  39. madspace/include/madspace/phasespace.h +27 -0
  40. madspace/include/madspace/runtime/context.h +147 -0
  41. madspace/include/madspace/runtime/discrete_optimizer.h +24 -0
  42. madspace/include/madspace/runtime/event_generator.h +257 -0
  43. madspace/include/madspace/runtime/format.h +68 -0
  44. madspace/include/madspace/runtime/io.h +343 -0
  45. madspace/include/madspace/runtime/lhe_output.h +132 -0
  46. madspace/include/madspace/runtime/logger.h +46 -0
  47. madspace/include/madspace/runtime/runtime_base.h +39 -0
  48. madspace/include/madspace/runtime/tensor.h +603 -0
  49. madspace/include/madspace/runtime/thread_pool.h +101 -0
  50. madspace/include/madspace/runtime/vegas_optimizer.h +26 -0
  51. madspace/include/madspace/runtime.h +12 -0
  52. madspace/include/madspace/umami.h +202 -0
  53. madspace/include/madspace/util.h +142 -0
  54. madspace/lib/libmadspace.dylib +0 -0
  55. madspace/lib/libmadspace_cpu.dylib +0 -0
  56. madspace/madnis/__init__.py +44 -0
  57. madspace/madnis/buffer.py +167 -0
  58. madspace/madnis/channel_grouping.py +85 -0
  59. madspace/madnis/distribution.py +103 -0
  60. madspace/madnis/integrand.py +175 -0
  61. madspace/madnis/integrator.py +973 -0
  62. madspace/madnis/interface.py +191 -0
  63. madspace/madnis/losses.py +186 -0
  64. madspace/torch.py +82 -0
  65. madspace-0.3.1.dist-info/METADATA +71 -0
  66. madspace-0.3.1.dist-info/RECORD +68 -0
  67. madspace-0.3.1.dist-info/WHEEL +6 -0
  68. madspace-0.3.1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,591 @@
1
+ // This file was automatically generated based on instruction_set.yaml
2
+ // Do not modify its content directly
3
+
4
+ Value stack(ValueVec args) {
5
+ return instruction("stack", args)[0];
6
+ }
7
+
8
+ ValueVec unstack(Value in1) {
9
+ return instruction("unstack", {in1});
10
+ }
11
+
12
+ ValueVec unstack_sizes(Value in1) {
13
+ return instruction("unstack_sizes", {in1});
14
+ }
15
+
16
+ std::array<Value, 2> pop(Value in1) {
17
+ auto output_vector = instruction("pop", {in1});
18
+ return {output_vector[0], output_vector[1]};
19
+ }
20
+
21
+ std::array<Value, 2> batch_cat(ValueVec args) {
22
+ auto output_vector = instruction("batch_cat", args);
23
+ return {output_vector[0], output_vector[1]};
24
+ }
25
+
26
+ ValueVec batch_split(Value in1, Value counts) {
27
+ return instruction("batch_split", {in1, counts});
28
+ }
29
+
30
+ Value cat(ValueVec args) {
31
+ return instruction("cat", args)[0];
32
+ }
33
+
34
+ Value batch_size(ValueVec args) {
35
+ return instruction("batch_size", args)[0];
36
+ }
37
+
38
+ Value offset_indices(Value batch_sizes_offset, Value batch_sizes_out) {
39
+ return instruction("offset_indices", {batch_sizes_offset, batch_sizes_out})[0];
40
+ }
41
+
42
+ Value full(ValueVec args) {
43
+ return instruction("full", args)[0];
44
+ }
45
+
46
+ Value squeeze(Value input) {
47
+ return instruction("squeeze", {input})[0];
48
+ }
49
+
50
+ Value unsqueeze(Value input) {
51
+ return instruction("unsqueeze", {input})[0];
52
+ }
53
+
54
+ Value add(Value in1, Value in2) {
55
+ return instruction("add", {in1, in2})[0];
56
+ }
57
+
58
+ Value add_int(Value in1, Value in2) {
59
+ return instruction("add_int", {in1, in2})[0];
60
+ }
61
+
62
+ Value sub(Value in1, Value in2) {
63
+ return instruction("sub", {in1, in2})[0];
64
+ }
65
+
66
+ Value mul(Value in1, Value in2) {
67
+ return instruction("mul", {in1, in2})[0];
68
+ }
69
+
70
+ Value reduce_sum(Value in1) {
71
+ return instruction("reduce_sum", {in1})[0];
72
+ }
73
+
74
+ Value reduce_sum_vector(Value in1) {
75
+ return instruction("reduce_sum_vector", {in1})[0];
76
+ }
77
+
78
+ Value reduce_product(Value in1) {
79
+ return instruction("reduce_product", {in1})[0];
80
+ }
81
+
82
+ Value sqrt(Value in1) {
83
+ return instruction("sqrt", {in1})[0];
84
+ }
85
+
86
+ Value square(Value in1) {
87
+ return instruction("square", {in1})[0];
88
+ }
89
+
90
+ Value min(Value in1, Value in2) {
91
+ return instruction("min", {in1, in2})[0];
92
+ }
93
+
94
+ Value max(Value in1, Value in2) {
95
+ return instruction("max", {in1, in2})[0];
96
+ }
97
+
98
+ Value obs_sqrt_s(Value p_ext) {
99
+ return instruction("obs_sqrt_s", {p_ext})[0];
100
+ }
101
+
102
+ Value obs_e(Value p) {
103
+ return instruction("obs_e", {p})[0];
104
+ }
105
+
106
+ Value obs_px(Value p) {
107
+ return instruction("obs_px", {p})[0];
108
+ }
109
+
110
+ Value obs_py(Value p) {
111
+ return instruction("obs_py", {p})[0];
112
+ }
113
+
114
+ Value obs_pz(Value p) {
115
+ return instruction("obs_pz", {p})[0];
116
+ }
117
+
118
+ Value obs_mass(Value p) {
119
+ return instruction("obs_mass", {p})[0];
120
+ }
121
+
122
+ Value obs_pt(Value p) {
123
+ return instruction("obs_pt", {p})[0];
124
+ }
125
+
126
+ Value obs_p_mag(Value p) {
127
+ return instruction("obs_p_mag", {p})[0];
128
+ }
129
+
130
+ Value obs_phi(Value p) {
131
+ return instruction("obs_phi", {p})[0];
132
+ }
133
+
134
+ Value obs_theta(Value p) {
135
+ return instruction("obs_theta", {p})[0];
136
+ }
137
+
138
+ Value obs_y(Value p) {
139
+ return instruction("obs_y", {p})[0];
140
+ }
141
+
142
+ Value obs_y_abs(Value p) {
143
+ return instruction("obs_y_abs", {p})[0];
144
+ }
145
+
146
+ Value obs_eta(Value p) {
147
+ return instruction("obs_eta", {p})[0];
148
+ }
149
+
150
+ Value obs_eta_abs(Value p) {
151
+ return instruction("obs_eta_abs", {p})[0];
152
+ }
153
+
154
+ Value obs_delta_eta(Value p1, Value p2) {
155
+ return instruction("obs_delta_eta", {p1, p2})[0];
156
+ }
157
+
158
+ Value obs_delta_phi(Value p1, Value p2) {
159
+ return instruction("obs_delta_phi", {p1, p2})[0];
160
+ }
161
+
162
+ Value obs_delta_r(Value p1, Value p2) {
163
+ return instruction("obs_delta_r", {p1, p2})[0];
164
+ }
165
+
166
+ Value boost_beam(Value p1, Value x1, Value x2) {
167
+ return instruction("boost_beam", {p1, x1, x2})[0];
168
+ }
169
+
170
+ Value boost_beam_inverse(Value p1, Value x1, Value x2) {
171
+ return instruction("boost_beam_inverse", {p1, x1, x2})[0];
172
+ }
173
+
174
+ std::array<Value, 2> com_p_in(Value e_cm) {
175
+ auto output_vector = instruction("com_p_in", {e_cm});
176
+ return {output_vector[0], output_vector[1]};
177
+ }
178
+
179
+ std::array<Value, 3> r_to_x1x2(Value r, Value s_hat, Value s_lab) {
180
+ auto output_vector = instruction("r_to_x1x2", {r, s_hat, s_lab});
181
+ return {output_vector[0], output_vector[1], output_vector[2]};
182
+ }
183
+
184
+ std::array<Value, 2> x1x2_to_r(Value x1, Value x2, Value s_lab) {
185
+ auto output_vector = instruction("x1x2_to_r", {x1, x2, s_lab});
186
+ return {output_vector[0], output_vector[1]};
187
+ }
188
+
189
+ Value diff_cross_section(Value x1, Value x2, Value pdf1, Value pdf2, Value matrix_element, Value e_cm2) {
190
+ return instruction("diff_cross_section", {x1, x2, pdf1, pdf2, matrix_element, e_cm2})[0];
191
+ }
192
+
193
+ std::array<Value, 3> two_body_decay_com(Value r_phi, Value r_cos_theta, Value m0, Value m1, Value m2) {
194
+ auto output_vector = instruction("two_body_decay_com", {r_phi, r_cos_theta, m0, m1, m2});
195
+ return {output_vector[0], output_vector[1], output_vector[2]};
196
+ }
197
+
198
+ std::array<Value, 6> two_body_decay_com_inverse(Value p1, Value p2) {
199
+ auto output_vector = instruction("two_body_decay_com_inverse", {p1, p2});
200
+ return {output_vector[0], output_vector[1], output_vector[2], output_vector[3], output_vector[4], output_vector[5]};
201
+ }
202
+
203
+ std::array<Value, 3> two_body_decay(Value r_phi, Value r_cos_theta, Value m0, Value m1, Value m2, Value p0) {
204
+ auto output_vector = instruction("two_body_decay", {r_phi, r_cos_theta, m0, m1, m2, p0});
205
+ return {output_vector[0], output_vector[1], output_vector[2]};
206
+ }
207
+
208
+ std::array<Value, 7> two_body_decay_inverse(Value p1, Value p2) {
209
+ auto output_vector = instruction("two_body_decay_inverse", {p1, p2});
210
+ return {output_vector[0], output_vector[1], output_vector[2], output_vector[3], output_vector[4], output_vector[5], output_vector[6]};
211
+ }
212
+
213
+ std::array<Value, 3> two_to_two_particle_scattering_com(Value r_phi, Value pa, Value pb, Value t_abs, Value m1, Value m2) {
214
+ auto output_vector = instruction("two_to_two_particle_scattering_com", {r_phi, pa, pb, t_abs, m1, m2});
215
+ return {output_vector[0], output_vector[1], output_vector[2]};
216
+ }
217
+
218
+ std::array<Value, 4> two_to_two_particle_scattering_com_inverse(Value p1, Value p2, Value pa, Value pb) {
219
+ auto output_vector = instruction("two_to_two_particle_scattering_com_inverse", {p1, p2, pa, pb});
220
+ return {output_vector[0], output_vector[1], output_vector[2], output_vector[3]};
221
+ }
222
+
223
+ std::array<Value, 3> two_to_two_particle_scattering(Value r_phi, Value pa, Value pb, Value t_abs, Value m1, Value m2) {
224
+ auto output_vector = instruction("two_to_two_particle_scattering", {r_phi, pa, pb, t_abs, m1, m2});
225
+ return {output_vector[0], output_vector[1], output_vector[2]};
226
+ }
227
+
228
+ std::array<Value, 4> two_to_two_particle_scattering_inverse(Value p1, Value p2, Value pa, Value pb) {
229
+ auto output_vector = instruction("two_to_two_particle_scattering_inverse", {p1, p2, pa, pb});
230
+ return {output_vector[0], output_vector[1], output_vector[2], output_vector[3]};
231
+ }
232
+
233
+ std::array<Value, 3> two_to_three_particle_scattering(Value phi_choice, Value pa, Value pb, Value p3, Value s23, Value t1_abs, Value m1, Value m2) {
234
+ auto output_vector = instruction("two_to_three_particle_scattering", {phi_choice, pa, pb, p3, s23, t1_abs, m1, m2});
235
+ return {output_vector[0], output_vector[1], output_vector[2]};
236
+ }
237
+
238
+ std::array<Value, 4> two_to_three_particle_scattering_inverse(Value p1, Value p2, Value p3, Value pa, Value pb, Value t1_abs, Value s23) {
239
+ auto output_vector = instruction("two_to_three_particle_scattering_inverse", {p1, p2, p3, pa, pb, t1_abs, s23});
240
+ return {output_vector[0], output_vector[1], output_vector[2], output_vector[3]};
241
+ }
242
+
243
+ std::array<Value, 4> three_body_decay_com(Value r_e1, Value r_e2, Value r_phi, Value r_cos_theta, Value r_beta, Value m0, Value m1, Value m2, Value m3) {
244
+ auto output_vector = instruction("three_body_decay_com", {r_e1, r_e2, r_phi, r_cos_theta, r_beta, m0, m1, m2, m3});
245
+ return {output_vector[0], output_vector[1], output_vector[2], output_vector[3]};
246
+ }
247
+
248
+ std::array<Value, 10> three_body_decay_com_inverse(Value p1, Value p2, Value p3) {
249
+ auto output_vector = instruction("three_body_decay_com_inverse", {p1, p2, p3});
250
+ return {output_vector[0], output_vector[1], output_vector[2], output_vector[3], output_vector[4], output_vector[5], output_vector[6], output_vector[7], output_vector[8], output_vector[9]};
251
+ }
252
+
253
+ std::array<Value, 4> three_body_decay(Value r_e1, Value r_e2, Value r_phi, Value r_cos_theta, Value r_beta, Value m0, Value m1, Value m2, Value m3, Value p0) {
254
+ auto output_vector = instruction("three_body_decay", {r_e1, r_e2, r_phi, r_cos_theta, r_beta, m0, m1, m2, m3, p0});
255
+ return {output_vector[0], output_vector[1], output_vector[2], output_vector[3]};
256
+ }
257
+
258
+ std::array<Value, 11> three_body_decay_inverse(Value p1, Value p2, Value p3) {
259
+ auto output_vector = instruction("three_body_decay_inverse", {p1, p2, p3});
260
+ return {output_vector[0], output_vector[1], output_vector[2], output_vector[3], output_vector[4], output_vector[5], output_vector[6], output_vector[7], output_vector[8], output_vector[9], output_vector[10]};
261
+ }
262
+
263
+ std::array<Value, 2> t_inv_min_max(Value pa, Value pb, Value m1, Value m2) {
264
+ auto output_vector = instruction("t_inv_min_max", {pa, pb, m1, m2});
265
+ return {output_vector[0], output_vector[1]};
266
+ }
267
+
268
+ std::array<Value, 3> t_inv_value_and_min_max(Value pa, Value pb, Value p1, Value p2) {
269
+ auto output_vector = instruction("t_inv_value_and_min_max", {pa, pb, p1, p2});
270
+ return {output_vector[0], output_vector[1], output_vector[2]};
271
+ }
272
+
273
+ std::array<Value, 2> s23_min_max(Value pa, Value pb, Value p3, Value t1_abs, Value m1, Value m2) {
274
+ auto output_vector = instruction("s23_min_max", {pa, pb, p3, t1_abs, m1, m2});
275
+ return {output_vector[0], output_vector[1]};
276
+ }
277
+
278
+ std::array<Value, 3> s23_value_and_min_max(Value pa, Value pb, Value p3, Value t1_abs, Value p1, Value p2) {
279
+ auto output_vector = instruction("s23_value_and_min_max", {pa, pb, p3, t1_abs, p1, p2});
280
+ return {output_vector[0], output_vector[1], output_vector[2]};
281
+ }
282
+
283
+ Value invariants_from_momenta(Value p_ext, Value factors) {
284
+ return instruction("invariants_from_momenta", {p_ext, factors})[0];
285
+ }
286
+
287
+ Value sde2_channel_weights(Value invariants, Value masses, Value widths, Value indices) {
288
+ return instruction("sde2_channel_weights", {invariants, masses, widths, indices})[0];
289
+ }
290
+
291
+ Value subchannel_weights(Value invariants, Value masses, Value widths, Value indices, Value on_shell, Value group_sizes) {
292
+ return instruction("subchannel_weights", {invariants, masses, widths, indices, on_shell, group_sizes})[0];
293
+ }
294
+
295
+ Value apply_subchannel_weights(Value channel_weights_in, Value subchannel_weights, Value channel_indices, Value subchannel_indices) {
296
+ return instruction("apply_subchannel_weights", {channel_weights_in, subchannel_weights, channel_indices, subchannel_indices})[0];
297
+ }
298
+
299
+ Value pt_eta_phi_x(Value p_ext, Value x1, Value x2) {
300
+ return instruction("pt_eta_phi_x", {p_ext, x1, x2})[0];
301
+ }
302
+
303
+ Value mirror_momenta(Value p_ext, Value mirror) {
304
+ return instruction("mirror_momenta", {p_ext, mirror})[0];
305
+ }
306
+
307
+ std::array<Value, 2> momenta_to_x1x2(Value p_ext, Value e_cm) {
308
+ auto output_vector = instruction("momenta_to_x1x2", {p_ext, e_cm});
309
+ return {output_vector[0], output_vector[1]};
310
+ }
311
+
312
+ std::array<Value, 2> uniform_invariant(Value r, Value s_min, Value s_max) {
313
+ auto output_vector = instruction("uniform_invariant", {r, s_min, s_max});
314
+ return {output_vector[0], output_vector[1]};
315
+ }
316
+
317
+ std::array<Value, 2> uniform_invariant_inverse(Value s, Value s_min, Value s_max) {
318
+ auto output_vector = instruction("uniform_invariant_inverse", {s, s_min, s_max});
319
+ return {output_vector[0], output_vector[1]};
320
+ }
321
+
322
+ std::array<Value, 2> breit_wigner_invariant(Value r, Value mass, Value width, Value s_min, Value s_max) {
323
+ auto output_vector = instruction("breit_wigner_invariant", {r, mass, width, s_min, s_max});
324
+ return {output_vector[0], output_vector[1]};
325
+ }
326
+
327
+ std::array<Value, 2> breit_wigner_invariant_inverse(Value s, Value mass, Value width, Value s_min, Value s_max) {
328
+ auto output_vector = instruction("breit_wigner_invariant_inverse", {s, mass, width, s_min, s_max});
329
+ return {output_vector[0], output_vector[1]};
330
+ }
331
+
332
+ std::array<Value, 2> stable_invariant(Value r, Value mass, Value s_min, Value s_max) {
333
+ auto output_vector = instruction("stable_invariant", {r, mass, s_min, s_max});
334
+ return {output_vector[0], output_vector[1]};
335
+ }
336
+
337
+ std::array<Value, 2> stable_invariant_inverse(Value s, Value mass, Value s_min, Value s_max) {
338
+ auto output_vector = instruction("stable_invariant_inverse", {s, mass, s_min, s_max});
339
+ return {output_vector[0], output_vector[1]};
340
+ }
341
+
342
+ std::array<Value, 2> stable_invariant_nu(Value r, Value mass, Value nu, Value s_min, Value s_max) {
343
+ auto output_vector = instruction("stable_invariant_nu", {r, mass, nu, s_min, s_max});
344
+ return {output_vector[0], output_vector[1]};
345
+ }
346
+
347
+ std::array<Value, 2> stable_invariant_nu_inverse(Value s, Value mass, Value nu, Value s_min, Value s_max) {
348
+ auto output_vector = instruction("stable_invariant_nu_inverse", {s, mass, nu, s_min, s_max});
349
+ return {output_vector[0], output_vector[1]};
350
+ }
351
+
352
+ std::array<Value, 2> fast_rambo_massless(Value r, Value e_cm, Value p0) {
353
+ auto output_vector = instruction("fast_rambo_massless", {r, e_cm, p0});
354
+ return {output_vector[0], output_vector[1]};
355
+ }
356
+
357
+ std::array<Value, 3> fast_rambo_massless_inverse(Value p_out, Value e_cm) {
358
+ auto output_vector = instruction("fast_rambo_massless_inverse", {p_out, e_cm});
359
+ return {output_vector[0], output_vector[1], output_vector[2]};
360
+ }
361
+
362
+ std::array<Value, 2> fast_rambo_massless_com(Value r, Value e_cm) {
363
+ auto output_vector = instruction("fast_rambo_massless_com", {r, e_cm});
364
+ return {output_vector[0], output_vector[1]};
365
+ }
366
+
367
+ std::array<Value, 2> fast_rambo_massive(Value r, Value e_cm, Value masses, Value p0) {
368
+ auto output_vector = instruction("fast_rambo_massive", {r, e_cm, masses, p0});
369
+ return {output_vector[0], output_vector[1]};
370
+ }
371
+
372
+ std::array<Value, 3> fast_rambo_massive_inverse(Value p_out, Value e_cm, Value masses) {
373
+ auto output_vector = instruction("fast_rambo_massive_inverse", {p_out, e_cm, masses});
374
+ return {output_vector[0], output_vector[1], output_vector[2]};
375
+ }
376
+
377
+ std::array<Value, 2> fast_rambo_massive_com(Value r, Value e_cm, Value masses) {
378
+ auto output_vector = instruction("fast_rambo_massive_com", {r, e_cm, masses});
379
+ return {output_vector[0], output_vector[1]};
380
+ }
381
+
382
+ Value cut_unphysical(Value w_in, Value p, Value x1, Value x2) {
383
+ return instruction("cut_unphysical", {w_in, p, x1, x2})[0];
384
+ }
385
+
386
+ Value cut_one(Value obs, Value min, Value max) {
387
+ return instruction("cut_one", {obs, min, max})[0];
388
+ }
389
+
390
+ Value cut_all(Value obs, Value min, Value max) {
391
+ return instruction("cut_all", {obs, min, max})[0];
392
+ }
393
+
394
+ Value cut_any(Value obs, Value min, Value max) {
395
+ return instruction("cut_any", {obs, min, max})[0];
396
+ }
397
+
398
+ Value scale_transverse_energy(Value momenta) {
399
+ return instruction("scale_transverse_energy", {momenta})[0];
400
+ }
401
+
402
+ Value scale_transverse_mass(Value momenta) {
403
+ return instruction("scale_transverse_mass", {momenta})[0];
404
+ }
405
+
406
+ Value scale_half_transverse_mass(Value momenta) {
407
+ return instruction("scale_half_transverse_mass", {momenta})[0];
408
+ }
409
+
410
+ Value scale_partonic_energy(Value momenta) {
411
+ return instruction("scale_partonic_energy", {momenta})[0];
412
+ }
413
+
414
+ std::array<Value, 2> chili_forward(Value r, Value e_cm, Value m_out, Value pt_min, Value y_max) {
415
+ auto output_vector = instruction("chili_forward", {r, e_cm, m_out, pt_min, y_max});
416
+ return {output_vector[0], output_vector[1]};
417
+ }
418
+
419
+ std::array<Value, 2> chili_inverse(Value p_ext, Value e_cm, Value m_out, Value pt_min, Value y_max) {
420
+ auto output_vector = instruction("chili_inverse", {p_ext, e_cm, m_out, pt_min, y_max});
421
+ return {output_vector[0], output_vector[1]};
422
+ }
423
+
424
+ ValueVec matrix_element(ValueVec args) {
425
+ return instruction("matrix_element", args);
426
+ }
427
+
428
+ Value collect_channel_weights(Value amp2, Value channel_indices, Value channel_count) {
429
+ return instruction("collect_channel_weights", {amp2, channel_indices, channel_count})[0];
430
+ }
431
+
432
+ Value interpolate_pdf(Value x, Value q2, Value pid_indices, Value grid_logx, Value grid_logq2, Value grid_coeffs) {
433
+ return instruction("interpolate_pdf", {x, q2, pid_indices, grid_logx, grid_logq2, grid_coeffs})[0];
434
+ }
435
+
436
+ Value interpolate_alpha_s(Value q2, Value grid_logq2, Value grid_coeffs) {
437
+ return instruction("interpolate_alpha_s", {q2, grid_logq2, grid_coeffs})[0];
438
+ }
439
+
440
+ Value matmul(Value x, Value weight, Value bias) {
441
+ return instruction("matmul", {x, weight, bias})[0];
442
+ }
443
+
444
+ Value relu(Value in1) {
445
+ return instruction("relu", {in1})[0];
446
+ }
447
+
448
+ Value leaky_relu(Value in1) {
449
+ return instruction("leaky_relu", {in1})[0];
450
+ }
451
+
452
+ Value elu(Value in1) {
453
+ return instruction("elu", {in1})[0];
454
+ }
455
+
456
+ Value gelu(Value in1) {
457
+ return instruction("gelu", {in1})[0];
458
+ }
459
+
460
+ Value sigmoid(Value in1) {
461
+ return instruction("sigmoid", {in1})[0];
462
+ }
463
+
464
+ Value softplus(Value in1) {
465
+ return instruction("softplus", {in1})[0];
466
+ }
467
+
468
+ std::array<Value, 3> rqs_reshape(Value input, Value bin_count) {
469
+ auto output_vector = instruction("rqs_reshape", {input, bin_count});
470
+ return {output_vector[0], output_vector[1], output_vector[2]};
471
+ }
472
+
473
+ Value rqs_find_bin(Value input, Value in_sizes, Value out_sizes, Value derivatives) {
474
+ return instruction("rqs_find_bin", {input, in_sizes, out_sizes, derivatives})[0];
475
+ }
476
+
477
+ std::array<Value, 2> rqs_forward(Value input, Value condition) {
478
+ auto output_vector = instruction("rqs_forward", {input, condition});
479
+ return {output_vector[0], output_vector[1]};
480
+ }
481
+
482
+ std::array<Value, 2> rqs_inverse(Value input, Value condition) {
483
+ auto output_vector = instruction("rqs_inverse", {input, condition});
484
+ return {output_vector[0], output_vector[1]};
485
+ }
486
+
487
+ Value softmax(Value input) {
488
+ return instruction("softmax", {input})[0];
489
+ }
490
+
491
+ Value softmax_prior(Value input, Value prior) {
492
+ return instruction("softmax_prior", {input, prior})[0];
493
+ }
494
+
495
+ std::array<Value, 2> sample_discrete(Value r, Value option_count) {
496
+ auto output_vector = instruction("sample_discrete", {r, option_count});
497
+ return {output_vector[0], output_vector[1]};
498
+ }
499
+
500
+ std::array<Value, 2> sample_discrete_inverse(Value index, Value option_count) {
501
+ auto output_vector = instruction("sample_discrete_inverse", {index, option_count});
502
+ return {output_vector[0], output_vector[1]};
503
+ }
504
+
505
+ std::array<Value, 2> sample_discrete_probs(Value r, Value probs) {
506
+ auto output_vector = instruction("sample_discrete_probs", {r, probs});
507
+ return {output_vector[0], output_vector[1]};
508
+ }
509
+
510
+ std::array<Value, 2> sample_discrete_probs_inverse(Value index, Value probs) {
511
+ auto output_vector = instruction("sample_discrete_probs_inverse", {index, probs});
512
+ return {output_vector[0], output_vector[1]};
513
+ }
514
+
515
+ std::array<Value, 2> discrete_histogram(Value input, Value weights, Value option_count) {
516
+ auto output_vector = instruction("discrete_histogram", {input, weights, option_count});
517
+ return {output_vector[0], output_vector[1]};
518
+ }
519
+
520
+ Value permute_momenta(Value momenta, Value permutations, Value index) {
521
+ return instruction("permute_momenta", {momenta, permutations, index})[0];
522
+ }
523
+
524
+ Value gather(Value index, Value choices) {
525
+ return instruction("gather", {index, choices})[0];
526
+ }
527
+
528
+ Value gather_int(Value index, Value choices) {
529
+ return instruction("gather_int", {index, choices})[0];
530
+ }
531
+
532
+ Value select_int(Value input, Value indices) {
533
+ return instruction("select_int", {input, indices})[0];
534
+ }
535
+
536
+ Value select(Value input, Value indices) {
537
+ return instruction("select", {input, indices})[0];
538
+ }
539
+
540
+ Value select_vector(Value input, Value indices) {
541
+ return instruction("select_vector", {input, indices})[0];
542
+ }
543
+
544
+ Value argsort(Value input) {
545
+ return instruction("argsort", {input})[0];
546
+ }
547
+
548
+ Value one_hot(Value index, Value option_count) {
549
+ return instruction("one_hot", {index, option_count})[0];
550
+ }
551
+
552
+ Value nonzero(Value input) {
553
+ return instruction("nonzero", {input})[0];
554
+ }
555
+
556
+ Value batch_gather(Value indices, Value values) {
557
+ return instruction("batch_gather", {indices, values})[0];
558
+ }
559
+
560
+ Value batch_scatter(Value indices, Value target, Value source) {
561
+ return instruction("batch_scatter", {indices, target, source})[0];
562
+ }
563
+
564
+ Value random(Value batch_size, Value count) {
565
+ return instruction("random", {batch_size, count})[0];
566
+ }
567
+
568
+ std::array<Value, 2> unweight(Value weights, Value max_weight) {
569
+ auto output_vector = instruction("unweight", {weights, max_weight});
570
+ return {output_vector[0], output_vector[1]};
571
+ }
572
+
573
+ std::array<Value, 2> vegas_forward(Value input, Value grid) {
574
+ auto output_vector = instruction("vegas_forward", {input, grid});
575
+ return {output_vector[0], output_vector[1]};
576
+ }
577
+
578
+ std::array<Value, 2> vegas_inverse(Value input, Value grid) {
579
+ auto output_vector = instruction("vegas_inverse", {input, grid});
580
+ return {output_vector[0], output_vector[1]};
581
+ }
582
+
583
+ std::array<Value, 2> vegas_histogram(Value input, Value weights, Value bin_count) {
584
+ auto output_vector = instruction("vegas_histogram", {input, weights, bin_count});
585
+ return {output_vector[0], output_vector[1]};
586
+ }
587
+
588
+ std::array<Value, 2> histogram(Value input, Value weights, Value min, Value max, Value bin_count) {
589
+ auto output_vector = instruction("histogram", {input, weights, min, max, bin_count});
590
+ return {output_vector[0], output_vector[1]};
591
+ }