Scattering Process Interface

Process Interface

QEDbase.AbstractProcessDefinitionType

Abstract base type for definitions of scattering processes. It is the root type for the process interface, which assumes that every subtype of AbstractProcessDefinition implements at least

incoming_particles(proc_def::AbstractProcessDefinition)
outgoing_particles(proc_def::AbstractProcessDefinition)

which return a tuple of the incoming and outgoing particles, respectively.

An AbstractProcessDefinition is also expected to contain spin and polarization information of its particles. For this, the functions

incoming_spin_pols(proc_def::AbstractProcessDefinition)
outgoing_spin_pols(proc_def::AbstractProcessDefinition)

can be overloaded. They must return a tuple of [AbstractSpinOrPolarization], where the order must match the order of the process' particles. A default implementation is provided which assumes AllSpin for every is_fermion particle and AllPolarization for every is_boson particle.

!!! note Performance It is very beneficial for the performance of derived functions if these functions return compile-time-known values.

On top of these spin and polarization functions, the following functions are automatically defined:

multiplicity(proc_def::AbstractProcessDefinition)
incoming_multiplicity(proc_def::AbstractProcessDefinition)
outgoing_multiplicity(proc_def::AbstractProcessDefinition)

Which return the number of spin and polarization combinations that should be considered for the process. For more detail, refer to the functions' documentations.

Furthermore, to calculate scattering probabilities and differential cross sections, the following interface functions need to be implemented for every combination of CustomProcess<:AbstractProcessDefinition, CustomModel<:AbstractModelDefinition, and CustomPhasespaceDefinition<:AbstractPhasespaceDefinition.

    _incident_flux(psp::InPhaseSpacePoint{CustomProcess,CustomModel})

    _matrix_element(psp::PhaseSpacePoint{CustomProcess,CustomModel})

    _averaging_norm(proc::CustomProcess)

    _is_in_phasespace(psp::PhaseSpacePoint{CustomProcess,CustomModel})

    _phase_space_factor(psp::PhaseSpacePoint{CustomProcess,CustomModel,CustomPhasespaceDefinition})

Optional is the implementation of


    _total_probability(psp::PhaseSpacePoint{CustomProcess,CustomModel,CustomPhasespaceDefinition})

to enable the calculation of total probabilities and cross sections.

source
QEDbase.incoming_particlesFunction
incoming_particles(proc_def::AbstractProcessDefinition)

Interface function for scattering processes. Return a tuple of the incoming particles for the given process definition. This function needs to be given to implement the scattering process interface.

!!! note Performance It is very beneficial for the performance of derived functions if this function returns compile-time-known values.

See also: AbstractParticleType

source
QEDbase.outgoing_particlesFunction
outgoing_particles(proc_def::AbstractProcessDefinition)

Interface function for scattering processes. Return the tuple of outgoing particles for the given process definition. This function needs to be given to implement the scattering process interface.

!!! note Performance It is very beneficial for the performance of derived functions if this function returns compile-time-known values.

See also: AbstractParticleType

source
QEDbase.incoming_spin_polsFunction
incoming_spin_pols(proc_def::AbstractProcessDefinition)

Interface function for scattering processes. Return the tuple of spins or polarizations for the given process definition. The order must be the same as the particles returned from incoming_particles. A default implementation is provided, returning AllSpin for every is_fermion and AllPolarization for every is_boson.

!!! note Performance It is very beneficial for the performance of derived functions if this function returns compile-time-known values.

See also: AbstractSpinOrPolarization

source
QEDbase.outgoing_spin_polsFunction
outgoing_spin_pols(proc_def::AbstractProcessDefinition)

Interface function for scattering processes. Return the tuple of spins or polarizations for the given process definition. The order must be the same as the particles returned from outgoing_particles. A default implementation is provided, returning AllSpin for every is_fermion and AllPolarization for every is_boson.

!!! note Performance It is very beneficial for the performance of derived functions if this function returns compile-time-known values.

See also: AbstractSpinOrPolarization

source

Particle Directions

QEDbase.ParticleDirectionType

Abstract base type for the directions of particles in the context of processes, i.e. either they are incoming or outgoing. Subtypes of this are mostly used for dispatch.

source
QEDbase.IncomingType
Incoming <: ParticleDirection

Concrete implementation of a ParticleDirection to indicate that a particle is incoming in the context of a given process. Mostly used for dispatch.

julia> using QEDbase

julia> Incoming()
incoming
ParticleDirection Interface

Besides being a subtype of ParticleDirection, Incoming has

is_incoming(::Incoming) = true
is_outgoing(::Incoming) = false
source
QEDbase.OutgoingType
Outgoing <: ParticleDirection

Concrete implementation of a ParticleDirection to indicate that a particle is outgoing in the context of a given process. Mostly used for dispatch.

