QEDjl-project / QEDcore.jl

[WIP] Core types and functions for QED.jl
MIT License
0 stars 3 forks source link

Too restrictive typing (Float64) #20

Open tjungni opened 7 months ago

tjungni commented 7 months ago

Many functions currently expect arguments to be Float64 instead of Real. Constants will ideally be defined as irrationals so they don't force type promotions in calculations with other values. For example,

function OutgoingFermionSpinor(
    mom::T, mass::Float64
) where {T<:AbstractLorentzVector{TE}} where {TE<:Real}
    return OutgoingFermionSpinor(_build_particle_booster(mom, mass))
end

expects the mass to be Float64 but I defined the electron mass as an irrational constant in my code and tried to pass that as mass.