Ampform

Latest version: v0.15.4

Safety actively analyzes 688775 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 8 of 9

0.9.4

See all documentation for this version [here](https://ampform.rtfd.io/en/0.9.4).

πŸ’‘ New features

<details>
<summary>More phase space factor types available (81)</summary>

</details>


⚠️ Interface

<details>
<summary>phase_space_factor_ac has been renamed to phase_space_factor_analytic (81)</summary>

</details>

<details>
<summary>phase_space_factor does not use ComplexSqrt anymore (81)</summary>

**This reverts the phase space factor behaviour to that of version [0.9.2](https://github.com/ComPWA/ampform/releases/tag/0.9.2) and prior.**

</details>

πŸ“ Documentation

<details>
<summary>Improvements to the analytic-continuation and dynamics pages (81)</summary>

</details>


πŸ–±οΈ Developer Experience

<details>
<summary>upgrade pinned requirements (79)</summary>

Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

</details>

0.9.3

See all documentation for this version [here](https://ampform.rtfd.io/en/0.9.3).

πŸ’‘ New features

<details>
<summary>Added a new dynamics builder for analytic continuation (78)</summary>

Added a new function `create_analytic_breit_wigner` to `ampform.dynamics.builder` that allows setting a `relativistic_breit_wigner_with_ff` with analytic continuation.

</details>


πŸ› Bug fixes

<details>
<summary>Return masses as floats if possible (76)</summary>

Since 75 there is no need to use complex values as input for analytic continuation.

</details>

<details>
<summary>Set relativistic Breit-Wigner with form factor to 0 if 𝑠 below threshold (77)</summary>

A relativistic Breit-Wigner with Blatt-Weisskopf form factor now returns 0 below threshold. See [updated docstring](https://github.com/ComPWA/ampform/compare/sub-threshold-behavior?expand=1#diff-afdef4ce3b18ddf3a238a155accf7d4d304b5a66ec160cf95ae11b3bedb340bdR307).

</details>

0.9.2

See all documentation for this version [here](https://ampform.rtfd.io/en/0.9.2).

πŸ› Bug fixes

<details>
<summary>More control over complex square roots provided through ComplexSqrt class (72)</summary>

Closes 64

Implements [TR-000](https://compwa-org.readthedocs.io/report/000.html) and [TR-001](https://compwa-org.readthedocs.io/report/001.html) by defining a `ComplexSqrt` class. This allows for custom lambdification for specific expression tree nodes that are a square root.

</details>


πŸ“ Documentation

<details>
<summary>Added tip about jupyter-katex (74)</summary>

The complete amplitude model can only be rendered if [`jupyterlab-katex`](https://pypi.org/project/jupyterlab-katex) is installed. However, since KaTeX is less extensive than MathJax, this is only pointed out as a tip, and `jupyterlab-katex` is not added to the requirements.

</details>

<details>
<summary>Several improvements to the dynamics and analytic-continuation pages (75, bb2b4f0, 955be9b)</summary>

</details>

πŸ–±οΈ Developer Experience

<details>
<summary>Auto-close milestone upon release (70)</summary>

Milestones are automatically closed once their matching release is published.

</details>

0.9.1

See all documentation for this version [here](https://ampform.rtfd.io/en/0.9.1).

⚠️ Interface

<details>
<summary>Coefficient symbol name has been changed slightly (cdec30b)</summary>

The coefficients in canonical amplitudes ended in ";", while the coefficients for helicity amplitudes did not. Furthermore, an additional space has been added behind each intermediate ";" for readability.

</details>

πŸ› Bug fixes

<details>
<summary>Function complex_sqrt() has been replaced with sympy.sqrt() to allow lambdified analytic continuation (58)</summary>

The `complex_sqrt()` function causes problems when being lambdified, because it contains `sympy.Piecewise`. An attempt was made to replace `complex_sqrt()` with a class `ComplexSqrt` that defined specific lambdify methods (59), but that approach results in too much maintenance work (for instance does not work out of the box with tensorflow).

This PR instead just casts all masses to complex values, so that `numpy.sqrt` works with negative values, e.g.:

python
>>> np.sqrt(np.array(-1, dtype=np.complex64))
1j


It's not ideal, but at least allows optimizing models with analytic continuation.

Closes 59

</details>

<details>
<summary>Improve signature of relative_breit_wigner_with_ff (31f5350)</summary>

</details>

<details>
<summary>Improve rendering of Clebsch-Gordan coefficient (9d98a3c)</summary>

The mini-fix for `CG` introduced by ComPWA/expertsystem454 did not work well yet. This fix also removes the intermediate `_ClebschGordanLatexFix` class by replacing the `CG._latex method`.

</details>

πŸ–±οΈ πŸ“ Documentation

<details>
<summary>Install doc requirements in Google Colab (1e6044f)</summary>

</details>

0.9.0

**Yanked in favor of [v0.9.1](https://github.com/ComPWA/ampform/releases/tag/0.9.1) due to #58.**

_Major refactoring and improvements to the `dynamics` module and documentation._

See all documentation for this version [here](https://ampform.rtfd.io/en/0.9.0).

πŸ’‘ New features

<details>
<summary>Extracted function for coupled, or "mass-dependent", width (45)</summary>

The running width / coupled width / mass dependent width used in `relativisitc_breit_wigner_with_ff` is useful to _K_-matrix and FlattΓ©. It's now exposed as a separate function:

![image](https://user-images.githubusercontent.com/29308176/116707244-baf66880-a9ce-11eb-9136-76ea6c061805.png)

</details>

<details>
<summary>AmpForm now ships with a symplot mini-package (47)</summary>

Previously, the mini-package `symplot` was only available to the documentation, or as a relative import to notebooks. This did not work well, especially for the notebooks and for Google Colab.

</details>

<details>
<summary>Added phase space factor functions and added visualizations (51)</summary>

Adds the functions phase_space_factor and phase_space_factor_ac, with references. The functions are, however, not yet implemented into the dynamic lineshapes.

</details>

<details>
<summary>Implement analytic continuation (52 and 56)</summary>

Implemented `phase_space_factor` that was introduced by 51 into the `coupled_width`. The 'default' `phase_space_factor` has been adapted so that it can handle negative square roots.

Note: the overall lineshape of amplitude models does not change in the domain where it was defined so far. Only undefined domains are extended (see `test_dynamics.py`).

</details>

⚠️ Interface

<details>
<summary>BlattWeisskopf now uses z as argument, not q and d (40)</summary>

Let the `BlattWeisskopf` callable only depend on `z` and `angular_momentum`. This leaves leaves the responsibility of setting `z` equal to break-up momentum times meson radius to the caller (too much logics going on within this class + this z = d \* q is just one way to define things).

</details>

<details>
<summary>Improved API of dynamics module (41, 54, and d79583d)</summary>

- The main `dynamics` module now only contains lineshape functions (801c7d9). This allows for cleaner imports, like :
python
from ampform.dynamics import relativistic_breit_wigner

- Decorators that facilitate subclassing `sympy.Expr` have been isolated under `dynamics.decorator` (c1422ff)
- `dynamics.builder` can remain as it is (no circular dependencies), but its docstrings have been improved (ba24b2a)
- `doit()`, `def_assumptions`, and `evaluate()` are now hidden from the API (1c79ce4)
- Sub-classes of `UnevaluatedExpr` do not convert the `args` into properties anymore (bb1675a). This was causing a lot of code cluttering and those properties are not that useful.
- `breakup_momentum` now has references to the PDG (in preparation of analytic continuation) (020c5b3)

</details>

<details>
<summary>Return square value of break-up momentum (48)</summary>

The original `breakup_momentum` contains a `sqrt`. This is inconvenient for the caller, because it does not allow handling negative values the break-up momentum _squared_. This is becomes important in phase space factors.

</details>

<details>
<summary>Use Mandelstam 𝑠 instead of π‘šΒ² (49)</summary>

Comparable to 48, this allows handling negative values of 𝑠 or π‘šΒ².

</details>

<details>
<summary>Switch to square value of Blatt-Weisskopf (53)</summary>

The value of Blatt-Weisskopf squared can be negative. This leaves it up to the caller how to handle these negative values if a square root is to be taken. Note that this becomes particularly important when the Blatt-Weisskopf function is used as a damping factor, like in `relativistic_breit_wigner_with_ff` and `create_non_dynamics_with_ff`, as opposed to `coupled_width` (where the square value is used).

Also improved some of the references for the lineshapes. In addition, a new interactive widget shows the effect of a Blatt-Weisskopf factor.

</details>

πŸ“ Documentation

<details>
<summary>Improved mathematical rendering in dynamics API (43)</summary>

42 makes it easier to dynamically generate latex for the math in behind the `dynamics` module. This makes it easier to cross-reference the formulas as follows:

<details>
<summary>Screenshot of generated API</summary>

![image](https://user-images.githubusercontent.com/29308176/116678800-0c403100-a9aa-11eb-8272-ed6a80a072ea.png)

</details>

It now also becomes easier to extract for instance running width (both in coding and in math definitions).

</details>

<details>
<summary>Annotations in API are now abbreviated (44)</summary>

Make the API more readable by abbreviating type hints. This style also mimics what one sees in the codebase.

**Old**

![image](https://user-images.githubusercontent.com/29308176/116695612-246f7a80-a9c1-11eb-8c73-8390825f4394.png)

![image](https://user-images.githubusercontent.com/29308176/116695985-99db4b00-a9c1-11eb-9de6-9a4af107939d.png)

**New**

![image](https://user-images.githubusercontent.com/29308176/116695657-32250000-a9c1-11eb-9f91-4c32ea8f295b.png)

![image](https://user-images.githubusercontent.com/29308176/116695922-84662100-a9c1-11eb-8752-97ccb5778105.png)

**Insert line breaks (optional)**

There's also an experimental option `autodoc_insert_signature_linebreaks` to insert line breaks before each argument: ![image](https://user-images.githubusercontent.com/29308176/116696341-12420c00-a9c2-11eb-9f26-9aaf16f140ce.png)

but this has been switched off because it doesn't look nicely everywhere.

</details>

<details>
<summary>Added interactive dynamics lineshape widgets (50)</summary>

![record](https://user-images.githubusercontent.com/29308176/117027080-a2eb5580-acfc-11eb-8aeb-096bbe578d8b.gif)

</details>

<details>
<summary>Show effect of Blatt-Weisskopf factor on break-up momentum (53)</summary>

Also improved some of the references for the lineshapes. In addition, a new interactive widget shows the effect of a Blatt-Weisskopf factor.

</details>

<details>
<summary>Improve signature of coupled_width (54)</summary>

The signature of functions that have arguments with functions as default values (for an argument that expects a callable) do not render well. So it's better to use `Optional[PhaseSpaceFactor] = None` instead.

</details>

<details>
<summary>Improve dynamics page with widget output (55)</summary>

</details>

<details>
<summary>Added phase sliders in K-matrix animation (5eda627)</summary>

</details>

<details>
<summary>Removed brackets from parenthetical citations (dda5099)</summary>

These citations are already rendered as links, so there's no need to put brackets around them. E.g.

> [Chung et al. 1995], pp.2β€”4

becomes

> Chung et al. 1995, pp.2β€”4

</details>

πŸ–±οΈ Developer Experience

<details>
<summary>Removed myst-nb glue cells (42)</summary>

The `lineshapes` notebook was used to insert a mathematical rendering of the implementations in the dynamics module into its docstrings. This has some disadvantages:

- Output cells have to be updated whenever some implementation. This could be countered with pytest-notebook, but that is bothersome if a notebook generates figures.

- The link between the module and that notebook is note immediately clear.

The math is now inserted through Sphinx only (through `conf.py`), which makes it easier to extend the `dynamics` module with more lineshapes and render their mathematics.

</details>

0.8.1

See all documentation for this version [here](https://ampform.rtfd.io/en/0.8.1).

πŸ“ Documentation

<details>
<summary>Generalized the procedure to create plot widgets for SymPy expressions (31)</summary>

- Slider parameters are extracted from the remaining free symbols of an (amplitude) expression automatically. That makes it easier to plot any other amplitude model -- it's only needed to provide a domain for the sliders.
- Labels for the sliders are now the names of the (latex) symbols they represent
- The real and imaginary plot have been removed, leaving only the intensity plot and the Argand plot
- The interactive notebook can now be run independently

![image](https://user-images.githubusercontent.com/29308176/115573314-ee474200-a2c0-11eb-963d-2d1a8297f781.png)

</details>

<details>
<summary>Extracted interactive plotting to symplot mini-package (38)</summary>

The procedure illustrated in [Inspect model interactively](https://ampform.readthedocs.io/en/0.8.0/usage/interactive.html) has been extracted to a 'mini-module' `symplot`. For now, it's only available to the Jupyter notebooks and to Sphinx, but if successful, it could be hosted as a separate package, so that it can also be used for the PWA pages.

</details>

<details>
<summary>Added interactive notebook for inspect K-matrix behavior (39)</summary>

Illustrate difference between _K_-matrix and sum of Breit-Wigners with `symplot` from 38. See [this notebook/page](https://ampform.readthedocs.io/en/0.8.1/usage/k-matrix.html).

![K-matrix animation](https://ampform.readthedocs.io/en/0.8.1/_images/k-matrix_32_0.png)

</details>

<details>
<summary>Added references to dependency pinning in installation instructions (580a7f2)</summary>

</details>

<details>
<summary>Added cSpell badge (4f12285)</summary>

</details>

<details>
<summary>Updated links to related projects on RTD (b7871b7)</summary>

RTD namespace "pwa" has been disabled to shorten URLs.

</details>
<details>
<summary>Documentation now renders better on mobile (a4ef501b)</summary>

See https://github.com/executablebooks/sphinx-book-theme/blob/master/CHANGELOG.md#v0042v010

</details>


πŸ”¨ Internal maintenance

<details>
<summary>Adapt tests to official qrules release (29)</summary>

Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

</details>

<details>
<summary>Remove remnants from expertsystem/qrules (34)</summary>

Remove things that are only useful to `qrules`, such as `jsonschema`, `pydot`, `constraints`, and `sphobjinv` (for `constraints`).

</details>

<details>
<summary>Clean up pylint configuration (35)</summary>

- Remove built-ins check (flake8-builtins handles this)
- Sort pylintrc sections
- Use `good-names-rgxs`
- Use error names instead of error codes
- Move some of the ignores inline

</details>

<details>
<summary>Optional dependencies collection "extras" has been renamed to "all" (0f676c8)</summary>

Makes a bit more sense, i.e.:

shell
pip install ampform[all]


instead of

shell
pip install ampform[extras]


</details>

πŸ–±οΈ Developer Experience

<details>
<summary>Moved requirements back to setup.cfg (27)</summary>

With the release of [`pip-tools` v6.1.0](https://github.com/jazzband/pip-tools/releases/tag/6.1.0), `pip-compile` now correctly handles [`extras_require`](https://setuptools.readthedocs.io/en/latest/userguide/dependency_management.html#optional-dependencies). This allows for a big clean-up of the set-up introduced by https://github.com/ComPWA/expertsystem/pull/412.

Advantages:

- Easier for the user and developer! Just run: `pip install -e .[dev]` to get started developing, `pip install -e .[dev] -U` to try out upgrades, and `pip install -c .constraints/py3.8.txt -e .[dev] -U` in case you exactly want to reproduce the dependencies for some commit.
- The upgrade jobs become significantly faster: [bit over 1min](https://github.com/ComPWA/qrules/runs/2346236017?check_suite_focus=true) versus almost [3min](https://github.com/ComPWA/qrules/runs/2322145112?check_suite_focus=true)
- All requirements, their version domains, and the dependencies between each of the requirement sections can be nicely overseen and maintained within `setup.cfg`
- Git diffs for pull requests that affect dependencies become easier to oversee
- Less complexity and fewer changes per commit

</details>

<details>
<summary>Bug fix: define testpaths in pytest.ini (28)</summary>

Since 35aa838, it is become impossible to run tests through VSCode. Defining testpaths fixes this. In addition, it removes the last 'non-tox' section from the tox.ini file (see 81402eb).

See also https://github.com/ComPWA/qrules/pull/42

</details>

<details>
<summary>Added GitHub PR template (32)</summary>

</details>

<details>
<summary>GitPod now automatically installs VSCode extensions (32)</summary>

</details>

<details>
<summary>Added radon complexity check (33)</summary>

</details>

<details>
<summary>Cleaned up pylint configuration (35)</summary>

- Remove built-ins check (flake8-builtins handles this)
- Sort pylintrc sections
- Use `good-names-rgxs`
- Use error names instead of error codes
- Move some of the ignores inline

</details>

<details>
<summary>Added more flake8 plugins and fixed identified issues (36)</summary>

- [`flake8-comprehensions`](https://pypi.org/project/flake8-comprehensions)
- [`flake8-pytest-style`](https://pypi.org/project/flake8-pytest-style)
- [`flake8-use-fstring`](https://github.com/MichaelKim0407/flake8-use-fstring/blob/develop/README.md)

</details>

<details>
<summary>Removed nbstripout from format requirements and added as pre-commit hook (37)</summary>

Pre-commit hooks should only be local if the corresponding tool can also be used through other applications (e.g. IDEs or Jupyter Lab), so that their versions are in sync. And `nbstripout` can only be used through the terminal, so is best enforced through pre-commit only.

</details>

<details>
<summary>Extracted .mypy.ini file from setup.cfg (47f0004)</summary>

This cleans up the setup.cfg file so that it only contains info a the set-up of the package

</details>

<details>
<summary>Extracted config files for dev tools from tox.ini (81402eb)</summary>

Better to only keep tox job definitions in the tox.ini file. Note that config files are only extracted if their respective tools supports a config file name that starts with a dot

</details>

<details>
<summary>Run black formatting in documentation (324d684)</summary>

</details>

<details>
<summary>Doctests are now verified with pytest instead of Sphinx (35aa838)</summary>

This is much faster, allows for testing coverage, and is also easier to run locally.

</details>

<details>
<summary>Renamed CI workflows to pytest and pre-commit (0da2a84)</summary>

This works better with the CI badges

</details>

<details>
<summary>Added test explorer VSCode extension and removed redundant extensions (d04c4f8)</summary>

</details>

Page 8 of 9

Β© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.