fi = Exp[-Pi*lam/4]*ParabolicCylinderD[-1/2+I*lam,-Exp[-I*Pi/4]*u]

fis = Exp[-Pi*lam/4]*ParabolicCylinderD[-1/2-I*lam,-Exp[I*Pi/4]*u]

fideriv= D[fi,u]

fisderiv= D[fis,u]

W= Sqrt[u^2/4+lam]

V = -D[W,u]/W

beta2 =(1/(2*W))*(fideriv+(I*W-V/2)*fi)*(fisderiv+(-I*W-V/2)*fis)

W2 = W +(3/8)*D[W,u]^2/W^3-(1/4)*D[W,{u,2}]/W^2

Expand[W2]

beta2W2 =(1/(2*Abs[W2]))*(fideriv+(I*W2-V/2)*fi)*(fisderiv+(-I*W2-V/2)*fis)

Plot[{beta2/.{lam->1},beta2W2/.{lam->1}},{u,-5,10}]

u0 = -5

delu = 10^(-2)

(* This is for both W0 and W2 betas *)

Data1 = Table[{N[u0+i*delu],Re[N[beta2/.{lam->1,u->u0+i*delu}]],Re[N[beta2W2/.{lam->1,u->u0+i*delu}]]},{i,0,1501}];

Data1[[1501,2]]

Export["C:\\Users\\anderson\\Research\\de Sitter States\\Dillon\\E_field_2_parameter_model\\beta2_plot\\beta2_Efield_lam_1.dat",Data1,"Table"]

(*  Now check the Wronskian condition. *)
Wron = Expand[I*fis*fideriv-I*fi*fisderiv]

Wron/.{lam->1,u->0}

N[Wron/.{lam->1,u->10}]

N[Wron/.{lam->1,u->0}]

N[Wron/.{lam->1,u->-10}]

N[Wron/.{lam->2,u->-10}]

N[Wron/.{lam->2,u->0}]

(*  Now compute alpha2 and check the difference. *)
alpha2 =(1/(2*W))*(fideriv+(-I*W-V/2)*fi)*(fisderiv+(I*W-V/2)*fis);

diff = Expand[alpha2-beta2]

N[diff/.{lam->1,u->-10}]

N[diff/.{lam->1,u->0}]

N[diff/.{lam->1,u->10}]

N[diff/.{lam->2,u->10}]

N[diff/.{lam->2,u->0}]

N[diff/.{lam->3,u->0}]

N[diff/.{lam->3,u->10}]

(* Now compute the superadiabatic particle number. *)

x = -Sqrt[2/(Pi*lam)]*u*Sqrt[u^2+4*lam]/4 - Sqrt[2*lam/Pi]*Log[u/(2*Sqrt[lam])+Sqrt[u^2/(4*lam)+1]]

(* NK is the superadiabatic particle number *)

Nk = Erfc[x]^2*Exp[-2*Pi*lam]/4

Plot[{beta2/.{lam->1},beta2W2/.{lam->1},Nk/.{lam->1}},{u,-5,10}]

Data2 = Table[{N[u0+i*delu],Re[N[beta2/.{lam->1,u->u0+i*delu}]],Re[N[beta2W2/.{lam->1,u->u0+i*delu}]],Re[N[Nk/.{lam->1,u->u0+i*delu}]]},{i,0,1501}];

Export["C:\\Users\\anderson\\Research\\de Sitter States\\Dillon\\E_field_2_parameter_model\\beta2_plot\\beta2_Efield_lam_1.dat",Data2,"Table"]

N[Exp[-2*Pi]]

(* This is for de Sitter with nu = 1 *)

N[1/(Exp[2*Pi]-1)]