builder#

import ampform.dynamics.builder

Build dynamics with correct variable names and values.

class TwoBodyKinematicVariableSet(incoming_state_mass: Symbol, outgoing_state_mass1: Symbol, outgoing_state_mass2: Symbol, helicity_theta: Symbol, helicity_phi: Symbol, angular_momentum: int | None = None)[source]#

Bases: object

Data container for the essential variables of a two-body decay.

This data container is inserted into a ResonanceDynamicsBuilder, so that it can build some lineshape expression from the dynamics module. It also allows to insert custom dynamics into the amplitude model.

incoming_state_mass: Symbol[source]#
outgoing_state_mass1: Symbol[source]#
outgoing_state_mass2: Symbol[source]#
helicity_theta: Symbol[source]#
helicity_phi: Symbol[source]#
angular_momentum: int | None[source]#
BuilderReturnType#

Type that a ResonanceDynamicsBuilder should return.

The first element in this tuple is the sympy.Expr that describes the dynamics for the resonance. The second element are suggested parameter values (see parameter_defaults) for the Symbol instances that appear in the sympy.Expr.

alias of Tuple[Expr, Dict[Symbol, float]]

class ResonanceDynamicsBuilder(*args, **kwargs)[source]#

Bases: Protocol

Protocol that is used by DynamicsSelector.assign.

Follow this Protocol when defining a builder function that is to be used by DynamicsSelector.assign. For an example, see the source code create_relativistic_breit_wigner, which creates a relativistic_breit_wigner.

See also

Custom dynamics

__call__(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType[source]#

Formulate a dynamics Expr for this resonance.

create_non_dynamic(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType[source]#
create_non_dynamic_with_ff(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType[source]#

Generate (only) a Blatt-Weisskopf form factor for a two-body decay.

See also formulate_form_factor().

class RelativisticBreitWignerBuilder(form_factor: bool = False, energy_dependent_width: bool = False, phsp_factor: PhaseSpaceFactorProtocol | None = None)[source]#

Bases: object

Factory for building relativistic Breit-Wigner expressions.

The __call__() of this builder complies with the ResonanceDynamicsBuilder, so instances of this class can be used in DynamicsSelector.assign().

Parameters:
__call__(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType[source]#

Formulate a relativistic Breit-Wigner for this resonance.

create_relativistic_breit_wigner(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType[source]#

Create a relativistic_breit_wigner for a two-body decay.

This is a convenience function for a RelativisticBreitWignerBuilder _without_ form factor.

create_relativistic_breit_wigner_with_ff(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType[source]#

Create a relativistic_breit_wigner_with_ff for a two-body decay.

This is a convenience function for a RelativisticBreitWignerBuilder _with_ form factor and a ‘normal’ PhaseSpaceFactor.

create_analytic_breit_wigner(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType[source]#

Create a relativistic_breit_wigner_with_ff with analytic continuation.

This is a convenience function for a RelativisticBreitWignerBuilder _with_ form factor and a ‘analytic’ phase space factor (see EqualMassPhaseSpaceFactor).