-
Notifications
You must be signed in to change notification settings - Fork 25
Split ThreeFlavorDecoherence
#385
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
base: main
Are you sure you want to change the base?
Conversation
Renamed ThreeFlavorDecoherence to Equilibrate.
Added ThreeFlavorDecoherence class.
Added Equilibrate and ThreeFlavorDecoherence to autoclass lists
|
|
I like the idea of this splitting! But as a user I would find a class name |
I missed some consequences of the changes. It looks like the dictionaries in snowglobes.py are having problems.
It's subtle. Equilibrate != ThreeFlavorDecoherence if in_vacuum != None in a TransformationChain object. Both are useful.
I don't think a 'black box' version of TwoFlavorDecoherence adds anything useful. It is almost the same as the CompleteExchange prescription. |
Let's change it to Equilibration or FlavorEquilibration then. |
I changed i to FlavorEquilibration |
Revert accidental input
|
Fixed a merge conflict with the |
But the (I understand they are different from the |
| def P_mf(self, t, E): | ||
| @FlavorMatrix.from_function(ThreeFlavor) | ||
| def P(f1, f2): | ||
| return (f1.is_neutrino == f2.is_neutrino)*1/3. | ||
| return P |
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.
This implementation seems to be just copied over from the flavor_transformation/__init__.py? Unfortunately, that doesn’t work. For one, the ThreeFlavor import from snewpy.flavor is missing in this file; but even if I add that, I get an error trying to use this:
import snewpy.flavor_transformation as ft
from snewpy.neutrino import MassHierarchy, MixingParameters
NMO = MixingParameters(MassHierarchy.NORMAL)
TFD = ft.ThreeFlavorDecoherence(NMO) # <- TransformationChain that uses `in_sn.ThreeFlavorDecoherence`
TFD.P_ff(0,0) # <- raises an AssertionError: Incompatible spaces <enum 'ThreeFlavor_MassBasis'>!=<enum 'ThreeFlavor'>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.
Full traceback:
>>> TFD.P_ff(0,0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TFD.P_ff(0,0)
~~~~~~~~^^^^^
File "/opt/miniconda3/envs/snewpy/lib/python3.13/site-packages/snewpy/flavor_transformation/TransformationChain.py", line 60, in P_ff
return self.transforms.in_earth.P_fm(t,E) @ \
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
self.transforms.in_vacuum.P_mm(t,E) @ \
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
self.transforms.in_sn.P_mf(t,E)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
File "/opt/miniconda3/envs/snewpy/lib/python3.13/site-packages/snewpy/flavor.py", line 197, in __matmul__
assert self.flavor_in==other.flavor_out, f"Incompatible spaces {self.flavor_in}!={other.flavor_out}"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Incompatible spaces <enum 'ThreeFlavor_MassBasis'>!=<enum 'ThreeFlavor'>
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 think I fixed this.
|
You're right, we don't need FlavorEquilibration. |
Fixed P_mf in ThreeFlavorDecoherence. Added FourFlavorDecoherence for fun
|
Thanks, I think that addresses all remaining issues. I just added a small fix for the corresponding unit test. |
Changes by @jpkneller to close #384. Should be merged after #351.
My review comments to follow in a bit …