You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG: FFTLog truncates the span: n = np.int64(maxf - minf)*pts_per_dec #258
np.int64 is applied to the span in decades before multiplying, so a fractional part of the span is dropped. transform.get_fftlog_input(minf, maxf, n, ...) keeps the full span and sets dlogr = (rmax - rmin)/n, so the result is fewer points per decade than requested, not a shorter range.
Check (the line evaluated with pts_per_dec = 10): a span of 0.5 decades gives n = 0 (n = 0 would make get_fftlog_input divide by zero); a span of 2.5 gives 20, i.e. 8 points per decade instead of 10. The counts implied by the requested density are 5 and 25. With the default add_dec the span is usually several decades, so the loss is up to one decade's worth of points (for a span of 3.7, 30 points instead of 37).
Suggested fix: n = np.int64(np.ceil((maxf - minf)*targ['pts_per_dec'])) (possibly + 1, depending on the intended endpoint convention). If the truncation is intentional, a short comment would help.
I found this while testing physverify, a small verification tool I'm working on, against public codes. The tests and this write-up were done with help from an AI assistant; the numbers come from actually running the code.
I will implement your suggestion in #261. I tried to remember how it came to this, but it is just some organically grown thing from FFTLog, then pyfftlog and internal implementation. I don't expect any real-world differences due to this change, except for edge cases, but it is good to have it fixed. Thanks!
changed the title [-]FFTLog: `n = np.int64(maxf - minf)*pts_per_dec` truncates the span before multiplying, so the sampling is sparser than `pts_per_dec`[/-][+]BUG: FFTLog truncates the span: `n = np.int64(maxf - minf)*pts_per_dec`[/+]on Nov 18, 2026
Activity
prisae commentedon Nov 16, 2026
Thanks for your input @rcgiri-physics - I will try to have a closer look soon, feel free to remind me if it fall silent!
prisae commentedon Nov 18, 2026
I will implement your suggestion in #261. I tried to remember how it came to this, but it is just some organically grown thing from FFTLog, then pyfftlog and internal implementation. I don't expect any real-world differences due to this change, except for edge cases, but it is good to have it fixed. Thanks!
[-]FFTLog: `n = np.int64(maxf - minf)*pts_per_dec` truncates the span before multiplying, so the sampling is sparser than `pts_per_dec`[/-][+]BUG: FFTLog truncates the span: `n = np.int64(maxf - minf)*pts_per_dec`[/+]Addressing #258 (#261)