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: NumPyPrintable

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 Complex square roots, 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_imaginary = False[source]#
get_definition() Piecewise[source]#

Get a symbolic definition for this expression class.