Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

ComPWA math language #226

Closed
spflueger opened this issue Oct 2, 2019 · 0 comments
Closed

ComPWA math language #226

spflueger opened this issue Oct 2, 2019 · 0 comments
Labels
💡 Enhancement New feature or improvement of existing code 💡 Maintenance Refactoring or redesign 🕔 Project Larger project that has to be addressed in several issues/PRs ❔ Question Discuss this matter in the team

Comments

@spflueger
Copy link
Member

spflueger commented Oct 2, 2019

I just note down this idea/concept for a possible improvement in the future. It might seem like a lot of work, but I think less then it seems and it can be done within 2-6 months (single person, experience dependent).

Current flaws in the design of ComPWA are:

  • All mathematical expressions (operators, function etc) have to be separately implemented in each evaluation/computation/calculation backend. This is not DRY and also way more error prone.
  • Consequently, if the user wants to implement a new model, he has to write c++ code for each of the calculation backends.
  • The extraction of components of a Function is currently not elegant, since they have to be extracted from the xml model file using a Builder class.
  • There might be more, but these are currently in my mind...

In my opinion the introduction of a ComPWA math language is able to solve all the above flaws very elegantly without introducting new flaws! You would express all of your mathematical calculations in this language. Each calculation backend has a single converter that converts a ComPWA math language expression into an Intensity or Estimator (Function interface).

Implementation details:

  • Use an existing, versatile and widely used Math markup language for example Content MathML. This has the advantage that the syntax is stable and calculations can easily be imported and exported to ComPWA.
  • Extend this language with special operators/function like a Breit Wigners and or labels to easily find tags (useful for component extraction). These special physics operations or functions are just new xml nodes that define a deeper structure. This has the advantage that the physics models are only defined once and can be used in all computation backends in the same way (single source of truth). Also the user is able to easily add new models, without having to touch any code!
  • Since this markup language is based on xml, the parsing and exporting is easily done with a third party library (like boost or pugixml)
  • These ComPWA MathML calculation objects are just handed around ComPWA until a calculation has to be performed. Then a converter (one for every calculation backend) translates this calculation object into an evaluatable c++ Function defined int the Core/Function.hpp interface.
@spflueger spflueger added ⚠️ Low ⚠️ Medium Status: Pending 💡 Enhancement New feature or improvement of existing code 💡 Maintenance Refactoring or redesign and removed ⚠️ Low ⚠️ Medium labels Oct 2, 2019
@redeboer redeboer added 🕔 Project Larger project that has to be addressed in several issues/PRs ❔ Question Discuss this matter in the team and removed 💡 Question labels Jun 20, 2020
@redeboer redeboer closed this as not planned Won't fix, can't repro, duplicate, stale Jan 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💡 Enhancement New feature or improvement of existing code 💡 Maintenance Refactoring or redesign 🕔 Project Larger project that has to be addressed in several issues/PRs ❔ Question Discuss this matter in the team
Projects
None yet
Development

No branches or pull requests

2 participants