vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
982 stars 118 forks source link

A vector can be replaced by array[1] #352

Open pramod-pixel opened 4 years ago

pramod-pixel commented 4 years ago

I want my output expression in which parameters are in form of arrays. like px1 (xth component of particle 1) as px[1]. Since "[ ]" is preserved for "set" in FORM, so compiler shows px[1] as "unknown object". Is there any possibility to solve this issue?

vermaseren commented 4 years ago

You can have a look at the dictionaries in Form. Maybe that is sufficient for what you want. It gives a lot of control over output representations.

Jos

On 16 Jun 2020, at 11:10, pramod-pixel notifications@github.com wrote:

I want my output expression in which parameters are in form of arrays. like px1 (xth component of particle 1) as px[1]. Since "[ ]" is preserved for "set" in FORM, so compiler shows px[1] as "unknown object". Is there any possibility to solve this issue?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vermaseren/form/issues/352, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPCEXRGVGKQRQC46YAJRDRW4ZHHANCNFSM4N7NL2LA.

tueda commented 4 years ago

Perhaps the easiest way is to define a temporary variable in your C code (I assume you are using C).

double px1 = px[1];

Your compiler can easily optimize out such a temporary variable.