Many implementations of numerical objects restrict the type of their inner scalar to float64. This can be too restrictive and may cause bugs, which are hard to trace back.
Suggested solution
I suggest parameterizing the respective types (see below) and using Real or Number as the upper bound for the type parameter.
Conveniently, we should implement versions of Base.convert and Base.promote_type, so bugs caused by mismatching numeric types are suppressed.
Types to be updated
[ ] DiracMatrix
[ ] BiSpinor
[ ] AdjointBiSpinor
[ ] SFourMomentum
[ ] MFourMomentum
Additional todos
[ ] unit tests should include checks for Float64 and Float32
[ ] unit test to check if Lorentz boosts preserve the element type
Problem statement
Many implementations of numerical objects restrict the type of their inner scalar to float64. This can be too restrictive and may cause bugs, which are hard to trace back.
Suggested solution
I suggest parameterizing the respective types (see below) and using
Real
orNumber
as the upper bound for the type parameter. Conveniently, we should implement versions ofBase.convert
andBase.promote_type
, so bugs caused by mismatching numeric types are suppressed.Types to be updated
DiracMatrix
BiSpinor
AdjointBiSpinor
SFourMomentum
MFourMomentum
Additional todos
Float64
andFloat32