Skip to content
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

Need to widen to <:Number to work with Dual number auto diff #10

Open
Moelf opened this issue Jul 26, 2023 · 2 comments
Open

Need to widen to <:Number to work with Dual number auto diff #10

Moelf opened this issue Jul 26, 2023 · 2 comments

Comments

@Moelf
Copy link
Contributor

Moelf commented Jul 26, 2023

struct SpatialVector{T <: AbstractFloat}

@JLTastet
Copy link
Owner

JLTastet commented Aug 24, 2023

Thanks for the suggestion! That indeed sounds like a good use case.

However, changing AbstractFloat to Number could allow LorentzVectors to be constructed from integers. Do you know if there is an abstract type for real numbers?

Alternatively, we could add a special constructor for integers, that throws an error when called.
EDIT: I am already doing that with a converting constructor. Actually, maybe some of the changes from my loose-typing and complex branches could be merged. There is actually a strong use case for using non-scalar types like (Pauli) matrices as the element type of a LorentzVector, as long as this type is closed under a Lorentz transformation.

@Moelf
Copy link
Contributor Author

Moelf commented Aug 24, 2023

I wouldn't worry too much about that aspect; programmers need to know the computer number types and their limitations when they do it anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants