RejectionSamplers.jl
RejectionSamplers.jl provides a flexible, hardware-agnostic framework for implementing and executing rejection sampling algorithms in Julia. The package separates the core stages of the rejection sampling process into independent, extensible interfaces, making it suitable for a wide range of applications, This includes simple numerical sampling, but also full-scale Monte-Carlo event generation.
Key Features
Hardware-agnostic design: runs on both CPU and GPU backends via KernelAbstractions.jl.
Composable interfaces: each stage of the rejection algorithm has its own abstract interface:
- Proposal generation: defines how candidate samples are drawn.
- Target evaluation: specifies the target distribution.
- Probability generation: computes acceptance probabilities.
- Rejection filtering: performs the acceptance/rejection step.
Modular and extensible: each stage can be specialized for specific domains, data types, or hardware architectures.
Efficient parallel execution: suitable for large-scale Monte-Carlo workloads or GPU-accelerated applications.
Installation
RejectionSamplers.jl can be installed via Julia’s package manager:
julia> import Pkg
julia> Pkg.add("RejectionSamplers")You can also use the Pkg REPL mode by pressing ] and then running:
pkg> add RejectionSamplersIf you'd like to use the development version instead:
pkg> add RejectionSamplers#devOr clone manually and instantiate:
git clone https://github.com/QEDjl-project/RejectionSamplers.jl.git
cd RejectionSamplers.jl
julia --project=@.
julia> ] instantiateContributing
Contributions are welcome! If you'd like to report a bug, suggest an enhancement, or contribute code, please feel free to open an issue or submit a pull request.
To ensure consistency across the QuantumElectrodynamics.jl ecosystem, we encourage all contributors to review the QuantumElectrodynamics.jl contribution guide.
Credits and contributors
This work was partly funded by the Center for Advanced Systems Understanding (CASUS) that is financed by Germany’s Federal Ministry of Education and Research (BMBF) and by the Saxon Ministry for Science, Culture and Tourism (SMWK) with tax funds on the basis of the budget approved by the Saxon State Parliament.
The core code of the package RejectionSamplers.jl is developed by a small team at the Center for Advanced Systems Understanding (CASUS) and the Helmholtz-Zentrum Dresden Rossendorf (HZDR), namely
Contributors
- Uwe Hernandez Acosta (CASUS/HZDR, u.hernandez@hzdr.de)
- Anton Reinhard (CASUS/HZDR)
- Simeon Ehrig (CASUS/HZDR)
- Klaus Steiniger (CASUS/HZDR)
- Rene Widera (HZDR)
Acknowledgements
We extend our gratitude for the support received through direct and indirect funding for this project, especially
- Michael Bussmann
- Tobias Dornheim
License
MIT © Uwe Hernandez Acosta