interfaces

Defines top-level interfaces of tensorwaves.

class Estimator[source]

Bases: abc.ABC

Estimator for discrepancy model and data.

abstract __call__()float[source]

Evaluate discrepancy.

abstract gradient()list[source]

Compute the gradient of the data set.

abstract property parameters

Get dict of parameters.

abstract update_parameters(new_parameters: dict)None[source]

Update the collection of parameters.

class Function[source]

Bases: abc.ABC

Interface of a callable function.

The parameters of the model are separated from the domain variables. This follows the mathematical definition, in which a function defines its domain and parameters. However specific points in the domain are not relevant. Hence while the domain variables are the argument of the evaluation (see __call__()), the parameters are controlled via a getter and setter (see parameters()). The reason for this separation is to facilitate the events when parameters have changed.

abstract __call__(dataset: dict)list[source]

Evaluate the function.

Parameters

dataset – a dict with domain variable names as keys.

Returns

list or numpy.array of values.

abstract property parameters

Get dict of parameters.

abstract update_parameters(new_parameters: dict)None[source]

Update the collection of parameters.

class Kinematics[source]

Bases: abc.ABC

Abstract interface for computation of kinematic variables.

abstract convert(events: dict)dict[source]

Convert a set of momentum tuples (events) to kinematic variables.

abstract is_within_phase_space(events: dict) → Tuple[bool][source]

Check which events lie within phase space.

abstract property phase_space_volume

Compute volume of the phase space.

class Optimizer[source]

Bases: abc.ABC

Optimize a fit model to a data set.

abstract optimize(estimator: tensorwaves.interfaces.Estimator, initial_parameters: dict)dict[source]

Execute optimization.

class PhaseSpaceGenerator[source]

Bases: abc.ABC

Abstract class for generating phase space samples.

abstract generate(size: int, rng: tensorwaves.interfaces.UniformRealNumberGenerator)dict[source]

Generate phase space sample.

class UniformRealNumberGenerator[source]

Bases: abc.ABC

Abstract class for generating uniform real numbers.

abstract __call__(size: int, min_value: float = 0.0, max_value: float = 1.0) → Union[float, list][source]

Generate random floats in the range from [min_value,max_value).

abstract property seed

Get random seed. None if you want indeterministic behavior.