Elsevier Science Home
Computer Physics Communications Program Library
Full text online from Science Direct
Programs in Physics & Physical Chemistry
CPC Home

[Licence| Download | New Version Template] aehe_v1_0.tar.gz(302 Kbytes)
Manuscript Title: A New Fortran 90 Program to Compute Regular and Irregular Associated Legendre Functions
Authors: Barry I. Schneider, Javier Segura, Amparo Gil, Xiaoxu Guan, Klaus Bartschat
Program title: Associated Legendre Functions
Catalogue identifier: AEHE_v1_0
Distribution format: tar.gz
Journal reference: Comput. Phys. Commun. 181(2010)2091
Programming language: Fortran 90.
Computer: Linux systems.
Operating system: Linux.
RAM: bytes
Keywords: Associated Legendre Functions, Recursion Relations, Miller's Algorithm, Continued Fractions.
Classification: 4.7.

Nature of problem:
Compute the regular and irregular associated Legendre functions for integer values of the degree and order and for all real arguments. The computation of the interaction of two electrons, 1/|r1 - r2|, in prolate spheroidal coordinates is used as one example where these functions are required for all values of the argument and we are able to easily compare the series expansion in associated Legendre functions and the exact value.

Solution method:
The code evaluates the regular and irregular associated Legendre functions using forward recursion when |x| < 1 starting the recursion with the analytically known values of the first two members of the sequence. For values of the argument |x| < 1, the upward recursion over the degree for the regular functions is numerically stable. For the irregular functions, backward recursion must be applied and a suitable method of starting the recursion is required. The program has two options; a modified version of Miller's algorithm and the use of the wronskian relation between the regular and irregular functions, which was the method considered in [1]. Both approaches require the computation of a continued fraction to begin the recursion. The wronskian method (which can also be described as a modified Miller's method) is a convenient method of computations when both the regular and irregular functions are needed.

Running time:
The example tests provided take a few seconds to run.

[1] A. Gil, J. Segura A code to evaluate prolate and oblate spheroidal harmonics Comput. Phys. Commun. 108 (1998) 267-278