code stringlengths 17 6.64M |
|---|
def Bessel(*args, **kwds):
"\n A function factory that produces symbolic I, J, K, and Y Bessel functions.\n There are several ways to call this function:\n\n - ``Bessel(order, type)``\n - ``Bessel(order)`` -- type defaults to ``'J'``\n - ``Bessel(order, typ=T)``\n - ``Bessel(typ=T)`` -- order is... |
class Function_Struve_H(BuiltinFunction):
'\n The Struve functions, solutions to the non-homogeneous Bessel differential equation:\n\n .. MATH::\n\n x^2\\frac{d^2y}{dx^2}+x\\frac{dy}{dx}+(x^2-\\alpha^2)y=\\frac{4\\bigl(\\frac{x}{2}\\bigr)^{\\alpha+1}}{\\sqrt\\pi\\Gamma(\\alpha+\\tfrac12)},\n\n .. ... |
class Function_Struve_L(BuiltinFunction):
'\n The modified Struve functions.\n\n .. MATH::\n\n \\mathrm{L}_\\alpha(x) = -i\\cdot e^{-\\frac{i\\alpha\\pi}{2}}\\cdot\\mathrm{H}_\\alpha(ix)\n\n EXAMPLES::\n\n sage: struve_L(2, x) # nee... |
class Function_Hankel1(BuiltinFunction):
'\n The Hankel function of the first kind\n\n DEFINITION:\n\n .. MATH::\n\n H_\\nu^{(1)}(z) = J_{\\nu}(z) + iY_{\\nu}(z)\n\n EXAMPLES::\n\n sage: hankel1(3, x) # needs sage.symbolic\n ... |
class Function_Hankel2(BuiltinFunction):
'\n The Hankel function of the second kind\n\n DEFINITION:\n\n .. MATH::\n\n H_\\nu^{(2)}(z) = J_{\\nu}(z) - iY_{\\nu}(z)\n\n EXAMPLES::\n\n sage: hankel2(3, x) # needs sage.symbolic\n ... |
class SphericalBesselJ(BuiltinFunction):
'\n The spherical Bessel function of the first kind\n\n DEFINITION:\n\n .. MATH::\n\n j_n(z) = \\sqrt{\\frac{\\pi}{2z}} \\,J_{n + \\frac{1}{2}}(z)\n\n EXAMPLES::\n\n sage: spherical_bessel_J(3, 3.) #... |
class SphericalBesselY(BuiltinFunction):
'\n The spherical Bessel function of the second kind\n\n DEFINITION:\n\n .. MATH::\n\n y_n(z) = \\sqrt{\\frac{\\pi}{2z}} \\,Y_{n + \\frac{1}{2}}(z)\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: spherical_bessel_Y(3, x)\n sph... |
class SphericalHankel1(BuiltinFunction):
'\n The spherical Hankel function of the first kind\n\n DEFINITION:\n\n .. MATH::\n\n h_n^{(1)}(z) = \\sqrt{\\frac{\\pi}{2z}} \\,H_{n + \\frac{1}{2}}^{(1)}(z)\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: spherical_hankel1(3, x)\n ... |
class SphericalHankel2(BuiltinFunction):
'\n The spherical Hankel function of the second kind\n\n DEFINITION:\n\n .. MATH::\n\n h_n^{(2)}(z) = \\sqrt{\\frac{\\pi}{2z}} \\,H_{n + \\frac{1}{2}}^{(2)}(z)\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: spherical_hankel2(3, x)\n... |
def spherical_bessel_f(F, n, z):
"\n Numerically evaluate the spherical version, `f`, of the Bessel function `F`\n by computing `f_n(z) = \\sqrt{\\frac{1}{2}\\pi/z} F_{n + \\frac{1}{2}}(z)`.\n According to Abramowitz & Stegun, this identity holds for the Bessel\n functions `J`, `Y`, `K`, `I`, `H^{(1)}... |
class Function_erf(BuiltinFunction):
'\n The error function.\n\n The error function is defined for real values as\n\n .. MATH::\n\n \\operatorname{erf}(x) = \\frac{2}{\\sqrt{\\pi}} \\int_0^x e^{-t^2} dt.\n\n This function is also defined for complex values, via analytic\n continuation.\n\n ... |
class Function_erfi(BuiltinFunction):
'\n The imaginary error function.\n\n The imaginary error function is defined by\n\n .. MATH::\n\n \\operatorname{erfi}(x) = -i \\operatorname{erf}(ix).\n '
def __init__(self):
'\n Initialize ``self``.\n\n EXAMPLES::\n\n ... |
class Function_erfc(BuiltinFunction):
'\n The complementary error function.\n\n The complementary error function is defined by\n\n .. MATH::\n\n \\frac{2}{\\sqrt{\\pi}} \\int_t^\\infty e^{-x^2} dx.\n\n EXAMPLES::\n\n sage: erfc(6) ... |
class Function_erfinv(BuiltinFunction):
'\n The inverse error function.\n\n The inverse error function is defined by:\n\n .. MATH::\n\n \\operatorname{erfinv}(x) = \\operatorname{erf}^{-1}(x).\n '
def __init__(self):
"\n Initialize ``self``.\n\n EXAMPLES::\n\n ... |
class Function_Fresnel_sin(BuiltinFunction):
def __init__(self):
"\n The sine Fresnel integral.\n\n It is defined by the integral\n\n .. MATH ::\n\n \\operatorname{S}(x) = \\int_0^x \\sin\\left(\\frac{\\pi t^2}{2}\\right)\\, dt\n\n for real `x`. Using power series e... |
class Function_Fresnel_cos(BuiltinFunction):
def __init__(self):
"\n The cosine Fresnel integral.\n\n It is defined by the integral\n\n .. MATH ::\n\n \\operatorname{C}(x) = \\int_0^x \\cos\\left(\\frac{\\pi t^2}{2}\\right)\\, dt\n\n for real `x`. Using power series... |
class Function_exp_integral_e(BuiltinFunction):
"\n The generalized complex exponential integral `E_n(z)` defined by\n\n .. MATH::\n\n E_n(z) = \\int_1^{\\infty} \\frac{e^{-z t}}{t^n} \\; dt\n\n for complex numbers `n` and `z`, see [AS1964]_ 5.1.4.\n\n The special case where `n = 1` is denoted ... |
class Function_exp_integral_e1(BuiltinFunction):
"\n The generalized complex exponential integral `E_1(z)` defined by\n\n .. MATH::\n\n E_1(z) = \\int_z^\\infty \\frac{e^{-t}}{t} \\; dt\n\n see [AS1964]_ 5.1.4.\n\n EXAMPLES::\n\n sage: exp_integral_e1(x) ... |
class Function_log_integral(BuiltinFunction):
"\n The logarithmic integral `\\operatorname{li}(z)` defined by\n\n .. MATH::\n\n \\operatorname{li}(x) = \\int_0^z \\frac{dt}{\\ln(t)} = \\operatorname{Ei}(\\ln(x))\n\n for x > 1 and by analytic continuation for complex arguments z (see [AS1964]_ 5.1.... |
class Function_log_integral_offset(BuiltinFunction):
'\n The offset logarithmic integral, or Eulerian logarithmic integral,\n `\\operatorname{Li}(x)` is defined by\n\n .. MATH::\n\n \\operatorname{Li}(x) = \\int_2^x \\frac{dt}{\\ln(t)} =\n \\operatorname{li}(x)-\\operatorname{li}(2)\n\n ... |
class Function_sin_integral(BuiltinFunction):
"\n The trigonometric integral `\\operatorname{Si}(z)` defined by\n\n .. MATH::\n\n \\operatorname{Si}(z) = \\int_0^z \\frac{\\sin(t)}{t} \\; dt,\n\n see [AS1964]_ 5.2.1.\n\n EXAMPLES:\n\n Numerical evaluation for real and complex arguments is ha... |
class Function_cos_integral(BuiltinFunction):
"\n The trigonometric integral `\\operatorname{Ci}(z)` defined by\n\n .. MATH::\n\n \\operatorname{Ci}(z) = \\gamma + \\log(z) + \\int_0^z \\frac{\\cos(t)-1}{t} \\; dt,\n\n where `\\gamma` is the Euler gamma constant (``euler_gamma`` in Sage),\n see... |
class Function_sinh_integral(BuiltinFunction):
"\n The trigonometric integral `\\operatorname{Shi}(z)` defined by\n\n .. MATH::\n\n \\operatorname{Shi}(z) = \\int_0^z \\frac{\\sinh(t)}{t} \\; dt,\n\n see [AS1964]_ 5.2.3.\n\n EXAMPLES:\n\n Numerical evaluation for real and complex arguments i... |
class Function_cosh_integral(BuiltinFunction):
"\n The trigonometric integral `\\operatorname{Chi}(z)` defined by\n\n .. MATH::\n\n \\operatorname{Chi}(z) = \\gamma + \\log(z) + \\int_0^z \\frac{\\cosh(t)-1}{t} \\; dt,\n\n see [AS1964]_ 5.2.4.\n\n EXAMPLES::\n\n sage: z = var('z') ... |
class Function_exp_integral(BuiltinFunction):
"\n The generalized complex exponential integral Ei(z) defined by\n\n .. MATH::\n\n \\operatorname{Ei}(x) = \\int_{-\\infty}^x \\frac{e^t}{t} \\; dt\n\n for x > 0 and for complex arguments by analytic continuation,\n see [AS1964]_ 5.1.2.\n\n EXAM... |
def exponential_integral_1(x, n=0):
'\n Returns the exponential integral `E_1(x)`. If the optional\n argument `n` is given, computes list of the first\n `n` values of the exponential integral\n `E_1(x m)`.\n\n The exponential integral `E_1(x)` is\n\n .. MATH::\n\n E_1(x) = \... |
class Function_gamma(GinacFunction):
def __init__(self):
"\n The Gamma function. This is defined by\n\n .. MATH::\n\n \\Gamma(z) = \\int_0^\\infty t^{z-1}e^{-t} dt\n\n for complex input `z` with real part greater than zero, and by\n analytic continuation on the res... |
class Function_log_gamma(GinacFunction):
def __init__(self):
"\n The principal branch of the log gamma function. Note that for\n `x < 0`, ``log(gamma(x))`` is not, in general, equal to\n ``log_gamma(x)``.\n\n It is computed by the ``log_gamma`` function for the number type,\n ... |
class Function_gamma_inc(BuiltinFunction):
def __init__(self):
'\n The upper incomplete gamma function.\n\n It is defined by the integral\n\n .. MATH::\n\n \\Gamma(a,z)=\\int_z^\\infty t^{a-1}e^{-t}\\,\\mathrm{d}t\n\n EXAMPLES::\n\n sage: gamma_inc(CDF(0,... |
class Function_gamma_inc_lower(BuiltinFunction):
def __init__(self):
'\n The lower incomplete gamma function.\n\n It is defined by the integral\n\n .. MATH::\n\n \\Gamma(a,z)=\\int_0^z t^{a-1}e^{-t}\\,\\mathrm{d}t\n\n EXAMPLES::\n\n sage: gamma_inc_lower(... |
def gamma(a, *args, **kwds):
"\n Gamma and upper incomplete gamma functions in one symbol.\n\n Recall that `\\Gamma(n)` is `n-1` factorial::\n\n sage: gamma(11) == factorial(10)\n True\n sage: gamma(6)\n 120\n sage: gamma(1/2) ... |
def _mathematica_gamma3(*args):
"\n EXAMPLES::\n\n sage: gamma(4/3)._mathematica_().sage() # indirect doctest, optional - mathematica\n gamma(4/3)\n sage: gamma(4/3, 1)._mathematica_().sage() # indirect doctest, optional - mathematica\n gamma(4/3, 1)\n sage: mathemat... |
class Function_psi1(GinacFunction):
def __init__(self):
"\n The digamma function, `\\psi(x)`, is the logarithmic derivative of the\n gamma function.\n\n .. MATH::\n\n \\psi(x) = \\frac{d}{dx} \\log(\\Gamma(x)) = \\frac{\\Gamma'(x)}{\\Gamma(x)}\n\n EXAMPLES::\n\n ... |
class Function_psi2(GinacFunction):
def __init__(self):
"\n Derivatives of the digamma function `\\psi(x)`. T\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: from sage.functions.gamma import psi2\n sage: psi2(2, x)\n psi(2, x)\n ... |
def psi(x, *args, **kwds):
"\n The digamma function, `\\psi(x)`, is the logarithmic derivative of the\n gamma function.\n\n .. MATH::\n\n \\psi(x) = \\frac{d}{dx} \\log(\\Gamma(x)) = \\frac{\\Gamma'(x)}{\\Gamma(x)}\n\n We represent the `n`-th derivative of the digamma function with\n `\\psi(... |
def _swap_psi(a, b):
return psi(b, a)
|
class Function_beta(GinacFunction):
def __init__(self):
'\n Return the beta function. This is defined by\n\n .. MATH::\n\n \\operatorname{B}(p,q) = \\int_0^1 t^{p-1}(1-t)^{q-1} dt\n\n for complex or symbolic input `p` and `q`.\n Note that the order of inputs does n... |
class FunctionDiracDelta(BuiltinFunction):
"\n The Dirac delta (generalized) function, `\\delta(x)` (``dirac_delta(x)``).\n\n INPUT:\n\n - ``x`` - a real number or a symbolic expression\n\n DEFINITION:\n\n Dirac delta function `\\delta(x)`, is defined in Sage as:\n\n `\\delta(x) = 0` for re... |
class FunctionHeaviside(GinacFunction):
'\n The Heaviside step function, `H(x)` (``heaviside(x)``).\n\n INPUT:\n\n - ``x`` - a real number or a symbolic expression\n\n DEFINITION:\n\n The Heaviside step function, `H(x)` is defined in Sage as:\n\n `H(x) = 0` for `x < 0` and `H(x) = 1` for `x... |
class FunctionUnitStep(GinacFunction):
'\n The unit step function, `\\mathrm{u}(x)` (``unit_step(x)``).\n\n INPUT:\n\n - ``x`` - a real number or a symbolic expression\n\n DEFINITION:\n\n The unit step function, `\\mathrm{u}(x)` is defined in Sage as:\n\n `\\mathrm{u}(x) = 0` for `x < 0` an... |
class FunctionSignum(BuiltinFunction):
"\n The signum or sgn function `\\mathrm{sgn}(x)` (``sgn(x)``).\n\n INPUT:\n\n - ``x`` - a real number or a symbolic expression\n\n DEFINITION:\n\n The sgn function, `\\mathrm{sgn}(x)` is defined as:\n\n `\\mathrm{sgn}(x) = 1` for `x > 0`,\n `\... |
class FunctionKroneckerDelta(BuiltinFunction):
"\n The Kronecker delta function `\\delta_{m,n}` (``kronecker_delta(m, n)``).\n\n INPUT:\n\n - ``m`` - a number or a symbolic expression\n - ``n`` - a number or a symbolic expression\n\n DEFINITION:\n\n Kronecker delta function `\\delta_{m,n}` is ... |
class Function_sinh(GinacFunction):
def __init__(self):
'\n The hyperbolic sine function.\n\n EXAMPLES::\n\n sage: sinh(3.1415)\n 11.5476653707437\n\n sage: # needs sage.symbolic\n sage: sinh(pi)\n sinh(pi)\n sage: float(sinh... |
class Function_cosh(GinacFunction):
def __init__(self):
'\n The hyperbolic cosine function.\n\n EXAMPLES::\n\n sage: cosh(3.1415)\n 11.5908832931176\n\n sage: # needs sage.symbolic\n sage: cosh(pi)\n cosh(pi)\n sage: float(co... |
class Function_tanh(GinacFunction):
def __init__(self):
'\n The hyperbolic tangent function.\n\n EXAMPLES::\n\n sage: tanh(3.1415)\n 0.996271386633702\n sage: tan(3.1415/4)\n 0.999953674278156\n\n sage: # needs sage.symbolic\n ... |
class Function_coth(GinacFunction):
def __init__(self):
'\n The hyperbolic cotangent function.\n\n EXAMPLES::\n\n sage: coth(3.1415)\n 1.00374256795520\n sage: coth(complex(1, 2)) # abs tol 1e-15 # needs sage.rings.complex_d... |
class Function_sech(GinacFunction):
def __init__(self):
'\n The hyperbolic secant function.\n\n EXAMPLES::\n\n sage: sech(3.1415)\n 0.0862747018248192\n\n sage: # needs sage.symbolic\n sage: sech(pi)\n sech(pi)\n sage: float(... |
class Function_csch(GinacFunction):
def __init__(self):
'\n The hyperbolic cosecant function.\n\n EXAMPLES::\n\n sage: csch(3.1415)\n 0.0865975907592133\n\n sage: # needs sage.symbolic\n sage: csch(pi)\n csch(pi)\n sage: floa... |
class Function_arcsinh(GinacFunction):
def __init__(self):
"\n The inverse of the hyperbolic sine function.\n\n EXAMPLES::\n\n sage: asinh\n arcsinh\n sage: asinh(0.5)\n 0.481211825059603\n sage: asinh(1/2) ... |
class Function_arccosh(GinacFunction):
def __init__(self):
"\n The inverse of the hyperbolic cosine function.\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: acosh(1/2)\n arccosh(1/2)\n sage: acosh(1 + I*1.0)\n 1.06127506190504 +... |
class Function_arctanh(GinacFunction):
def __init__(self):
"\n The inverse of the hyperbolic tangent function.\n\n EXAMPLES::\n\n sage: atanh(0.5)\n 0.549306144334055\n sage: atanh(1/2) # needs sage.... |
class Function_arccoth(GinacFunction):
def __init__(self):
'\n The inverse of the hyperbolic cotangent function.\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: acoth(2.0)\n 0.549306144334055\n sage: acoth(2)\n 1/2*log(3)\n ... |
class Function_arcsech(GinacFunction):
def __init__(self):
'\n The inverse of the hyperbolic secant function.\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: asech(0.5)\n 1.31695789692482\n sage: asech(1/2)\n arcsech(1/2)\n ... |
class Function_arccsch(GinacFunction):
def __init__(self):
'\n The inverse of the hyperbolic cosecant function.\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: acsch(2.0)\n 0.481211825059603\n sage: acsch(2)\n arccsch(2)\n ... |
def rational_param_as_tuple(x):
'\n Utility function for converting rational `\\,_pF_q` parameters to\n tuples (which mpmath handles more efficiently).\n\n EXAMPLES::\n\n sage: from sage.functions.hypergeometric import rational_param_as_tuple\n sage: rational_param_as_tuple(1/2)\n (1... |
class Hypergeometric(BuiltinFunction):
'\n Represent a (formal) generalized infinite hypergeometric series.\n\n It is defined as\n\n .. MATH::\n\n \\,_pF_q(a_1, \\ldots, a_p; b_1, \\ldots, b_q; z)\n = \\sum_{n=0}^{\\infty} \\frac{(a_1)_n \\cdots (a_p)_n}{(b_1)_n\n \\cdots(b_q)_n} \\,... |
def closed_form(hyp):
"\n Try to evaluate ``hyp`` in closed form using elementary\n (and other simple) functions.\n\n It may be necessary to call :meth:`Hypergeometric.deflated` first to\n find some closed forms.\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: from sage.functio... |
class Hypergeometric_M(BuiltinFunction):
'\n The confluent hypergeometric function of the first kind,\n `y = M(a,b,z)`, is defined to be the solution to Kummer\'s differential\n equation\n\n .. MATH::\n\n zy\'\' + (b-z)y\' - ay = 0.\n\n This is not the same as Kummer\'s `U`-hypergeometric fu... |
class Hypergeometric_U(BuiltinFunction):
'\n The confluent hypergeometric function of the second kind,\n `y = U(a,b,z)`, is defined to be the solution to Kummer\'s differential\n equation\n\n .. MATH::\n\n zy\'\' + (b-z)y\' - ay = 0.\n\n This satisfies `U(a,b,z) \\sim z^{-a}`, as\n `... |
class Jacobi(BuiltinFunction):
'\n Base class for the Jacobi elliptic functions.\n '
def __init__(self, kind):
'\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: from sage.functions.jacobi import Jacobi\n sage: Jacobi(\'sn\')\n jacobi_sn\n\n ... |
class InverseJacobi(BuiltinFunction):
'\n Base class for the inverse Jacobi elliptic functions.\n '
def __init__(self, kind):
"\n Initialize ``self``.\n\n EXAMPLES::\n\n sage: from sage.functions.jacobi import InverseJacobi\n sage: InverseJacobi('sn')\n ... |
def jacobi(kind, z, m, **kwargs):
"\n The 12 Jacobi elliptic functions.\n\n INPUT:\n\n - ``kind`` -- a string of the form ``'pq'``, where ``p``, ``q`` are in\n ``c``, ``d``, ``n``, ``s``\n - ``z`` -- a complex number\n - ``m`` -- a complex number; note that `m = k^2`, where `k` is\n the e... |
def inverse_jacobi(kind, x, m, **kwargs):
"\n The inverses of the 12 Jacobi elliptic functions. They have the property\n that\n\n .. MATH::\n\n \\operatorname{pq}(\\operatorname{arcpq}(x|m)|m) =\n \\operatorname{pq}(\\operatorname{pq}^{-1}(x|m)|m) = x.\n\n INPUT:\n\n - ``kind`` -- a s... |
class JacobiAmplitude(BuiltinFunction):
'\n The Jacobi amplitude function\n `\\operatorname{am}(x|m) = \\int_0^x \\operatorname{dn}(t|m) dt` for\n `-K(m) \\leq x \\leq K(m)`, `F(\\operatorname{am}(x|m)|m) = x`.\n '
def __init__(self):
'\n TESTS::\n\n sage: from sage.func... |
def inverse_jacobi_f(kind, x, m):
"\n Internal function for numerical evaluation of a continuous complex branch\n of each inverse Jacobi function, as described in [Tee1997]_. Only accepts\n real arguments.\n\n TESTS::\n\n sage: from mpmath import ellipfun, chop ... |
def jacobi_am_f(x, m):
"\n Internal function for numeric evaluation of the Jacobi amplitude function\n for real arguments. Procedure described in [Eh2013]_.\n\n TESTS::\n\n sage: # needs mpmath\n sage: from mpmath import ellipf\n sage: from sage.functions.jacobi import jacobi_am_f\n ... |
class Function_exp(GinacFunction):
"\n The exponential function, `\\exp(x) = e^x`.\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: exp(-1)\n e^(-1)\n sage: exp(2)\n e^2\n sage: exp(2).n(100)\n 7.3890560989306502272304274606\n sage: exp(x^2 + log... |
class Function_log1(GinacFunction):
"\n The natural logarithm of ``x``.\n\n See :meth:`log()` for extensive documentation.\n\n EXAMPLES::\n\n sage: ln(e^2) # needs sage.symbolic\n 2\n sage: ln(2) ... |
class Function_log2(GinacFunction):
'\n Return the logarithm of x to the given base.\n\n See :meth:`log() <sage.functions.log.log>` for extensive documentation.\n\n EXAMPLES::\n\n sage: from sage.functions.log import logb\n sage: logb(1000, 10) ... |
class Function_polylog(GinacFunction):
def __init__(self):
"\n The polylog function\n `\\text{Li}_s(z) = \\sum_{k=1}^{\\infty} z^k / k^s`.\n\n The first argument is `s` (usually an integer called the weight)\n and the second argument is `z`: ``polylog(s, z)``.\n\n This ... |
class Function_dilog(GinacFunction):
def __init__(self):
"\n The dilogarithm function\n `\\text{Li}_2(z) = \\sum_{k=1}^{\\infty} z^k / k^2`.\n\n This is simply an alias for ``polylog(2, z)``.\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: dilog(1)... |
class Function_lambert_w(BuiltinFunction):
'\n The integral branches of the Lambert W function `W_n(z)`.\n\n This function satisfies the equation\n\n .. MATH::\n\n z = W_n(z) e^{W_n(z)}\n\n INPUT:\n\n - ``n`` -- an integer. `n=0` corresponds to the principal branch.\n\n - ``z`` -- a compl... |
class Function_exp_polar(BuiltinFunction):
def __init__(self):
"\n Representation of a complex number in a polar form.\n\n INPUT:\n\n - ``z`` -- a complex number `z = a + ib`.\n\n OUTPUT:\n\n A complex number with modulus `\\exp(a)` and argument `b`.\n\n If `-\\p... |
class Function_harmonic_number_generalized(BuiltinFunction):
"\n Harmonic and generalized harmonic number functions,\n defined by:\n\n .. MATH::\n\n H_{n}=H_{n,1}=\\sum_{k=1}^n\\frac{1}{k}\n\n H_{n,m}=\\sum_{k=1}^n\\frac{1}{k^m}\n\n They are also well-defined for complex argument, throug... |
class _Function_swap_harmonic(BuiltinFunction):
"\n Harmonic number function with swapped arguments. For internal use only.\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: maxima(harmonic_number(x, 2)) # maxima expect interface\n gen_harmonic_number(2,_SAGE_VAR_x)\n sage:... |
class Function_harmonic_number(BuiltinFunction):
'\n Harmonic number function, defined by:\n\n .. MATH::\n\n H_{n}=H_{n,1}=\\sum_{k=1}^n\\frac1k\n\n H_{s}=\\int_0^1\\frac{1-x^s}{1-x}\n\n See the docstring for :meth:`Function_harmonic_number_generalized`.\n\n This class exists as callback... |
class MinMax_base(BuiltinFunction):
def eval_helper(self, this_f, builtin_f, initial_val, args):
'\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: max_symbolic(3, 5, x) # indirect doctest\n max(x, 5)\n sage: max_symbolic([5.0r]) # indirect doctes... |
class MaxSymbolic(MinMax_base):
def __init__(self):
'\n Symbolic `\\max` function.\n\n The Python builtin :func:`max` function does not work as expected when symbolic\n expressions are given as arguments. This function delays evaluation\n until all symbolic arguments are subst... |
class MinSymbolic(MinMax_base):
def __init__(self):
'\n Symbolic `\\min` function.\n\n The Python builtin :func:`min` function does not work as expected when symbolic\n expressions are given as arguments. This function delays evaluation\n until all symbolic arguments are subst... |
class OrthogonalFunction(BuiltinFunction):
'\n Base class for orthogonal polynomials.\n\n This class is an abstract base class for all orthogonal polynomials since\n they share similar properties. The evaluation as a polynomial\n is either done via maxima, or with pynac.\n\n Convention: The first a... |
class ChebyshevFunction(OrthogonalFunction):
'\n Abstract base class for Chebyshev polynomials of the first and second kind.\n\n EXAMPLES::\n\n sage: chebyshev_T(3, x) # needs sage.symbolic\n 4*x^3 - 3*x\n '
def __call__(self, n, ... |
class Func_chebyshev_T(ChebyshevFunction):
"\n Chebyshev polynomials of the first kind.\n\n REFERENCE:\n\n - [AS1964]_ 22.5.31 page 778 and 6.1.22 page 256.\n\n EXAMPLES::\n\n sage: chebyshev_T(5, x) # needs sage.symbolic\n 16*x^5 - ... |
class Func_chebyshev_U(ChebyshevFunction):
'\n Class for the Chebyshev polynomial of the second kind.\n\n REFERENCE:\n\n - [AS1964]_ 22.8.3 page 783 and 6.1.22 page 256.\n\n EXAMPLES::\n\n sage: R.<t> = QQ[]\n sage: chebyshev_U(2,t)\n 4*t^2 - 1\n sage: chebyshev_U(3,t)\n ... |
class Func_legendre_P(GinacFunction):
'\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: legendre_P(4, 2.0)\n 55.3750000000000\n sage: legendre_P(1, x)\n x\n sage: legendre_P(4, x + 1)\n 35/8*(x + 1)^4 - 15/4*(x + 1)^2 + 3/8\n sage: legendre_P(1/2, I+... |
class Func_legendre_Q(BuiltinFunction):
def __init__(self):
'\n EXAMPLES::\n\n sage: loads(dumps(legendre_Q))\n legendre_Q\n sage: maxima(legendre_Q(20, x, hold=True))._sage_().coefficient(x, 10) # needs sage.symbolic\n -29113619535/131072*log(-(x +... |
class Func_assoc_legendre_P(BuiltinFunction):
'\n Return the Ferrers function `\\mathtt{P}_n^m(x)` of first kind for\n `x \\in (-1,1)` with general order `m` and general degree `n`.\n\n Ferrers functions of first kind are one of two linearly independent\n solutions of the associated Legendre different... |
class Func_assoc_legendre_Q(BuiltinFunction):
def __init__(self):
'\n EXAMPLES::\n\n sage: loads(dumps(gen_legendre_Q))\n gen_legendre_Q\n sage: maxima(gen_legendre_Q(2, 1, 3, hold=True))._sage_().simplify_full() # needs sage.symbolic\n 1/4*sqrt(2)*(36... |
class Func_hermite(GinacFunction):
"\n Return the Hermite polynomial for integers `n > -1`.\n\n REFERENCE:\n\n - [AS1964]_ 22.5.40 and 22.5.41, page 779.\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: x = PolynomialRing(QQ, 'x').gen()\n sage: hermite(2, x)\n 4*x^2 -... |
class Func_jacobi_P(OrthogonalFunction):
"\n Return the Jacobi polynomial `P_n^{(a,b)}(x)` for integers\n `n > -1` and a and b symbolic or `a > -1` and `b > -1`.\n\n The Jacobi polynomials are actually defined for all `a` and `b`.\n However, the Jacobi polynomial weight `(1-x)^a(1+x)^b` is not\n in... |
class Func_ultraspherical(GinacFunction):
'\n Return the ultraspherical (or Gegenbauer) polynomial ``gegenbauer(n,a,x)``,\n\n .. MATH::\n\n C_n^{a}(x) = \\sum_{k=0}^{\\lfloor n/2\\rfloor} (-1)^k\n \\frac{\\Gamma(n-k+a)}{\\Gamma(a)k!(n-2k)!} (2x)^{n-2k}.\n\n When `n` is a nonnegative integer... |
class Func_laguerre(OrthogonalFunction):
'\n REFERENCE:\n\n - [AS1964]_ 22.5.16, page 778 and page 789.\n '
def __init__(self):
"\n Init method for the Laguerre polynomials.\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: n, x = var('n,x')\n ... |
class Func_gen_laguerre(OrthogonalFunction):
'\n REFERENCE:\n\n - [AS1964]_ 22.5.16, page 778 and page 789.\n '
def __init__(self):
"\n Init method for the Laguerre polynomials.\n\n EXAMPLES::\n\n sage: # needs sage.symbolic\n sage: a, n, x = var('a, n, x'... |
class Func_krawtchouk(OrthogonalFunction):
"\n Krawtchouk polynomials `K_j(x; n, p)`.\n\n INPUT:\n\n - ``j`` -- the degree\n - ``x`` -- the independent variable `x`\n - ``n`` -- the number of discrete points\n - ``p`` -- the parameter `p`\n\n .. SEEALSO::\n\n :func:`sage.coding.delsart... |
class Func_meixner(OrthogonalFunction):
'\n Meixner polynomials `M_n(x; b, c)`.\n\n INPUT:\n\n - ``n`` -- the degree\n - ``x`` -- the independent variable `x`\n - ``b, c`` -- the parameters `b, c`\n '
def __init__(self):
"\n Initialize ``self``.\n\n EXAMPLES::\n\n ... |
class Func_hahn(OrthogonalFunction):
"\n Hahn polynomials `Q_k(x; a, b, n)`.\n\n INPUT:\n\n - ``k`` -- the degree\n - ``x`` -- the independent variable `x`\n - ``a, b`` -- the parameters `a, b`\n - ``n`` -- the number of discrete points\n\n EXAMPLES:\n\n We verify the orthogonality for `n ... |
class Function_abs(GinacFunction):
def __init__(self):
"\n The absolute value function.\n\n EXAMPLES::\n\n sage: abs(-2)\n 2\n\n sage: # needs sage.symbolic\n sage: var('x y')\n (x, y)\n sage: abs(x)\n abs(x)\n ... |
def _eval_floor_ceil(self, x, method, bits=0, **kwds):
'\n Helper function to compute ``floor(x)`` or ``ceil(x)``.\n\n INPUT:\n\n - ``x`` -- a number\n\n - ``method`` -- should be either ``"floor"`` or ``"ceil"``\n\n - ``bits`` -- how many bits to use before giving up\n\n See :class:`Function_fl... |
class Function_ceil(BuiltinFunction):
def __init__(self):
"\n The ceiling function.\n\n The ceiling of `x` is computed in the following manner.\n\n\n #. The ``x.ceil()`` method is called and returned if it\n is there. If it is not, then Sage checks if `x` is one of\n ... |
class Function_floor(BuiltinFunction):
def __init__(self):
"\n The floor function.\n\n The floor of `x` is computed in the following manner.\n\n\n #. The ``x.floor()`` method is called and returned if\n it is there. If it is not, then Sage checks if `x` is one\n o... |
class Function_Order(GinacFunction):
def __init__(self):
"\n The order function.\n\n This function gives the order of magnitude of some expression,\n similar to `O`-terms.\n\n .. SEEALSO::\n\n :meth:`~sage.symbolic.expression.Expression.Order`,\n :mod:`~s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.