ó
¡¼™\c           @  sp   d  d l  m Z m Z d  d l m Z m Z m Z d  d l m Z m	 Z	 m
 Z
 m Z m Z d „  Z d „  Z d S(   iÿÿÿÿ(   t   print_functiont   division(   t   St   pit   Rational(   t   assoc_laguerret   sqrtt   expt	   factorialt
   factorial2c         C  sá   t  t |  | | | g ƒ \ }  } } } |  d }  t d | | t d d ƒ d |  | d t |  d ƒ t t ƒ t d |  d | d ƒ ƒ } | | | t | | d ƒ t |  d | t d ƒ d d | | d ƒ S(   s>  
    Returns the radial wavefunction R_{nl} for a 3d isotropic harmonic
    oscillator.

    ``n``
        the "nodal" quantum number.  Corresponds to the number of nodes in
        the wavefunction.  n >= 0
    ``l``
        the quantum number for orbital angular momentum
    ``nu``
        mass-scaled frequency: nu = m*omega/(2*hbar) where `m` is the mass
        and `omega` the frequency of the oscillator.
        (in atomic units nu == omega/2)
    ``r``
        Radial coordinate

    Examples
    ========

    >>> from sympy.physics.sho import R_nl
    >>> from sympy import var
    >>> var("r nu l")
    (r, nu, l)
    >>> R_nl(0, 0, 1, r)
    2*2**(3/4)*exp(-r**2)/pi**(1/4)
    >>> R_nl(1, 0, 1, r)
    4*2**(1/4)*sqrt(3)*(3/2 - 2*r**2)*exp(-r**2)/(3*pi**(1/4))

    l, nu and r may be symbolic:

    >>> R_nl(0, 0, nu, r)
    2*2**(3/4)*sqrt(nu**(3/2))*exp(-nu*r**2)/pi**(1/4)
    >>> R_nl(0, l, 1, r)
    r**l*sqrt(2**(l + 3/2)*2**(l + 2)/factorial2(2*l + 1))*exp(-r**2)/pi**(1/4)

    The normalization of the radial wavefunction is:

    >>> from sympy import Integral, oo
    >>> Integral(R_nl(0, 0, 1, r)**2 * r**2, (r, 0, oo)).n()
    1.00000000000000
    >>> Integral(R_nl(1, 0, 1, r)**2 * r**2, (r, 0, oo)).n()
    1.00000000000000
    >>> Integral(R_nl(1, 1, 1, r)**2 * r**2, (r, 0, oo)).n()
    1.00000000000000

    i   i   i   (	   t   mapR   R   R   R   R   R	   R   R   (   t   nt   lt   nut   rt   C(    (    s0   lib/python2.7/site-packages/sympy/physics/sho.pyt   R_nl   s    /'
6*c         C  s   d |  | t  d d ƒ | S(   s  
    Returns the Energy of an isotropic harmonic oscillator

    ``n``
        the "nodal" quantum number
    ``l``
        the orbital angular momentum
    ``hw``
        the harmonic oscillator parameter.

    The unit of the returned value matches the unit of hw, since the energy is
    calculated as:

        E_nl = (2*n + l + 3/2)*hw

    Examples
    ========

    >>> from sympy.physics.sho import E_nl
    >>> from sympy import symbols
    >>> x, y, z = symbols('x, y, z')
    >>> E_nl(x, y, z)
    z*(2*x + y + 3/2)
    i   i   (   R   (   R   R   t   hw(    (    s0   lib/python2.7/site-packages/sympy/physics/sho.pyt   E_nlA   s    N(   t
   __future__R    R   t
   sympy.coreR   R   R   t   sympy.functionsR   R   R   R   R	   R   R   (    (    (    s0   lib/python2.7/site-packages/sympy/physics/sho.pyt   <module>   s   (	: