vermaseren / form

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

non-commuting issue with partitions_() #327

Open crmafra opened 4 years ago

crmafra commented 4 years ago

The following code is partitioning the arguments without respecting the ordering of the functions:

    ```
    Function I,tmpF1,tmpF2;
    Indices i1,i2;
    Symbol [p];

    L I21 = I(2,1,[p],2,3,4);
    L I12 = I(1,2,[p],2,3,4);

    id I(i1?,i2?,[p],?m) = partitions_(2,tmpF1,i1,tmpF2,i2,?m);
    print +s -f;
   .end
The output with current FORM is:

I21 =

Is this intentional?

tueda commented 4 years ago

Maybe commutativity was assumed in the code?

vermaseren commented 4 years ago

In the example it looks indeed not so nice, but in general things become too complex if you try to keep track of noncommutability. Imagine partitions_(6,tmpF1,i1,tmpF2,i2,tmpF1,i3,tmpF2,i4,tmpF1,i5,tmpF2,i6,?a) It will be a minor horror now to keep track of the symmetries involved.

In your case, if you want tmpF1 before tmpF2, you use CFunction tmpF1p,tmpF2p; and use those and after that you can use id tmpF1p(?a) = tmpF1(?a); id tmpF2p(?a) = tmpF2(?a); the essence being that you should not do this in a single statement. Now it first gets the tmpF1 and puts them to the left. The second statement now gets the tmpF2 to the right of the tmpF1.

I hope this helps.

Jos

On 28 Oct 2019, at 00:22, Takahiro Ueda notifications@github.com wrote:

Maybe commutativity was assumed in the code?

— 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/327?email_source=notifications&email_token=ABJPCETRQD6A5ZZURASG6KTQQYPB3A5CNFSM4JFQWLR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECLK3MA#issuecomment-546745776, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPCERQG7VMMZTW4C7FP7TQQYPB3ANCNFSM4JFQWLRQ.

crmafra commented 4 years ago

On Mon, 28 Oct 2019 at 1:20:31 -0700, Jos Vermaseren wrote:

In the example it looks indeed not so nice, but in general things become too complex if you try to keep track of noncommutability. Imagine partitions_(6,tmpF1,i1,tmpF2,i2,tmpF1,i3,tmpF2,i4,tmpF1,i5,tmpF2,i6,?a) It will be a minor horror now to keep track of the symmetries involved.

In your case, if you want tmpF1 before tmpF2, you use CFunction tmpF1p,tmpF2p; and use those and after that you can use id tmpF1p(?a) = tmpF1(?a); id tmpF2p(?a) = tmpF2(?a); the essence being that you should not do this in a single statement. Now it first gets the tmpF1 and puts them to the left. The second statement now gets the tmpF2 to the right of the tmpF1.

I hope this helps.

Yes, thank you.

I had a similar workaround here where I would just commute the functions after partitions_().

I decided to raise the issue in case there was an easy fix.

Best regards, Carlos

Jos

On 28 Oct 2019, at 00:22, Takahiro Ueda notifications@github.com wrote:

Maybe commutativity was assumed in the code?

— 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/327?email_source=notifications&email_token=ABJPCETRQD6A5ZZURASG6KTQQYPB3A5CNFSM4JFQWLR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECLK3MA#issuecomment-546745776, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPCERQG7VMMZTW4C7FP7TQQYPB3ANCNFSM4JFQWLRQ.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/vermaseren/form/issues/327#issuecomment-546839218