

@defun
def pcfd(ctx, n, z, **kwargs):
    "\n    Gives the parabolic cylinder function in Whittaker's notation\n    `D_n(z) = U(-n-1/2, z)` (see :func:`~mpmath.pcfu`).\n    It solves the differential equation\n\n    .. math ::\n\n        y'' + \\left(n + \\frac{1}{2} - \\frac{1}{4} z^2\\right) y = 0.\n\n    and can be represented in terms of Hermite polynomials\n    (see :func:`~mpmath.hermite`) as\n\n    .. math ::\n\n        D_n(z) = 2^{-n/2} e^{-z^2/4} H_n\\left(\\frac{z}{\\sqrt{2}}\\right).\n\n    **Plots**\n\n    .. literalinclude :: /plots/pcfd.py\n    .. image :: /plots/pcfd.png\n\n    **Examples**\n\n        >>> from mpmath import *\n        >>> mp.dps = 25; mp.pretty = True\n        >>> pcfd(0,0); pcfd(1,0); pcfd(2,0); pcfd(3,0)\n        1.0\n        0.0\n        -1.0\n        0.0\n        >>> pcfd(4,0); pcfd(-3,0)\n        3.0\n        0.6266570686577501256039413\n        >>> pcfd('1/2', 2+3j)\n        (-5.363331161232920734849056 - 3.858877821790010714163487j)\n        >>> pcfd(2, -10)\n        1.374906442631438038871515e-9\n\n    Verifying the differential equation::\n\n        >>> n = mpf(2.5)\n        >>> y = lambda z: pcfd(n,z)\n        >>> z = 1.75\n        >>> chop(diff(y,z,2) + (n+0.5-0.25*z**2)*y(z))\n        0.0\n\n    Rational Taylor series expansion when `n` is an integer::\n\n        >>> taylor(lambda z: pcfd(5,z), 0, 7)\n        [0.0, 15.0, 0.0, -13.75, 0.0, 3.96875, 0.0, -0.6015625]\n\n    "
    return ctx.hypercomb((lambda : _hermite_param(ctx, n, z, 1)), [], **kwargs)

dataset/ETHPy150Open fredrik-johansson/mpmath/mpmath/functions/orthogonal.py pcfd/original