QEDevents

Documentation for QEDevents.

QEDevents.MaxwellBoltzmannType
MaxwellBoltzmann(scale::Real)

The Maxwell-Boltzmann distribution with scale parameter a has the probability density function

\[f(x,a) = \sqrt{\frac{2}{\pi}}\frac{x^2}{a^3}\exp\left(\frac{-x^2}{2a^2}\right)\]

The Maxwell-Boltzmann distribution is related to the Chi distribution via the property $X\sim \operatorname{MaxwellBoltzmann}(a=1)$, then $X\sim\chi(\mathrm{dof}=3)$.

External links

source
QEDevents.MaxwellBoltzmannParticleType

MaxwellBoltzmannParticle( dir::ParticleDirection, part::AbstractParticleType, temperature::Real )

The Maxwell-Boltzmann particle distribution is a single-particle distribution, where the spatial components of the four-momentum are normally distributed with localion $\mu = 0$ and variance $\sigma = m k_B T$ ($m$ is the particle's mass, $k_B$ is the Boltzmann constant, and $T$ is the temperature). The three-magnitude $\varrho = \sqrt{p_x^2 + p_y^2 + p_z^2}$ of the generated particle-statefuls is MaxwellBoltzmann distributed.

External links

source
QEDevents.MultiParticleVariateType

MultiParticleVariate

Auxiliary type to represent multiple particles in the context of distributions and sampler. A sample from this variate form has the type Vector{ParticleStateful}.

source
QEDevents.ParticleLikeVariateType
ParticleLikeVariate{N<:Int}

Auxiliary type to represent the number of axes in the space of all particles:

  • N == 0 single particle variate
  • N == 1 multiple particle variate
source
QEDevents.ParticleSampleableType
ParticleSampleable{V<:QEDlikeVariate}

Abstract base type for sampleable particle distributions and sampler in the context of QEDevents.jl. Here a particle-sampleable is generally a type which has some sort of rand function to produce random samples for properties of given particles, like four-momentum, spin, polarization, etc..

To implement the particle-sampleable interface, the following functions need to be given:

Optionally, one can enhance the calculation of weights by providing

See weight for details. Furthermore, one can provide custom four-momentum types used for the generation of samples by implementing

For the actual sampling, one must implement

Using these interface functions, the following versions rand function are implemented. However, if in the particular case, there are more sophisticated implementations for the respective version of the rand function (see below), they can be implemented instead of _randmom. Nevertheless, in this case, it is recommended for convenience to implement a _randmom function as well, maybe using the result of rand.

Single particle distribution

For SingleParticleVariatesamplers, the single sample version rand is given:

Distributions.rand(
    rng::Random.AbstractRNG,
    s::ParticleSampleable{SingleParticleVariate})

which returns a random sample from s as a ParticleStateful.

Multiple particle distribution

For MultiParticleVariate samplers, the mutating version of rand implemented:

Distributions._rand!(
    rng::Random.AbstractRNG,
    s::ParticleSampleable{MultiParticleVariate},
    out::AbstractArray{ParticleStateful})

which also provides implementations of rand for one or more samples.

Scattering process distribution

For ProcessLikeVariate distributions, the single sample version of rand is given:

Distributions.rand(
    rng::Random.AbstractRNG,
    s::ParticleSampleable{ProcessLikeVariate})

which returns a PhaseSpacePoint including the respective scattering process, computation model and phase-space definition.

source
QEDevents.ProcessLikeVariateType
ProcessLikeVariate

Auxiliary type to represent distributions and samplers for scattering processes.

A sample from this variate form has the type PhaseSpacePoint.

source
QEDevents.SingleParticleVariateType
SingleParticleVariate

Auxiliary type to represent single particles in the context of distributions and sampler. A sample from this variate form has the type ParticleStateful.

source
QEDevents._assert_valid_inputMethod
_assert_valid_input(s::ParticleSampleable,x)

Throw InvalidInputError if the input x is not valid, do nothing otherwise. This function is usually used for checking, if the input has the assumed properties. Type checks are done using multiple dispatch, or _assert_valid_input_type. The default is doing nothing.

Note

This interface function is optional for subtypes of ParticleSampleable.

source
QEDevents._assert_valid_input_typeMethod
_assert_valid_input_type(s::ParticleSampleable,x)

Throw InvalidInputError if the input x has the wrong type, do nothing otherwise. This function is usually used for complicated types, where the implementation via multiple dispatch is cumbersome. The default is doing nothing.

Note

This interface function is optional for subtypes of ParticleSampleable.

source
QEDevents._momentum_typeMethod
_momentum_type(s::ParticleSampleable,x)

Return the momentum type used for the generation of samples. The default is SFourMomentum.

Note

This interface function is optional for subtypes of ParticleSampleable.

source
QEDevents._particleFunction
_particle(dist::SingleParticleDistribution)::AbstractParticle

Return the particle associated with the dist.

Note

Interface function to be implemented for single-particle distributions.

source
QEDevents._particle_directionFunction
_particle_direction(dist::SingleParticleDistribution)::ParticleDirection

Return the particle-direction of the particle associated with dist.

Note

Interface function to be implemented for single-particle distributions.

source
QEDevents._particle_directionsFunction
_particle_direction(dist::MultiParticleDistribution)

Return tuple of particle-directions for all particles associated with dist.

Note

Interface function to be implemented for multi-particle distributions.

source
QEDevents._particlesFunction
_particle(dist::MultiParticleDistribution)

Return tuple of particles associated with the dist.

Note

Interface function to be implemented for multi-particle distributions.

source
QEDevents._post_processingMethod
_post_processing(s::ParticleSampleable, x, result)

Return post-processed version of result. The default does nothing and returns result.

Note

This interface function is optional for subtypes of ParticleSampleable.

source
QEDevents._randmomFunction
_randmom(rng::AbstractRNG,d::ParticleSampleable)

Return random momentum/momenta according to the distribution d. The momentum type used in the return must be equal to the one returned by _momentum_type.

The actual return type for _randmom depends on the variate form.

Single particle distributions

The _randmom function must return a single momentum, which type is the same as retured by _momentum_type

Multiple particle distribution

For a set of particles, the _randmom function must return an iterable container of momenta (e.g. a tuple or vector), which length is the same as the number of particles according to the distribution. The element type of this container must be the same as returned by _momentum_type.

Scattering process distributions

For scattering processes, the _randmom function must return two iterable containers of momenta, one for the incoming and one for the outgoing particles. The momentum type in both of the containers must be the same as returned by _momentum_type.

source
QEDevents._weightFunction
_weight(s::ParticleSampleable, x)

Return the weight associated with the given sample x according to the particle-sampleable s. This function must not do input validation. This is done by weight, which calls _weight after input validation.

Note

This interface function must be implemented for subtypes of ParticleSampleable.

source
QEDevents._weightMethod
_weight(
    d::MaxwellBoltzmannParticle{D,P,T}, ps::ParticleStateful{D,P}
) where {D,P,T}

Unsafe weight-function for MaxwellBoltzmannParticle, which is given by

\[ w(p) = \begin{cases} \frac{1}{4\pi}\sqrt{\frac{2}{\pi}}\frac{\varrho^2}{a^3}\exp\left(\frac{-\varrho^2}{2a^2}\right)\quad &\text{,for } p^2=m^2\\ 0 &\mathrm{elsewhere}. \end{cases} \]

with $\varrho^2 = p_x^2 + p_y^2 + p_z^2$ and $a = \sqrt{m k_B T}$ ($m$ is the particle's mass, $k_B$ is the Boltzmann constant, and $T$ is the temperature).

source
QEDevents.is_exactFunction
is_exact(s::ParticleSampleable)

Return whether or not the particle-sampleable s is exactly representing the distribution given by weight.

Note

This interface function must be implemented for subtypes of ParticleSampleable.

source
QEDevents.max_weightFunction
max_weight(::ParticleSampleable)

Interface function, which returns the maximum possible weight for the particle-sampleable.

source