-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add phase integrals #59
base: dev
Are you sure you want to change the base?
Add phase integrals #59
Conversation
@steindev Can you please rebase. Otherwise the CI does not work. |
…ion notes + documentation
b06a255
to
6d95340
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some comments from my side. I can't say much about the physics going on.
``` | ||
where ``A^\\mu(\\varphi)`` is the background field, ``G(\\varphi,p, p^\\prime)`` is the [`phase function`](@ref), ``(p,p^\\prime)`` the given phase space point, and ``l`` the photon number parameter. | ||
""" | ||
function computeB1 end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually use snake_case for function names, so this should probably be compute_B1
""" | ||
Abstract base type for defining a method for phase integral computation. | ||
""" | ||
abstract type Method end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the type/struct/function definition (or something close that gets the idea across) in the docs too.
""" | |
Abstract base type for defining a method for phase integral computation. | |
""" | |
abstract type Method end | |
""" | |
abstract type Method end | |
Abstract base type for defining a method for phase integral computation. | |
""" | |
abstract type Method end |
Also I'm not sure if the names Method
and Analytic
are a bit too unspecialized.
""" | ||
Analytic method for phase integral computation. | ||
|
||
Requires an existing implementation of analytic formulas for computing the | ||
entities in the phase integrals. | ||
""" | ||
struct Analytic <: Method end | ||
|
||
""" | ||
Fully numerical method for phase integral computation based on QuadGK. | ||
""" | ||
struct QuadGK <: Method end | ||
|
||
""" | ||
Struct holding setup specific information to compute phase integrals. | ||
|
||
ToDo: We mix physical and numerical aspects in this class. | ||
This does not seem ideal to me (Klaus). | ||
""" | ||
struct PhaseIntegral{P<:AbstractPulsedPlaneWaveField, M<:Method} | ||
pulse::P | ||
method::M | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is implementation-related and should not go into the interfaces directory.
# from QEDprocesses.jl/src/constants.jl | ||
# TODO: we might want to move the constants.jl file to QEDbase? See also TODO in QEDprocesses.jl/src/processes/one_photon_compton/perturbative/cross_section.jl | ||
const ALPHA = inv(137.035999074) | ||
const ELEMENTARY_CHARGE = sqrt(4 * pi * ALPHA) | ||
const ELEMENTARY_CHARGE_SQUARE = 4 * pi * ALPHA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but I think QEDcore would be a better place instead of QEDbase.
# definite integral of PPW field | ||
# TODO: Why does integration always start at 0? | ||
@inline function _field_integral( | ||
field::AbstractPulsedPlaneWaveField, | ||
pol::AbstractPolarization, | ||
phi::T | ||
) where {T<:Real} | ||
return quadgk(t -> amplitude(field, pol, t), 0.0, phi)[1] | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these functions take a Method
?
# definite integral of PPW field | |
# TODO: Why does integration always start at 0? | |
@inline function _field_integral( | |
field::AbstractPulsedPlaneWaveField, | |
pol::AbstractPolarization, | |
phi::T | |
) where {T<:Real} | |
return quadgk(t -> amplitude(field, pol, t), 0.0, phi)[1] | |
end | |
# definite integral of PPW field | |
# TODO: Why does integration always start at 0? | |
@inline function _field_integral( | |
::QuadGK, | |
field::AbstractPulsedPlaneWaveField, | |
pol::AbstractPolarization, | |
phi::T | |
) where {T<:Real} | |
return quadgk(t -> amplitude(field, pol, t), 0.0, phi)[1] | |
end |
include("zeroth_integral.jl") | ||
include("first_integral.jl") | ||
include("second_integral.jl") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the coding guidelines, we only use includes at the top-level, so these includes should be moved to the QEDfields.jl file.
ToDo: We mix physical and numerical aspects in this class. | ||
This does not seem ideal to me (Klaus). | ||
""" | ||
struct PhaseIntegral{P<:AbstractPulsedPlaneWaveField, M<:Method} | ||
pulse::P | ||
method::M | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem like a problem to me necessarily, at least there shouldn't be any overhead since method
is only a singleton.
This struct is intended to become the main part for user-facing functions? In this case we should think about which (if any) parts of the functionality of the plane wave fields and the methods can be implemented as orthogonal interfaces.
Phase integrals are required to compute cross-sections in background fields. Integrals are defined in @szabo137's thesis eqs. (2.51)-(2.53).
Envisaged usage is as follows
S
which consists of a pulse envelope (shape and width/duration)M
used to compute the integrals (analytic, numeric)then computing the integrals depends on the chosen direction (of polarization/observation)
pol
, the background intensitya0
, the photon number parameterl
, and the kinematic factorsalpha
The parameters
pol
,a0
, ... are defined somewhere else, i.e. previously in the cross-section computation and outside QEDfields.jl.