ComPWA / expertsystem

Rule based particle reaction problem solver on a quantum number level
http://expertsystem.rtfd.io
1 stars 3 forks source link

Allow user to modify width in mass conservation rule #355

Closed Leongrim closed 3 years ago

Leongrim commented 4 years ago

I noticed that the expertsystem uses a 5*width as a boundary condition for the resonances that are outside of the phase space. Here is the MassConservation defined for a node:

https://github.com/ComPWA/expertsystem/blob/74cb82821d6bcea9a84f6a70216be0abca268388/expertsystem/reaction/_default_settings.py#L159

The questions are:

  1. Is 5* width reasonable

  2. Is there a (easy) way to change it? I remember that there was a way in ComPWA but I can't recall. If there is a way it should be mentioned in the tutorials and if not that it should be implemented.

Leongrim commented 4 years ago

For me it seems that you only can turn the mass conservation on or of by editing the default interaction settings.

redeboer commented 4 years ago

Good point!

  1. Is 5* width reasonable

Seems too wide indeed, better go for 3.

  1. Is there a (easy) way to change it? I remember that there was a way in ComPWA but I can't recall. If there is a way it should be mentioned in the tutorials and if not that it should be implemented.

Indeed seems that there is no way to change this behaviour without touching the source code. In addition, in the STM, whether or not to use mass conservation (bit different issue) is determined from the number of initial states:

https://github.com/ComPWA/expertsystem/blob/57457f187482a0df0eb43e54fe0ea807ba9e3440/expertsystem/reaction/__init__.py#L148-L151

For me it seems that you only can turn the mass conservation on or of by editing the default interaction settings.

Yep afaik that's true... See also #169

spflueger commented 4 years ago

I noticed that the expertsystem uses a 5*width as a boundary condition for the resonances that are outside of the phase space. Here is the MassConservation defined for a node:

https://github.com/ComPWA/expertsystem/blob/74cb82821d6bcea9a84f6a70216be0abca268388/expertsystem/reaction/_default_settings.py#L159

The questions are:

  1. Is 5* width reasonable

As a default I tried to choose a less limiting factor, and rather give the user the option to "narrow" it down.

  1. Is there a (easy) way to change it? I remember that there was a way in ComPWA but I can't recall. If there is a way it should be mentioned in the tutorials and if not that it should be implemented.

Unfortunately there is currently no nice UI for modifying the prepared graphs that go into the solving process. My goal was to have some module (collection of functions etc) that would allow to easily modify the output the StateTransitionManager.prepare_graphs() returns. @redeboer, @Leongrim any thoughts on how this UI should look like?

To work around this now, you can either modify the code or write some function that would swap out the MassConservation rules on your nodes with a new MassConservation(3) rule.

spflueger commented 4 years ago

The general UI discussion should be moved to #169