-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds the functionality from QEDprocesses again which was temporarily removed from #6 / #23 to have a working state. Must be merged after QEDbase is released with the new interfaces from QEDprocesses.
- Loading branch information
Showing
24 changed files
with
1,821 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
[deps] | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
QEDbase = "10e22c08-3ccb-4172-bfcf-7d7aa3d04d93" | ||
QEDcore = "35dc0263-cb5f-4c33-a114-1d7f54ab753e" | ||
QEDprocesses = "46de9c38-1bb3-4547-a1ec-da24d767fdad" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import QEDbase: propagator | ||
|
||
function _scalar_propagator(K::QEDbase.AbstractFourMomentum, mass::Real) | ||
return one(mass) / (K * K - mass^2) | ||
end | ||
|
||
function _scalar_propagator(K::QEDbase.AbstractFourMomentum) | ||
return one(getT(K)) / (K * K) | ||
end | ||
|
||
function _fermion_propagator(P::QEDbase.AbstractFourMomentum, mass::Real) | ||
return (slashed(P) + mass * one(DiracMatrix)) * _scalar_propagator(P, mass) | ||
end | ||
|
||
function _fermion_propagator(P::QEDbase.AbstractFourMomentum) | ||
return (slashed(P)) * _scalar_propagator(P) | ||
end | ||
|
||
function QEDbase.propagator(particle_type::BosonLike, K::QEDbase.AbstractFourMomentum) | ||
return _scalar_propagator(K, QEDbase.mass(particle_type)) | ||
end | ||
|
||
function QEDbase.propagator(particle_type::Photon, K::QEDbase.AbstractFourMomentum) | ||
return _scalar_propagator(K) | ||
end | ||
|
||
function QEDbase.propagator(particle_type::FermionLike, P::QEDbase.AbstractFourMomentum) | ||
return _fermion_propagator(P, QEDbase.mass(particle_type)) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# accessor interface particle stateful | ||
QEDbase.particle_direction(part::ParticleStateful) = part.dir | ||
QEDbase.particle_species(part::ParticleStateful) = part.species | ||
QEDbase.momentum(part::ParticleStateful) = part.mom | ||
|
||
# accessor interface phase space point | ||
""" | ||
Base.getindex(psp::PhaseSpacePoint, dir::Incoming, n::Int) | ||
Overload for the array indexing operator `[]`. Returns the nth incoming particle in this phase space point. | ||
""" | ||
function Base.getindex(psp::PhaseSpacePoint, ::QEDbase.Incoming, n::Int) | ||
return psp.in_particles[n] | ||
end | ||
|
||
""" | ||
Base.getindex(psp::PhaseSpacePoint, dir::Outgoing, n::Int) | ||
Overload for the array indexing operator `[]`. Returns the nth outgoing particle in this phase space point. | ||
""" | ||
function Base.getindex(psp::PhaseSpacePoint, ::QEDbase.Outgoing, n::Int) | ||
return psp.out_particles[n] | ||
end | ||
|
||
QEDbase.process(psp::PhaseSpacePoint) = psp.proc | ||
QEDbase.model(psp::PhaseSpacePoint) = psp.model | ||
QEDbase.phase_space_definition(psp::PhaseSpacePoint) = psp.ps_def | ||
|
||
QEDbase.particles(psp::PhaseSpacePoint, ::QEDbase.Incoming) = psp.in_particles | ||
QEDbase.particles(psp::PhaseSpacePoint, ::QEDbase.Outgoing) = psp.out_particles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
# PSP constructors from particle statefuls | ||
|
||
""" | ||
InPhaseSpacePoint( | ||
proc::QEDbase.AbstractProcessDefinition, | ||
model::QEDbase.AbstractModelDefinition, | ||
ps_def::QEDbase.AbstractPhasespaceDefinition, | ||
in_ps::Tuple{ParticleStateful}, | ||
) | ||
Construct a [`PhaseSpacePoint`](@ref) with only input particles from [`ParticleStateful`](@ref)s. The result will be `<: InPhaseSpacePoint` but **not** `<: OutPhaseSpacePoint`. | ||
""" | ||
function InPhaseSpacePoint( | ||
proc::PROC, model::MODEL, ps_def::PSDEF, in_ps::IN_PARTICLES | ||
) where { | ||
PROC<:QEDbase.AbstractProcessDefinition, | ||
MODEL<:QEDbase.AbstractModelDefinition, | ||
PSDEF<:QEDbase.AbstractPhasespaceDefinition, | ||
IN_PARTICLES<:Tuple{Vararg{ParticleStateful}}, | ||
} | ||
return PhaseSpacePoint(proc, model, ps_def, in_ps, ()) | ||
end | ||
|
||
""" | ||
OutPhaseSpacePoint( | ||
proc::QEDbase.AbstractProcessDefinition, | ||
model::QEDbase.AbstractModelDefinition, | ||
ps_def::QEDbase.AbstractPhasespaceDefinition, | ||
out_ps::Tuple{ParticleStateful}, | ||
) | ||
Construct a [`PhaseSpacePoint`](@ref) with only output particles from [`ParticleStateful`](@ref)s. The result will be `<: OutPhaseSpacePoint` but **not** `<: InPhaseSpacePoint`. | ||
""" | ||
function OutPhaseSpacePoint( | ||
proc::PROC, model::MODEL, ps_def::PSDEF, out_ps::OUT_PARTICLES | ||
) where { | ||
PROC<:QEDbase.AbstractProcessDefinition, | ||
MODEL<:QEDbase.AbstractModelDefinition, | ||
PSDEF<:QEDbase.AbstractPhasespaceDefinition, | ||
OUT_PARTICLES<:Tuple{Vararg{ParticleStateful}}, | ||
} | ||
return PhaseSpacePoint(proc, model, ps_def, (), out_ps) | ||
end | ||
|
||
# PSP constructors from momenta | ||
|
||
""" | ||
PhaseSpacePoint( | ||
proc::QEDbase.AbstractProcessDefinition, | ||
model::QEDbase.AbstractModelDefinition, | ||
ps_def::QEDbase.AbstractPhasespaceDefinition, | ||
in_momenta::NTuple{N,QEDbase.AbstractFourMomentum}, | ||
out_momenta::NTuple{M,QEDbase.AbstractFourMomentum}, | ||
) | ||
Construct the phase space point from given momenta of incoming and outgoing particles regarding a given process. | ||
""" | ||
function PhaseSpacePoint( | ||
proc::QEDbase.AbstractProcessDefinition, | ||
model::QEDbase.AbstractModelDefinition, | ||
ps_def::QEDbase.AbstractPhasespaceDefinition, | ||
in_momenta::NTuple{N,ELEMENT}, | ||
out_momenta::NTuple{M,ELEMENT}, | ||
) where {N,M,ELEMENT<:QEDbase.AbstractFourMomentum} | ||
in_particles = _build_particle_statefuls(proc, in_momenta, QEDbase.Incoming()) | ||
out_particles = _build_particle_statefuls(proc, out_momenta, QEDbase.Outgoing()) | ||
|
||
return PhaseSpacePoint(proc, model, ps_def, in_particles, out_particles) | ||
end | ||
|
||
""" | ||
InPhaseSpacePoint( | ||
proc::QEDbase.AbstractProcessDefinition, | ||
model::QEDbase.AbstractModelDefinition, | ||
ps_def::QEDbase.AbstractPhasespaceDefinition, | ||
in_momenta::NTuple{N,QEDbase.AbstractFourMomentum}, | ||
) | ||
Construct a [`PhaseSpacePoint`](@ref) with only input particles from given momenta. The result will be `<: InPhaseSpacePoint` but **not** `<: OutPhaseSpacePoint`. | ||
""" | ||
function InPhaseSpacePoint( | ||
proc::QEDbase.AbstractProcessDefinition, | ||
model::QEDbase.AbstractModelDefinition, | ||
ps_def::QEDbase.AbstractPhasespaceDefinition, | ||
in_momenta::NTuple{N,ELEMENT}, | ||
) where {N,ELEMENT<:QEDbase.AbstractFourMomentum} | ||
in_particles = _build_particle_statefuls(proc, in_momenta, QEDbase.Incoming()) | ||
|
||
return PhaseSpacePoint(proc, model, ps_def, in_particles, ()) | ||
end | ||
|
||
""" | ||
OutPhaseSpacePoint( | ||
proc::QEDbase.AbstractProcessDefinition, | ||
model::QEDbase.AbstractModelDefinition, | ||
ps_def::QEDbase.AbstractPhasespaceDefinition, | ||
out_momenta::NTuple{N,QEDbase.AbstractFourMomentum}, | ||
) | ||
Construct a [`PhaseSpacePoint`](@ref) with only output particles from given momenta. The result will be `<: OutPhaseSpacePoint` but **not** `<: InPhaseSpacePoint`. | ||
""" | ||
function OutPhaseSpacePoint( | ||
proc::QEDbase.AbstractProcessDefinition, | ||
model::QEDbase.AbstractModelDefinition, | ||
ps_def::QEDbase.AbstractPhasespaceDefinition, | ||
out_momenta::NTuple{N,ELEMENT}, | ||
) where {N,ELEMENT<:QEDbase.AbstractFourMomentum} | ||
out_particles = _build_particle_statefuls(proc, out_momenta, QEDbase.Outgoing()) | ||
|
||
return PhaseSpacePoint(proc, model, ps_def, (), out_particles) | ||
end | ||
|
||
# PSP constructors from coordinates | ||
|
||
""" | ||
PhaseSpacePoint( | ||
proc::QEDbase.AbstractProcessDefinition, | ||
model::QEDbase.AbstractModelDefinition, | ||
ps_def::QEDbase.AbstractPhasespaceDefinition, | ||
in_coords::NTuple{N,Real}, | ||
out_coords::NTuple{M,Real}, | ||
) | ||
Construct a [`PhaseSpacePoint`](@ref) from given coordinates by using the `QEDbase._generate_momenta` interface. | ||
""" | ||
function PhaseSpacePoint( | ||
proc::QEDbase.AbstractProcessDefinition, | ||
model::QEDbase.AbstractModelDefinition, | ||
ps_def::QEDbase.AbstractPhasespaceDefinition, | ||
in_coords::NTuple{N,Real}, | ||
out_coords::NTuple{M,Real}, | ||
) where {N,M} | ||
in_ps, out_ps = _generate_momenta(proc, model, ps_def, in_coords, out_coords) | ||
return PhaseSpacePoint(proc, model, ps_def, in_ps, out_ps) | ||
end | ||
|
||
""" | ||
InPhaseSpacePoint( | ||
proc::QEDbase.AbstractProcessDefinition, | ||
model::QEDbase.AbstractModelDefinition, | ||
ps_def::QEDbase.AbstractPhasespaceDefinition, | ||
in_coords::NTuple{N,Real}, | ||
) | ||
Construct a [`PhaseSpacePoint`](@ref) from given coordinates by using the `QEDbase._generate_momenta` interface. The result will be `<: InPhaseSpacePoint` but **not** `<: OutPhaseSpacePoint`. | ||
!!! note | ||
A similar function for [`OutPhaseSpacePoint`](@ref) does not exist from coordinates, only a full [`PhaseSpacePoint`](@ref). | ||
""" | ||
function InPhaseSpacePoint( | ||
proc::QEDbase.AbstractProcessDefinition, | ||
model::QEDbase.AbstractModelDefinition, | ||
ps_def::QEDbase.AbstractPhasespaceDefinition, | ||
in_coords::NTuple{N,Real}, | ||
) where {N} | ||
in_ps = _generate_incoming_momenta(proc, model, ps_def, in_coords) | ||
return InPhaseSpacePoint(proc, model, ps_def, in_ps) | ||
end |
Oops, something went wrong.