Reference

Contents

Index

Vegas.AbstractTargetDistributionType
AbstractTargetDistribution

Abstract base type for target distributions used in sampling.

Concrete subtypes represent functions defined on an N-dimensional real domain and must implement the following interface:

Required Methods

  • _compute(dist, x::NTuple{N,<:Real})::Real Evaluate the (possibly unnormalized) target distribution at the point x.

  • degrees_of_freedom(dist)::Int Return the number of degrees of freedom, i.e. the dimensionality of the domain on which the distribution is defined.

Notes

  • Implementations are expected to be side-effect free and compatible with GPU execution.
  • Broadcasting over an AbstractTargetDistribution treats the distribution as a scalar.

See also

_compute, degrees_of_freedom

source
Vegas.VegasBatchBufferType
VegasBatchBuffer{T, N, D, V, W, J}

Buffer object for Vegas on the GPU.

Template parameters:

  • T: Basic data type used throughout, e.g. Float32
  • N: Size of the buffer, "batch_size", for example 1024
  • D: Dimensionality of the samples, for example 3
  • V: The type of the values (samples), backend specific matrix type, size according to previously defined N and D
  • W: The type of the weights, backend specific vector type, size according to previously defined N
  • J: The type of the jacobians, backend specific vector type, size according to previously defined N
  • B: The block size used internally for execution, can affect the performance. N must be a multiple of this.

Members:

  • values::V: The sampled values
  • target_weights::W: The calculated weights of the samples
  • jacobians::J: The calculated jacobians of the samples

Allocate this through allocate_vegas_batch.

eltype(), length(), size(), and get_backend() are statically defined on this buffer.

source
Vegas.VegasGridType
VegasGrid{T, N, D, G}

The GPU allocated Vegas grid.

Templates:

  • T: The basic data type, e.g. Float32
  • N: The number of grid lines of the Vegas grid per dimension, e.g. 100
  • D: The dimensionality of the Vegas grid, e.g. 3
  • G: The complete type of the grid, including GPU backend information, a vector (if 1D) or matrix

Members:

  • nodes::G: The vegas grid lines

Allocate this through allocate_vegas_grid() and use fill_uniformly!() to initialize it as a uniform grid. Alternatively, do both in one step using uniform_vegas_grid().

eltype(), nbins(), ndims(), and get_backend() are statically defined on this grid.

source
Vegas.VegasOutBufferType
VegasOutBuffer{T, V}

The GPU buffer for some statistical values used during training.

Templates:

  • T: The underlying element type, for example Float32
  • V: The actual backend aware vector type

Members:

  • weighted_mean::V: The weighted mean, only one value so the vector has length 1
  • variance::V: The variance, only one value so the vector has length 1
  • chi_squared::V: The chi squared statistic, only one value so the vector has length 1

eltype() is statically defined on this type.

Allocate using _allocate_vegas_output.

source
Vegas._computeFunction
_compute(dist::AbstractTargetDistribution,x::NTuple{N,<:Real})::Real

Interface function: Return value of dist computed at x.

source
Vegas._gen_gridMethod
_gen_grid(bins, dists::Tuple)

Sets up the D-dimensional grid with the distributions, where dists is a tuple of D distributions that implement the quantile and cdf functions.

Warning

Currently only works on CPU, the finished grid can be moved to the GPU

source
Vegas.degrees_of_freedomFunction
degrees_of_freedom(dist::AbstractTargetDistribution)::Int

Interface function: return the degrees of freedom of dist, e.g. the dimension of the domain.

source
Vegas.vegas_binning_kernel_batched!Method

Batched binning kernel. The grid layout is three-dimensional, the first dimension is in the number of bins, the second the dimensionality of the samples, the third is the number of batches. The given batch_size times the third block dimension must equal the number of samples.

Warn

The second dimension of the block size for this must be D for the shared memory loading to work correctly. The third dimension should be 1.

source

TestUtils

CPU version (to be deprecated)

Vegas.VegasCPU.AbstractProcessSetupType
AbstractProcessSetup{P,M,PSL}

Abstract base type for setups related to scattering processes with

  • P<:AbstractProcessDefinition,
  • M<:AbstractModelDefinition,
  • PSL<:AbstractPhaseSpaceLayout.

Interface function to be implemented:

  • QEDbase.process(stp::AbstractProcessSetup)::P,
  • QEDbase.model(stp::AbstractProcessSetup)::M,
  • QEDbase.phase_space_layout(stp::AbstractProcessSetup)::PSL,
  • _compute(stp::AbstractProcessSetup, psp::AbstractPhaseSpacePoint)::Real.

Optionally, the following interface functions can be implemented:

  • _build_psp(stp::AbstractProcessSetup,coords::Tuple)::PSP
  • degree_of_freedom(stp::AbstractProcessSetup)::Int,
  • coordinate_boundaries(stp::AbstractProcessSetup)::Tuple,

A leading underscore of an interface function means, there is no input validation necessary, because there is a generic implementation of the same function without the underscore, which does basic compiletime checks.

source