QEDjl-project / QEDcore.jl

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

Export _momentum_type #31

Open szabo137 opened 5 days ago

szabo137 commented 5 days ago

The function _momentum_type is sometimes used to get the scalar element type, e.g. to produce the correctly typed nil using zero. Therefore, it would be good to make it publicly available.

https://github.com/QEDjl-project/QEDcore.jl/blob/56f24440246a878ecd83514195c12ed4c217eef5/src/phase_spaces/utility.jl#L118

szabo137 commented 5 days ago

One could also make momentum_type an interface function for AbstractPhaseSpacePoints.

Alternatively, one could require the implementation of Base.eltype for subtypes of AbstractPhaseSpacePoints, i.e. making this part of the interface.