-
Notifications
You must be signed in to change notification settings - Fork 17
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
add MixingParameters
presets
#198
Conversation
Add NuFIT5.1 and PDG2022 mixing parameter values. For now, the default remains NuFIT5.0.
The test failure is fixed in #207. |
NuFIT5.1 parameters were never shipped in a SNEWPY release, so don’t need to keep them around
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a version in the parameter into the constructor doesn't seem right to me. This way we'll have to expand the definition each time new version is available, changing the class.
What I think would be cleaner is:
- Use the
dataclass
decorator (MixingParameters
class is basically a data container). It will provide a nice constructor, where wwe can pass all the values separately. - For each NUFIT version make the objects of the
MixingParameters
class, so it would be available when you import these parameters, something like:
from snewpy.neutrino import pars_NuFIT_5_2
- Pass these parameters as object to where they are used (
FlavorTransformations
)
If you agree, I can commit this implementation
Re: 3., see my comment here. But I think that’s just a slight annoyance and not a reason to avoid dataclasses; so yes, please go ahead! |
Um, in the mixing parameters we have I did So maybe we can just name them Another option would be to have separate classes for NH and IH, but I'd prefer otherwise |
Or |
Careful, it’s even trickier: NuFIT gives I guess in principle, if we know |
Since |
If I have to pick, I would prefer dm32_2 over dm31_2. Even better would be to have all three available although that might open the possibility that a user could assign values that were not self consistent. |
I implemented the class to hold all dm_2, and calculate the missing ones (passed as None), also I added validation after the constructor, that the proper sum of dm_2 is zero. @JostMigenda in your presets I see values of dm32 for NH and dm31 for IH, but I suppose it should be vice versa? Because on NuFIT site I read:
So probably I should correct this in the test? |
python/snewpy/neutrino.py
Outdated
def get_mass_square_differences(self): | ||
"""Mass squared differences . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope I’m not bike-shedding too badly here, but since the function name and docstring use two different spellings: I have a feeling “mass squared difference” (with the extra d in “squared”) is more common; so would prefer to rename the function accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My English can be really bad sometimes, so I agree to whatever you decide here (and please feel free to check and correct my naming/docstrings).
But this part I just copied from @jpkneller implementation in #189 - I thought it would make sense to put in this PR.
I'll use mass_squared_difference
Good catch about the 31/32 mixup, thanks! I think the |
Okay, I've added the needed parameters. pars_3f = MixingParameters() #standard 3flavor mixing
pars_4f = MixingParameters4Flavor(**pars_3f, theta14=90<<u.deg, dm41_2=1<<u.GeV**2) |
Co-authored-by: Jost Migenda <jost.migenda@kcl.ac.uk>
theta14: u.Quantity[u.deg] = 0<<u.deg | ||
theta24: u.Quantity[u.deg] = 0<<u.deg | ||
theta34: u.Quantity[u.deg] = 0<<u.deg | ||
#sterile neutrino mass squared differences |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why setting them to zero instead of being an input parameter the user can give?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is marked as a dataclass, which automatically generates a __init__
function to set them as input parameters. The value defined here is used as the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as Jost said zeros will be default parameters in the constructor. So by default there is no mixing with sterile neutrinos, and only if user provides the mixing angles in the constructor, e.g.:
params4f = MixingParameters4Flavor(**params3f, theta24=45<<u.deg)
there will be an effect of sterile neutrinos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh right, I missed it in that line. Looks good then!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new way to handle the versions for the oscillation parameters!
Minor comment: is there a reason to have NuFit5.0 and 5.2 but not 5.1 version?
We keep 5.0 as the initial value (for backwards compatibility) and 5.2 as the most up-to-date value. I don’t think there is a reason to newly add an outdated version. |
I worked on this PR after my first review, so it's obsolete, and needs approval from others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready to be merged
Closes #195.
In addition to the NuFIT5.0 values, this PR adds NuFIT5.1 and PDG2022 mixing parameter values and an optional argument to select which version of the parameters to use. In the initial commit, the default remains
NuFIT5.0
. In an upcoming commit, I will explicitly set the version in any tests that depend on this, so tests don’t start to fail once we change the default to a more recent version of the parameters.