#
#	This Program calculates the matrix elements for the Hyperfine
#	Integraction.

#	Since only the first few coefficients are of interest, this
#       program is designed to calculate only the first few coefficients 
#	and is not intended for higher-order expansions. 

#
#	by T.C. Scott					(1988)
#
fix := proc(f) local a,g,i,terms,tt,tc,coffs,s;
	g := subs(exp(t/2) = exp(t)^(1/2), f);
	g := collect(g,t,distributed,normal);
g;
end:
#
read `Int`:
#
Select:=proc(n,l,choice,k,label)
	if (choice<>1) and (l<>0) then 
		k:= -l; label:=m.(abs(k)); 
	else 
		k:=l+1; label:=k;
	fi;
end:
#
#   Define Zero-order Eigenfunction (upper and lower components)
#
#
	ord:=2;
	Z:=1;
	a0:=1;
#
	n:=1; l:=0; mm:=0; choice:=1;
#
	Select(n,l,choice,'k','label');
	read Dirac.n.l.label.`.m`;
#
	R1:=0:R2:=0:
	for i from 0 to ord do
		R1:=R1 + (alp^(2*i))*R.1.i:
		R2:=R2 + (alp^(2*i))*R.2.i:
	od:
	arg:=taylor(R1*R2,alp,2*(ord+1)):
	arg:=convert(arg,polynom):
	arg:=fix(expand(arg)):
	Hyper:=-(A^2)*IIntd(arg,t)/lam:
	Hyper:=taylor(Hyper,alp,2*(ord+1)):
	Hyper0:=coeff(Hyper,alp,1);
	Hyper1:=coeff(Hyper,alp,3)/Hyper0;
	Hyper2:=expand(coeff(Hyper,alp,5)/Hyper0);
quit;
