utils.integrands.abstract module

Abstract classes for integrands

class Integrand(*args, **kwargs)[source]

Bases: better_abc.ABC

Abstract class to define integrands for testing the integration library

abstract evaluate_integrand(x)[source]

Compute the value of the integrand on a batch of points

vegas(device=device(type='cpu'))[source]

Turn this integrand into a vegas batch integrand

class KnownIntegrand(*args, **kwargs)[source]

Bases: utils.integrands.abstract.Integrand, better_abc.ABC

Abstract class for integrands with a known integral value

check(estimated_integral, tolerance=0.001, method='relative')[source]

Check the value of an estimation of the integral value

Parameters
  • estimated_integral (float) –

  • tolerance (float) –

  • method ({"relative", "absolute"}) –

Returns

Return type

bool

compare_absolute(estimated_integral)[source]

Compute the absolute difference between an integral and the true value

compare_relative(estimated_integral)[source]

Compute the relative difference between an integral estimation and the true value

abstract integral()[source]

Compute the true value of the integral

class RegulatedIntegrand(*args, **kwargs)[source]

Bases: utils.integrands.abstract.Integrand

Integrand deriving from another one and adding a small constant regulating factor

This is a Mixin class. Have a look at the following references: [1] [2]

evaluate_integrand(x)[source]

Compute the value of the integrand on a batch of points

class RegulatedKnownIntegrand(*args, **kwargs)[source]

Bases: utils.integrands.abstract.RegulatedIntegrand, utils.integrands.abstract.KnownIntegrand

Integrand deriving from another known one and adding a small constant regulating factor

integral()[source]

Compute the true value of the integral