Download Miller Thesis - Center for Quantum Devices

Transcript
if ( n == 1) return ( - x +1.0) ;
L = ( double *) malloc ( ( size_t ) ( n +5) * sizeof ( double ) ) ;
* L = 1.0;
L += 1;
*( L ) = -x +1.0;
do
{
*( L +1) = * L *2 - *( L -1) - ( * L *(1+ x ) - *( L -1) ) /( jj +1.0) ;
jj += 1.0;
L += 1;
}
while ( jj < n ) ;
Lag = * L ;
free (L - n ) ;
return ( Lag ) ;
}
static double aLaguerre ( int n , double m , double x )
{
// This is the Associated Laguerre Polynomial as in Arfken p . 780
double * L ;
int j = 1;
double jj = 1.0;
double Lag ;
if ( n == 0) return (1.0) ;
if ( n == 1) return ( - x +1.0) ;
L = ( double *) malloc ( ( size_t ) ( n +5) * sizeof ( double ) ) ;
* L = 1.0;
L += 1;
*( L ) = -x + m +1.0;
do
{
*( L +1) = * L *(2* jj + m +1 - x ) /( jj +1) - *( L -1) *( jj + m ) /( jj +1) ;
jj += 1.0;
L += 1;
}
while ( jj < n ) ;
Lag = * L ;
free (L - n ) ;
return ( Lag ) ;
}
static double Pn ( double s , int n , double f , double binSize )
{ // This procedure integrates the curve as described in Pn
// binSize is the x - size of the trapezoids for integration
double b ;
double c = Laguerre (n ,0.0) ;
double i =1.0;
double Sum =0;
double t ;
double t2 ;
double nSmall = 0;
double SMALL = 1e -25; // 1e -50;
double ce ;
do
94