math
math¶
import ampform.sympy.math
A collection of basic math operations, used in ampform.dynamics
.
- class ComplexSqrt(x: Expr, *args, **kwargs)[source]¶
Bases:
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 customlambdify()
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}\]