Skip to content

Commit

Permalink
Remove interfaces and functionality that move (#74)
Browse files Browse the repository at this point in the history
The interfaces and functionality have moved to QEDbase and QEDcore.

---------

Co-authored-by: AntonReinhard <anton.reinhard@protonmail.com>
  • Loading branch information
AntonReinhard and AntonReinhard authored Jun 28, 2024
1 parent 9662bf3 commit 1b35375
Show file tree
Hide file tree
Showing 41 changed files with 166 additions and 2,034 deletions.
3 changes: 1 addition & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ julia = "1.6"
[extras]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Random", "SafeTestsets", "Suppressor", "Test"]
test = ["Random", "SafeTestsets", "Test"]
1 change: 0 additions & 1 deletion add_QEDcore_dev.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@

using Pkg: Pkg
Pkg.add(; url="https://github.com/QEDjl-project/QEDcore.jl", rev="dev")
#Pkg.add(; url="https://github.com/QEDjl-project/QEDbase.jl.git", rev="process_interfaces")
11 changes: 10 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
using QEDprocesses
using Pkg

# targeting the correct source code
# this asumes the make.jl script is located in QEDprocesses.jl/docs
project_path = Base.Filesystem.joinpath(Base.Filesystem.dirname(Base.source_path()), "..")
Pkg.develop(; path=project_path)
# temporarily necessary because processes used to have a compat that is gone after the `develop` above
Pkg.update()

using Documenter
using QEDprocesses

DocMeta.setdocmeta!(QEDprocesses, :DocTestSetup, :(using QEDprocesses); recursive=true)

Expand Down
63 changes: 14 additions & 49 deletions src/QEDprocesses.jl
Original file line number Diff line number Diff line change
@@ -1,81 +1,46 @@

# TODO: remove after refac
__precompile__(false)

module QEDprocesses

# constants
export ALPHA,
ALPHA_SQUARE, ELEMENTARY_CHARGE, ELEMENTARY_CHARGE_SQUARE, ELECTRONMASS, ONE_OVER_FOURPI

# Abstract model interface
export AbstractModelDefinition, fundamental_interaction_type
# propagator
export propagator

# Abstract process interface
export AbstractProcessDefinition, incoming_particles, outgoing_particles
export number_incoming_particles, number_outgoing_particles
export particles, number_particles
# specific compute models
export PerturbativeQED

# probabilities
export differential_probability, unsafe_differential_probability
export total_probability
# specific scattering processes
export Compton, omega_prime

# probabilities
export differential_probability, unsafe_differential_probability
export total_probability

# differential cross section
# differential cross sections
export differential_cross_section, unsafe_differential_cross_section
export total_cross_section

# Abstract setup interface
export AbstractComputationSetup, InvalidInputError, compute
export AbstractProcessSetup, scattering_process, physical_model

# propagator
export propagator

# phase space
export AbstractCoordinateSystem, SphericalCoordinateSystem
export AbstractFrameOfReference, CenterOfMomentumFrame, ElectronRestFrame
export AbstractPhasespaceDefinition, PhasespaceDefinition
export ParticleStateful, PhaseSpacePoint, InPhaseSpacePoint, OutPhaseSpacePoint
export spin, polarization, particle_direction, particle_species, momentum, momenta, getindex

# specific compute models
export PerturbativeQED

# specific scattering processes
export Compton, omega_prime

using QEDbase: QEDbase
using QEDbase
using QEDcore
using StaticArrays
using QuadGK

include("constants.jl")
include("utils.jl")

include("interfaces/model_interface.jl")
include("interfaces/process_interface.jl")
include("interfaces/setup_interface.jl")

include("phase_spaces/types.jl")
include("phase_spaces/access.jl")
include("phase_spaces/create.jl")
include("phase_spaces/print.jl")
include("phase_spaces/utility.jl")

include("momentum_generation.jl")
include("propagators.jl")

include("cross_section/diff_probability.jl")
include("cross_section/diff_cross_section.jl")
include("cross_section/total_probability.jl")
include("cross_section/total_cross_section.jl")

include("models/models.jl")
include("processes/one_photon_compton/one_photon_compton.jl")

# one photon compton
include("processes/one_photon_compton/process.jl")
include("processes/one_photon_compton/perturbative/kinematics.jl")
include("processes/one_photon_compton/perturbative/cross_section.jl")
include("processes/one_photon_compton/perturbative/total_probability.jl")

include("patch_QEDbase.jl")
end
6 changes: 3 additions & 3 deletions src/cross_section/diff_cross_section.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Return the differential cross section evaluated on a phase space point without checking if the given phase space is physical.
"""
function unsafe_differential_cross_section(phase_space_point::PhaseSpacePoint)
I = 1 / (4 * _incident_flux(phase_space_point))
I = 1 / (4 * QEDbase._incident_flux(phase_space_point))

return I * unsafe_differential_probability(phase_space_point)
end
Expand All @@ -22,8 +22,8 @@ end
If the given phase spaces are physical, return differential cross section evaluated on a phase space point. Zero otherwise.
"""
function differential_cross_section(phase_space_point::PhaseSpacePoint)
if !_is_in_phasespace(phase_space_point)
return zero(eltype(_momentum_type(phase_space_point)))
if !QEDbase._is_in_phasespace(phase_space_point)
return zero(eltype(QEDcore._momentum_type(phase_space_point)))
end

return unsafe_differential_cross_section(phase_space_point)
Expand Down
10 changes: 5 additions & 5 deletions src/cross_section/diff_probability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# convenience function
# can be overloaded if an analytical version is known
function _matrix_element_square(psp::PhaseSpacePoint)
mat_el = _matrix_element(psp)
mat_el = QEDbase._matrix_element(psp)
return abs2.(mat_el)
end

Expand All @@ -21,9 +21,9 @@ Return differential probability evaluated on a phase space point without checkin
function unsafe_differential_probability(psp::PhaseSpacePoint)
matrix_elements_sq = _matrix_element_square(psp)

normalization = _averaging_norm(psp.proc)
normalization = QEDbase._averaging_norm(psp.proc)

ps_fac = _phase_space_factor(psp)
ps_fac = QEDbase._phase_space_factor(psp)

return normalization * sum(matrix_elements_sq) * ps_fac
end
Expand All @@ -34,8 +34,8 @@ end
If the given phase spaces are physical, return differential probability evaluated on a phase space point. Zero otherwise.
"""
function differential_probability(phase_space_point::PhaseSpacePoint)
if !_is_in_phasespace(phase_space_point)
return zero(eltype(momentum(phase_space_point, QEDbase.Incoming(), 1)))
if !QEDbase._is_in_phasespace(phase_space_point)
return zero(eltype(momentum(phase_space_point, Incoming(), 1)))
end

return unsafe_differential_probability(phase_space_point)
Expand Down
6 changes: 3 additions & 3 deletions src/cross_section/total_cross_section.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"""
total_cross_section(in_psp::InPhaseSpacePoint)
Return the total cross section for a given [`InPhaseSpacePoint`](@ref).
Return the total cross section for a given `QEDcore.InPhaseSpacePoint`.
"""
function total_cross_section(in_psp::InPhaseSpacePoint)
I = 1 / (4 * _incident_flux(in_psp))
return I * _total_probability(in_psp)
I = 1 / (4 * QEDbase._incident_flux(in_psp))
return I * QEDbase._total_probability(in_psp)
end
4 changes: 2 additions & 2 deletions src/cross_section/total_probability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"""
total_probability(in_psp::InPhaseSpacePoint)
Return the total probability of a given [`InPhaseSpacePoint`](@ref).
Return the total probability of a given `QEDcore.InPhaseSpacePoint`.
"""
function total_probability(in_psp::InPhaseSpacePoint)
return _total_probability(in_psp)
return QEDbase._total_probability(in_psp)
end
27 changes: 0 additions & 27 deletions src/interfaces/model_interface.jl

This file was deleted.

Loading

0 comments on commit 1b35375

Please sign in to comment.