Closed sybenzvi closed 5 days ago
Benchmark | Min | Max | Mean |
---|---|---|---|
python/snewpy/test/test_snowglobes.py::test_simulation_chain_benchmark | 4.18 | 4.29 | 4.24 +- 0.05 |
Comment about the guts of CompositeTransformation
: internally it performs matrix multiplication of the composed unitary transformations. The composite matrix is not supposed to be accessed by users, who should use the survival and transition probability functions prob_ee(t, E)
etc. provided by the base class. For efficiency, the calculation of the transformation matrix is memoized so that it is not recalculated for all transition probabilities unless the input time and energy arguments change.
On this topic, the following checks should be completed:
At first glance, this looks good to me; thanks! I would also suggest updating the FlavorTransformation.ipynb
to add an example for this composite transformation.
The idea is a good one but the present implementation of the flavor transformations in SNEWPY means that there are only limited circumstances where you can string together flavor transformations. The neutrinos would have to decohere between the transformations being applied and the only flavor transformation we have in SNEWPY which occurs outside the supernova is neutrino decay.
I checked the math and it turns out chaining together SNEWPY's flavor transformations cannot be done even if the previously mentioned restriction that the neutrinos decohere between transformations is valid. Attached is a proof. proof.pdf
Thanks for checking this and writing it up! If I understand correctly, there’s two different ways we could fix this:
self.De1
, self.De2
etc. in the __init__
function (as we already do for many of the existing transformations) and then use those in the calculation to compose flavour transformations.Either option should work. The second is the easiest and I know what to do. I haven't looked at how much of the code would have to change if we went to 6 flavors though it's something we said we'd do.
This PR is superseded by several other efforts to handle flavor transformations and is now obsolete. Closing without merging.
This PR is designed to address issue #183 by implementing a simple class to compose an arbitrary list of flavor transformations.
If instantiated as follows,
c = CompositeTransformation(U1, U2, ..., Un)
whereU1
,U2
, etc. are differentFlavorTransformation
objects, the class will apply the transformations in the order supplied to the CompositeTransformation. I.e.,U1
will be applied first, thenU2
, and so on toUn
.Unit tests need to be added to the branch before we proceed with the merger.