vermaseren / form

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

Unexpected behavior wrt summation. #343

Closed seppro closed 4 years ago

seppro commented 4 years ago

Dear all,

I have two almost identical FORM scripts here:

script_1: http://147.213.122.82/~andrej/Hzz2587Qj/t_567.frm script_2: http://147.213.122.82/~andrej/Hzz2587Qj/test_Zmol.frm

which differ only in summation at the end. In first case the summation in done in one step, in the second case summation it is done in two steps (this should not matter.. should it?).

When I subtract the results of the two previous scripts I get a non-zero result

http://147.213.122.82/~andrej/Hzz2587Qj/resDiff.txt

which is a mystery to me. Can somebody explain me, why the two outputs are different? I use form-4.2.1-x86_64-linux.

vermaseren commented 4 years ago

The problem is that in the second program you force an order of the dummy indices that is different from the order in the first. To enforce a better numbering of the dummy indices you can insert a renumber statement. It comes in varieties but in your case, just “renumber;” should do. When I do this just before printing out diff, the answer is nicely zero.

On 31 Jan 2020, at 10:26, seppro notifications@github.com wrote:

Dear all,

I have two almost identical FORM scripts here:

script_1: http://147.213.122.82/~andrej/Hzz2587Qj/t_567.frm http://147.213.122.82/~andrej/Hzz2587Qj/t_567.frm script_2: http://147.213.122.82/~andrej/Hzz2587Qj/test_Zmol.frm http://147.213.122.82/~andrej/Hzz2587Qj/test_Zmol.frm which differ only in summation at the end. In first case the summation in done in one step, in the second case summation it is done in two steps (this should not matter.. should it?).

When I subtract the results of the two previous scripts I get a non-zero result

http://147.213.122.82/~andrej/Hzz2587Qj/resDiff.txt http://147.213.122.82/~andrej/Hzz2587Qj/resDiff.txt which is a mystery to me. Can somebody explain me, why the two outputs are different?

— 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/343?email_source=notifications&email_token=ABJPCETMOLQ5YY4OF3RICRLRAPVC7A5CNFSM4KOD7GEKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IKCS3IA, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPCEVIJVQJHAHIPHS2FN3RAPVC7ANCNFSM4KOD7GEA.

seppro commented 4 years ago

I would like to understand more. Is the problem the "labeling" of dummy indices which is "chaotic" and two dummy index get the same label (which they should not?) and are summed in the second summation (and should not)? Do I get it correctly? Can one state that the firs case (t_567) is correct and the second (test_Zmol) is wrong? Should it be understood as some "bug" (or buggy feature) of FORM? Probably yes, because result should not depend on the summation order... Maybe could you point me to a tutorial/documentation section where this issue is described?

vermaseren commented 4 years ago

No, the numbering is correct, it is just not unique. Renumber tries to make it better. But only a full renumber can make it unique (within limitations, because if you mix in lots of symmetric functions….). The problem with a full renumber is that it tries all permutations. Hence if you have 10 different dummy indices, it tries 10! times. The normal renumber is quadratic in the sense that it considered pairs and see whether the term becomes ’smaller’ when the two pairs are exchanged. This is not perfect, but usually sufficient.

This issue of dummy indices can be rather nasty. Imagine you have a symmetric function which occurs 10 times, each with 4 indices and and all are dummy indices, all contracted. This means 20 pairs of different indices. It may take a long time to sort out what is the minimal representation. This is a known problem in graph theory: to find a canonical representation of a graph. There exist some libraries for this, and it is on the list of things to be implemented, but when?

Jos

On 31 Jan 2020, at 12:57, seppro notifications@github.com wrote:

I would like to understand more. Is the problem the "labeling" of dummy indices which is "chaotic" and two dummy index get the same label (which they should not?) and are summed in the second summation (and should not)? Do I get it correctly? Can one state that the firs case (t_567) is correct and the second (test_Zmol) is wrong? Should it be understood as some "bug" (or buggy feature) of FORM? Probably yes, because result should not depend on the summation order...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vermaseren/form/issues/343?email_source=notifications&email_token=ABJPCEVBDUQDZUXNRUKCZGLRAQG3BA5CNFSM4KOD7GEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKONYBI#issuecomment-580705285, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPCEWI6GCEWLCKQVWUUPTRAQG3BANCNFSM4KOD7GEA.