julia> using QEDbase

julia> Outgoing()
outgoing
ParticleDirection Interface

Besides being a subtype of ParticleDirection, Outgoing has

is_incoming(::Outgoing) = false
is_outgoing(::Outgoing) = true
source
QEDbase.UnknownDirectionType
UnknownDirection <: ParticleDirection

Concrete implementation of a ParticleDirection to indicate that a particle has an unknown direction. This can mean that a specific direction does not make sense in the given context, that the direction is unavailable, or that it is unnecessary.

julia> using QEDbase

julia> UnknownDirection()
unknown direction
ParticleDirection Interface

Besides being a subtype of ParticleDirection, UnknownDirection has

is_incoming(::UnknownDirection) = false
is_outgoing(::UnknownDirection) = false
source

Spins and Polarizations

QEDbase.spin_pols_iterFunction
all_spin_pols(process::AbstractProcessDefinition)

This function returns an iterator, yielding every fully definite combination of spins and polarizations allowed by the process' spin_pols. Each returned element is a Tuple of the incoming and the outgoing spins and polarizations, in the order of the process' own spins and polarizations.

This works together with the definite spins and polarizations, AllSpin, AllPolarization, and the synced versions SyncedPolarization and SyncedSpin.

julia> using QEDbase; using QEDcore; using QEDprocesses;

julia> proc = ScatteringProcess((Photon(), Photon(), Photon(), Electron()), (Photon(), Electron()), (SyncedPolarization(1), SyncedPolarization(2), SyncedPolarization(1), SpinUp()), (SyncedPolarization(2), AllSpin()))
generic QED process
    incoming: photon (synced polarization 1), photon (synced polarization 2), photon (synced polarization 1), electron (spin up)
    outgoing: photon (synced polarization 2), electron (all spins)


julia> for sp_combo in spin_pols_iter(proc) println(sp_combo) end
((x-polarized, x-polarized, x-polarized, spin up), (x-polarized, spin up))
((y-polarized, x-polarized, y-polarized, spin up), (x-polarized, spin up))
((x-polarized, y-polarized, x-polarized, spin up), (y-polarized, spin up))
((y-polarized, y-polarized, y-polarized, spin up), (y-polarized, spin up))
((x-polarized, x-polarized, x-polarized, spin up), (x-polarized, spin down))
((y-polarized, x-polarized, y-polarized, spin up), (x-polarized, spin down))
((x-polarized, y-polarized, x-polarized, spin up), (y-polarized, spin down))
((y-polarized, y-polarized, y-polarized, spin up), (y-polarized, spin down))

julia> length(spin_pols_iter(proc))
8
source

Spins

QEDbase.AllSpinType

Concrete type indicating that a particle with is_fermion has an indefinite spin and the differential cross section calculation should average or sum over all spins, depending on the direction (Incoming or Outgoing) of the particle in question.

julia> using QEDbase

julia> AllSpin()
all spins
source
QEDbase.SyncedSpinType
SyncedSpin{N::Int} <: AbstractIndefiniteSpin

An indefinite spin type, indicating that multiple particles have a synced spin. Two spins are considered synced when they have the same value for N. This means that the resulting multiplicity will be 2 total for all particles with the same SyncedSpin.

Having a single SyncedSpin{N} in a process is legal. In this case, it behaves just like an AllSpin would.

See also: multiplicity

source

Polarization

QEDbase.PolarizationXType

Concrete type which indicates, that a particle with is_boson has polarization in $x$-direction.

julia> using QEDbase

julia> PolX()
x-polarized
Coordinate axes

The notion of axes, e.g. $x$- and $y$-direction is just to distinguish two orthogonal polarization directions. However, if the three-momentum of the particle with is_boson is aligned to the $z$-axis of a coordinate system, the polarization axes define the $x$- or $y$-axis, respectively.

Alias

There is a built-in alias for PolarizationX:

julia> using QEDbase

julia> PolarizationX === PolX
true
source
QEDbase.PolXType

Concrete type which indicates, that a particle with is_boson has polarization in $x$-direction.

julia> using QEDbase

julia> PolX()
x-polarized
Coordinate axes

The notion of axes, e.g. $x$- and $y$-direction is just to distinguish two orthogonal polarization directions. However, if the three-momentum of the particle with is_boson is aligned to the $z$-axis of a coordinate system, the polarization axes define the $x$- or $y$-axis, respectively.

Alias

There is a built-in alias for PolarizationX:

julia> using QEDbase

julia> PolarizationX === PolX
true
source
QEDbase.PolarizationYType

Concrete type which indicates, that a particle with is_boson has polarization in $y$-direction.

julia> using QEDbase

julia> PolY()
y-polarized
Coordinate axes

