-
Notifications
You must be signed in to change notification settings - Fork 3
Extract quantum state related classes from Particle #127
Comments
So, design problem:
|
To summarize, we need to figure out first:
Note: Using dataclasses might be an option (requires python 3.7). Otherwise normal classes work (more code) |
Internally the solvers would gradually be building up a State, which would later be upgraded to a Particle. |
So far, we assumed immutable. Take for example the spin property: we chose
We have to compose if we want to use the |
Alternative: keep You can then still define a |
It feels like we are missing a piece here. So that a fully defined particle state (with spin projections and everything) is different from lets say particle properties (which just define some static attributes of a particle). The dynamic content of a fully defined particle state comes from the "State" then. Note that this is just some brainstorm idea, but the basic idea would be to introduce some third component. |
Sounds not bad, but we are still missing a piece. We need some data structure which holds a fully defined state (with spin projections a complex energy position) |
It's hard to combine the fact that:
In that sense, the internal |
As for the dynamically hiding info in conservation rule function calls (the stackoverflow question), is it okay to pass around state attributes that aren't really used? (memory footprint) |
Ok, so let me propose this possible solution (naming could be improved):
|
I'm not sure what you mean. So in order to have static typing support and only give access to the necessary information within each rule, I would use the following design. Define a custom immutable data structure as input for each rule which only contains the necessary info. A function in the decorator would reduce the full State info to the one required by the rule. The solvers would work with States and hand them to the decorated rules. |
That puts it perfectly: a
Is this specific only to the graph module (that is, edge properties)?
...while this is specific to conservation rules? |
Both
See comment above. I also forgot to mention here, that this would be data structure we would use in the |
I still don't really understand the difference between |
I modified my comment above to clarify. But as a concrete example:
In that sense a |
So it's like class ComplexEnergyState
mass: float = 1.2,
width: float = 0.1,
quantum_numbers=State(
charge=0,
parity=+1,
spin=Spin(1, 1),
)
... ? |
I also still don't really understand this. If it is |
correct (composition or inheritance aside) |
But why split up that class? (Mass conservation rule?) |
It would not solely be used in the |
Ok, let me clarify. The mass (or more precisely complex energy) is strictly speaking not relevant to figure out if a physical solution exists to a specific problem (e.g.: J/Psi -> gamma pi0 pi0). You can imagine if you would be the first person studying this decay, you do not know what intermediate states to expect. The expert system will inform you though, that based on quantum mechanics only certain combinations of quantum numbers are possible (in the pi0 pi0 Subsystem f0, f2, f4, ... in case of strong interactions). Based on that information you would construct some "new" particles with J^{PC} = 0^{++} and 2^{++} etc and put that into your amplitude model to see if they actually exist in nature. |
#127 (comment) |
Particle
Particle
Particle
Closes #127 * build!: remove Python 3.6 support * refactor!: use dataclass instead of NamedTuple WARNING: removes sphinx-autodoc-typehints! #149 * refactor: distinguish spin with/without projection * feat: add ComplexEnergyState and QuantumState * feat: add dict_to_spin methods * docs: add supported Python badges https://shields.io/category/platform-support Co-authored-by: Stefan Pflueger <[email protected]>
Particle
Currently, a
Particle
is just a source of truth, while in the eventual graph, we need to work with quantum numbers only (that is, we are not interested in PID and name).The aim (#127 (comment)):
Particle
- statically defines particle info from in the PDG [immutable]QuantumState
- dynamically defines a set of quantum numbers (used ingraph
,solvers
, andconservation_rules
) [immutable or mutable]ComplexEnergyState
- statically defines a fully defined particle state [immutable]Used for 'mass and width' (that is, pole position) and therefore eventually ends up in the amplitude model.
The text was updated successfully, but these errors were encountered: