AmpForm 0.12.4
See all documentation for this version here.
💡 New features
HelicityModel.parameter_defaults has been wrapped in a ParameterValues class (#229 and #234)
#228 has made some parameter names even longer and harder to get with dict.__getitem__()
. This PR wraps the parameter_defaults
in a ParameterValues
class that allows doing stuff like:
>>> import sympy as sp
>>> a, b, c = sp.symbols("a b c")
>>> from ampform.helicity import ParameterValues
>>> parameters = ParameterValues({a: 0.0, b: 1+1j, c: -2})
>>> parameters[a] # get by sympy.Symbol
0.0
>>> parameters["b"] # get by str name
(1+1j)
>>> parameters["b"] = 3 # get by position in OrderedDict
>>> parameters[1]
3
>>> parameters[2]
-2
>>> parameters[2] = 3.14 # set by position in OrderedDict
>>> parameters[c]
3.14
Note that, as opposed to the previously used OrderedDict
, this class prevents users from adding more parameters to the parameter_defaults
.
Added switch for energy-dependent width (#236)
It's now possible to independently activate energy-dependent width and a form factor in the RelativisticBreitWignerBuilder
. Usage example here. See also #235.
Extracted DynamicsSelector class (#240)
HelicityAmplitudeBuilder.__dynamics_choices
has been extracted to a new DynamicsSelector
class. This reduces the responsibilities of the HelicityAmplitudeBuilder
and makes it easier to implement new implementations for selection of dynamics.
Something similar has been done for 'collector' attributes like HelicityAmplitudeBuilder.__parameter_defaults
and __components
. This will be useful when implementing TR-014, which will require keeping track of amplitude definitions.
Note: once QRules v0.10 is out, ComPWA/qrules#156 and ComPWA/qrules#157 make it possible to define the dynamics choices as a mapping over topologies and visualize them as graphviz.
Implemented HelicityModel.rename_symbols() (#244)
See use case example here (couple parameters). The method is makes it easier to address this error in #243.
🐛 Bug fixes
Moved angular momentum check to form factor (#230)
Removed the check for integral angular momentum. Instead, AmpForm now checks for angular momentum when formulating a form factor. This allows formulating Breit-Wigner dynamics without form factor on an amplitude model formulated with formalism="helicity"
if it has with half-spin resonances.
🔨 Internal maintenance
Simplified numpy code of matrix expressions (#232)
Closes #231
Extracted NumPyPrintable
implementation classes from BoostZMatrix
, RotationYMatrix
and RotationZMatrix
, so that the code generated with sympy.lambdify()
decreases and has a smaller memory footprint (if using cse=True
). This can best be seen by comparing the new docstring for BoostZMatrix
with the old one.
Switched to new import attrs API (#237)
See import attrs
and attrs
TNG.
Simplified HelicityAdapter class (#241)
Implementation of the HelicityAdapter
class was a bit too complicated. This PR makes the class into a simple manager of Topology instances that can create expressions from these topologies. Interface hasn't changed though.
implement_doit_method() can only decorate UnevaluatedExpression classes (#224)
📝 Documentation
Second level in left sidebar is shown by default (#221)
Links to NumPy API are now also embedded correctly in the code examples. Follow-up to #217.
Added Hypothesis and utterances overlay (#225)
Closes ComPWA/compwa.github.io#109
Added IPython.display import to notebooks (#226)
See "New features" under ComPWA/policy#49
Added explanation how to pin dependencies with Conda (#233)
Preview here. See also ComPWA/tensorwaves#411.
Improved signatures in helicity module (#242)
Note: it's not yet possible to abbreviate type aliases in nested type hints. Sphinx will fix this (sphinx-doc/sphinx#10183) in v4.5.0. This will also make it possible to improve the order of definitions in the helicity
module (makes more sense to define HelicityModel
first). See also https://github.com/ComPWA/compwa-org/issues/116.
🖱️ Developer Experience
Doctests are now also included in test coverage (#222)
Will increase test coverage.
Upgrade cron job is now run even weeks only (#223)
See ComPWA/policy#48
GitHub Actions are now also run on version branches (#239)
This makes it safer to commit or PR patches to older versions.