Atelier des rouesLaboratoire EN
Objets/Documentation

profils15.py

Je fournis cette pièce pour reproduire les compteurs, les décisions et leurs contrôles.

Télécharger ↓
"""Independent numerical controls for the released collision-free limit profiles."""
import json
from itertools import product
from math import erf, exp, factorial, fsum, log1p, prod, sqrt


def poisson(rate, n):
    return exp(-rate) * rate**n / factorial(n)


def tv_counts(left, right):
    # Direct TV on the product counts; the omitted mass is below 1e-16 here.
    ns = range(40)
    cells = [[(poisson(a,n),poisson(b,n)) for n in ns] for a,b in zip(left,right)]
    return fsum(abs(prod(s for s,_ in terms)-prod(j for _,j in terms))
                for terms in product(*cells))/2

Lire dans son contexte

Commentaires

Les commentaires en français et en anglais sont réunis ici.

La discussion reste consultable. J’ouvrirai les participations dès que la protection antispam sera configurée.