Open mmikhasenko opened 1 week ago
"expression": "sqrt(sqrt(m_12_sq)) / (m_rho^2 - m_12_sq - 1im * m_rho * Gamma_rho)",
I'd know how to generate it in julia
The difficulty is that this expression string is not (afaik) following a common mathematical markup standard, so I expect that for any language, you will need to write your own parser.
This example string follows ROOT's TFormula
, right? Do you know if ROOT is following some common math markup standard? Or if the ROOT team has defined a format specification?
A requirement may also be to allow for nested definitions. In this case, that you can write e.g. my_func(m_rho, Gamma_rho, Gamma_rho)
. But that requires defining function argument order etc (so that you can insert other parameter names).
Why it does not follow? I do not know the standards, but would expect that a simple expression with * and / works in any standard
Why it does not follow?
I guess the example follows TFormula
(but it's a simple example with sqrt
, /
, *
, and -
operators only). What I mean is, does ROOT provide a mathematics markup standard? Like, if I write a parser, should I use ^
or **
for power operators? Or both? And are there standalone (Julia,C++,Python) libraries that can parse and unparse?
Well, I do not use TFormula and do not think of ROOT.
In Julia it's Meta.parse
In python, I'd use parse_expr
That means the expression string is limited to the intersection of Python and Julia syntax?
There are possible manipulations that you can do with the string before parsing, so I would say no limitations
Base on a few recent discussions, I am getting convinced that construction of the generic functions is the key feature that will be unitized extensively.
We want to make it nice and convenient. One step toward it would be introduction of named parameters to the generic functions
https://github.com/RUB-EP1/amplitude-serialization/blob/main/models/x2pipipi-compass-1391643.json#L988-L992
becomes
I'd know how to generate it in julia