Ticket #5996: 12428.patch

File 12428.patch, 2.6 KB (added by jrasch, 9 months ago)
  • sage/functions/wigner.py

    # HG changeset patch
    # User Jens Rasch <jyr2000@gmail.com>
    # Date 1244977722 -3600
    # Node ID a3427ba1dfd0b77e1b600cc0ab8180b1408d46e4
    # Parent  0d484bf601d041e7ea1c0089d819100f4db0ce70
    All functions now have doc tests, redundant functions
    test_calc_factlist() and test_bigDeltacoeff() have been removed.
    
    diff -r 0d484bf601d0 -r a3427ba1dfd0 sage/functions/wigner.py
    a b  
    4242_Factlist=[1] 
    4343 
    4444def _calc_factlist(nn): 
    45     if nn>=len(_Factlist): 
    46         for ii in range(len(_Factlist),nn+1): 
    47             _Factlist.append(_Factlist[ii-1]*ii) 
    48             #_Factlist.append(factorial(ii)) 
    49     #return _Factlist 
    50  
    51  
    52 def test_calc_factlist(nn): 
    5345    r""" 
    5446    Function calculates a list of precomputed factorials in order to 
    5547    massively accelerate future calculations of the various 
     
    6860 
    6961    Calculate list of factorials: 
    7062 
    71         sage: from sage.functions.wigner import test_calc_factlist 
    72         sage: test_calc_factlist(10) 
     63        sage: from sage.functions.wigner import _calc_factlist 
     64        sage: _calc_factlist(10) 
    7365        [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800] 
    7466    """ 
    75     _calc_factlist(nn) 
    76     return _Factlist[:nn+1] 
     67    if nn>=len(_Factlist): 
     68        for ii in range(len(_Factlist),nn+1): 
     69            _Factlist.append(_Factlist[ii-1]*ii) 
     70            #_Factlist.append(factorial(ii)) 
     71    return _Factlist[:Integer(nn)+1] 
     72 
    7773 
    7874 
    7975 
     
    353349 
    354350    double - Value of the Delta coefficient 
    355351 
     352 
     353    EXAMPLES: 
     354 
     355    Simple examples: 
     356 
     357        sage: from sage.functions.wigner import _bigDeltacoeff 
     358        sage: _bigDeltacoeff(1,1,1) 
     359        1/2*sqrt(1/6) 
     360 
    356361    """ 
    357362 
    358363    if(int(aa+bb-cc)!=(aa+bb-cc)): 
     
    384389    else: 
    385390        res=ressqrt 
    386391    return res 
    387  
    388    
    389 def test_bigDeltacoeff(aa,bb,cc,prec=None): 
    390     r""" 
    391     Test for the Delta coefficient of the 3 angular momenta for 
    392     Racah symbols. Also checks that the differences are of integer 
    393     value. 
    394  
    395     INPUT: 
    396  
    397      - aa - first angular momentum, integer or half integer 
    398      - bb - second angular momentum, integer or half integer 
    399      - cc - third angular momentum, integer or half integer 
    400      - prec - precision of the sqrt() calculation  
    401  
    402     OUTPUT: 
    403  
    404     double - Value of the Delta coefficient 
    405  
    406     EXAMPLES: 
    407  
    408     Simple examples: 
    409  
    410         sage: from sage.functions.wigner import test_bigDeltacoeff 
    411         sage: test_bigDeltacoeff(1,1,1) 
    412         1/2*sqrt(1/6) 
    413  
    414     """ 
    415  
    416     return _bigDeltacoeff(aa,bb,cc,prec) 
    417392   
    418393 
    419394