MethodicalAcceleratorDesign / MAD-NG

MAD Next-Generation official repository
GNU General Public License v3.0
32 stars 11 forks source link

Bug in __le and __leq for tpsa #439

Closed 17IMMANUEL17 closed 5 months ago

17IMMANUEL17 commented 6 months ago

local d = gtpsad(2,10) local t1 = tpsa(d) local t2 = tpsa(d,9) print(t1<=t2) ---> true

In the code above we create two tpsas from the same descriptor but imposing the maximum order t2 equal to 9. In this way using the leq (same for le) sjpuld trigger an error but the ouput is instead true.

local d = gtpsad(2,10) local d2 = gtpsad(2,9) local t1 = tpsa(d) local t2 = tpsa(d2) print(t1<=t2) --> 'incompatible GTPSA descriptor'

If we then run this we see the behaviour we should expect.

ldeniau commented 5 months ago

The fist case is the same misunderstanding as for issue #438 The second case reports correctly that tpsas are incompatibles because they don't have the same internal structure, i.e. their global mo differ as well as their indexing scheme.