The notion of axes, e.g. $x$- and $y$-direction is just to distinguish two orthogonal polarization directions. However, if the three-momentum of the particle with is_boson is aligned to the $z$-axis of a coordinate system, the polarization axes define the $x$- or $y$-axis, respectively.

Alias

There is a built-in alias for PolarizationY:

julia> using QEDbase

julia> PolarizationY === PolY
true
source
QEDbase.PolYType

Concrete type which indicates, that a particle with is_boson has polarization in $y$-direction.

julia> using QEDbase

julia> PolY()
y-polarized
Coordinate axes

The notion of axes, e.g. $x$- and $y$-direction is just to distinguish two orthogonal polarization directions. However, if the three-momentum of the particle with is_boson is aligned to the $z$-axis of a coordinate system, the polarization axes define the $x$- or $y$-axis, respectively.

Alias

There is a built-in alias for PolarizationY:

julia> using QEDbase

julia> PolarizationY === PolY
true
source
QEDbase.AllPolarizationType

Concrete type indicating that a particle with is_boson has an indefinite polarization and the differential cross section calculation should average or sum over all polarizations, depending on the direction (Incoming or Outgoing) of the particle in question.

julia> using QEDbase

julia> AllPol()
all polarizations
Alias

There is a built-in alias for AllPolarization:

julia> using QEDbase

julia> AllPolarization === AllPol
true
source
QEDbase.AllPolType

Concrete type indicating that a particle with is_boson has an indefinite polarization and the differential cross section calculation should average or sum over all polarizations, depending on the direction (Incoming or Outgoing) of the particle in question.

julia> using QEDbase

julia> AllPol()
all polarizations
Alias

There is a built-in alias for AllPolarization:

julia> using QEDbase

julia> AllPolarization === AllPol
true
source
QEDbase.SyncedPolarizationType
SyncedPolarization{N::Int} <: AbstractIndefinitePolarization

An indefinite polarization type, indicating that multiple particles have a synced polarization. Two polarizations are considered synced when they have the same value for N. This means that the resulting multiplicity will be 2 total for all particles with the same SyncedPolarization.

Having a single SyncedPolarization{N} in a process is legal. In this case, it behaves just like an AllPolarization would.

See also: multiplicity

source

Utility Functions

QEDbase.number_particlesFunction
number_particles(proc_def::AbstractProcessDefinition, dir::ParticleDirection)

Convenience function dispatching to number_incoming_particles or number_outgoing_particles depending on the given direction, returning the number of incoming or outgoing particles, respectively.

source
number_particles(proc_def::AbstractProcessDefinition, dir::ParticleDirection, species::AbstractParticleType)

Return the number of particles of the given direction and species in the given process definition.

source
number_particles(proc_def::AbstractProcessDefinition, particle::AbstractParticleStateful)

Return the number of particles of the given particle's direction and species in the given process definition.

source
QEDbase.multiplicityFunction
multiplicity(proc::AbstractProcessDefinition)

Return the number of spin and polarization combinations represented by proc total. This depends on the specific AbstractSpinOrPolarizations returned by spin_pols for proc. For example, a default Compton process with four indefinite spins/polarizations has a multiplicity of 2^4 = 16. A Compton process with many incoming photons that have synced polarizations will still have a multiplicity of 16.

!!! note Performance As long as incoming_spin_pols and outgoing_spin_pols can be evaluated at compile time, this function is completely compiled away.

!!! note Incoming and Outgoing Spins/Polarizations Note that the total multiplicity is not necessarily the incoming and outgoing multiplicities multiplied. This is the case when incoming and outgoing particles are synced with one another.

See also: SyncedPolarization, SyncedSpin, incoming_multiplicity, outgoing_multiplicity

source
QEDbase.incoming_multiplicityFunction
incoming_multiplicity(proc::AbstractProcessDefinition)

Return the number of spin and polarization combinations represented by procs incoming particles. This function only considers the incoming particles' spins and polarizations, returned by incoming_spin_pols for proc.

!!! note Incoming and Outgoing Spins/Polarizations Note that the total multiplicity is not necessarily the incoming and outgoing multiplicities multiplied. For the total process multiplicity, see multiplicity.

See also: SyncedPolarization, SyncedSpin, multiplicity, outgoing_multiplicity

source
QEDbase.outgoing_multiplicityFunction
outgoing_multiplicity(proc::AbstractProcessDefinition)

Return the number of spin and polarization combinations represented by procs outgoing particles. This function only considers the outgoing particles' spins and polarizations, returned by outgoing_spin_pols for proc.

!!! note Incoming and Outgoing Spins/Polarizations Note that the total multiplicity is not necessarily the incoming and outgoing multiplicities multiplied. For the total process multiplicity, see multiplicity.

See also: SyncedPolarization, SyncedSpin, multiplicity, incoming_multiplicity

source