math
math#
import ampform.sympy.math
A collection of basic math operations, used in ampform.dynamics.
- class ComplexSqrt(x: Number, *args, **kwargs)[source]#
- class ComplexSqrt(x: Expr, *args, **kwargs)
Bases:
NumPyPrintableSquare 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}\]- get_definition() Piecewise[source]#
Get a symbolic definition for this expression class.
Note
This class is
NumPyPrintable, so should not have anevaluate()method (in order to blockdoit()). This method serves as an equivalent to that.