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

Vectorize probabilities in FlavorTransformation #245

Open
Sheshuk opened this issue May 20, 2023 · 0 comments
Open

Vectorize probabilities in FlavorTransformation #245

Sheshuk opened this issue May 20, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Sheshuk
Copy link
Contributor

Sheshuk commented May 20, 2023

Currently FlavorTransformation.prob_ee and similar methods take time and energy as arguments.
These arguments can be arrays of values:

def prob_ex(self, t, E):
"""X -> e neutrino transition probability.
Parameters
----------
t : float or ndarray
List of times.
E : float or ndarray
List of energies.
Returns
-------
float or ndarray
Transition probability.

However the probabilities are often output as scalars, or as vectors only in E.

I suggest making the output universal: it should always be an array of shape (len(t), len(E)) (or scalar if both are scalars), even if the probability doesn't depend on E or t. This will make it easier for vectorized calculations, and more clear to the user.

@Sheshuk Sheshuk added the enhancement New feature or request label May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant