MatrixElementApi

class MatrixElementApi

Loaded UMAMI shared library for one matrix element.

UMAMI (Unified MAtrix eleMent Interface) is madspace’s uniform way of calling matrix-element code, currently the cudacpp plugin [1]; see MatrixElement for the compute-graph function built on top of it. A MatrixElementApi dynamically loads the library, resolves its exported UMAMI entry points, and exposes the metadata queries and the raw call. Obtained from Context::load_matrix_element, or from Context::add_matrix_element for entry points given as UmamiFunctions, never constructed directly.

References

Public Functions

MatrixElementApi(MatrixElementApi&&) noexcept = default
MatrixElementApi &operator=(MatrixElementApi&&) noexcept = default
MatrixElementApi(const MatrixElementApi&) = delete
MatrixElementApi &operator=(const MatrixElementApi&) = delete
inline DeviceType device_type() const

Device the underlying library was built for.

inline std::size_t particle_count() const

Number of external particles.

inline std::size_t diagram_count() const

Number of Feynman diagrams.

inline std::size_t helicity_count() const

Number of helicity configurations.

inline std::size_t index() const

Index of this matrix element in its Context, in load order.

inline const std::string &file_name() const

Path of the loaded UMAMI shared library, or the name given to Context::add_matrix_element.

inline std::vector<bool> supported_inputs() const

UMAMI input keys this library can accept.

inline std::vector<bool> required_inputs() const

UMAMI input keys this library needs; a subset of supported_inputs.

inline std::vector<bool> supported_outputs() const

UMAMI output keys this library can produce.

inline void call(UmamiHandle handle, size_t count, size_t stride, size_t offset, size_t input_count, UmamiInputKey const *input_keys, void const *const *inputs, size_t output_count, UmamiOutputKey const *output_keys, void *const *outputs) const

Raw UMAMI call: evaluate the matrix element on a batch of count events for the requested input_keys / output_keys.

inline void *process_instance() const

Opaque per-thread UMAMI process handle, initialized on first use.