Skip to content

Commit

Permalink
[deval] allow to specify epsrel/abs per amplitude AND epsord
Browse files Browse the repository at this point in the history
  • Loading branch information
KernerM committed Apr 8, 2024
1 parent fb131e7 commit 99154ed
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pySecDec/disteval.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,18 @@ def evalf_cb(br_coef, exception, w, a, t):
for a, p in sorted(ap2coeffs.keys()):
log(f"- {sum_names[a]!r},", " ".join(f"{r}^{e}" for r, e in zip(sp_regulators, p)))

epsrel = [epsrel[a] if a < len(epsrel) else epsrel[-1] for a, p in ap2coeffs.keys()]
epsabs = [epsabs[a] if a < len(epsabs) else epsabs[-1] for a, p in ap2coeffs.keys()]
# extend epsrel and epsabs to match len(ap2coeffs)
if len(epsrel) <= len(sum_names):
# assume only one epsrel specified, or one for each amplitude
epsrel = [epsrel[a] if a < len(epsrel) else epsrel[-1] for a, p in sorted(ap2coeffs.keys())]
else:
# assume one epsrel for each amplitude and order in epsilon
epsrel = epsrel + [epsrel[-1]]*(len(ap2coeffs)-len(epsrel))

if len(epsabs) <= len(sum_names):
epsabs = [epsabs[a] if a < len(epsabs) else epsabs[-1] for a, p in sorted(ap2coeffs.keys())]
else:
epsabs = epsabs + [epsabs[-1]]*(len(ap2coeffs)-len(epsabs))

# Presample all kernels
kern_rng = [np.random.RandomState(0) for fam, ker in kernel2idx.keys()]
Expand Down

0 comments on commit 99154ed

Please sign in to comment.