math

import ampform.dynamics.math

A collection of basic mathematical operations, used in ampform.dynamics.

class ComplexSqrt(x: Expr, *args: Any, **kwargs: Any)[source]

Bases: sympy.core.expr.Expr

Square root that returns positive imaginary values for negative input.

A special version sqrt() that renders nicely as LaTeX and and can be used as a handle for lambdify printers. See [TR-000] Complex square roots, [TR-001] Custom lambdification, and Printing for how to implement a custom lambdify() printer.

(1)\[\begin{split}\sqrt[\mathrm{c}]{x} = \begin{cases} i \sqrt{- x} & \text{for}\: x < 0 \\\sqrt{x} & \text{otherwise} \end{cases}\end{split}\]
is_commutative = True