(*diabatic and   adiabatic approaches to Na Cl, a simplified one-electron picture. It is assumed that 
an extra-electron resides either on sodium or on chlorine. An empirical Hamiltonian is constructed that 
takes into account the main contributions to the energy depending on that. E11 and E22
are the corresponding mean energies, h is the non-diagonal element of the Hamiltonian matrix.
S is the overlap integral, modelled here to vanish at R=0 and R=infinity (as if the orbitals involved were 
of the s and p type). There is also a repulsion of the inner cores of the atoms. All quantities in a.u. *)
Clear[IP,EA,R,S,E11,E22,h,Ear,Egeom,Delta,Eplus,Eminus,hS,cplus,cminus]
IP=0.1888 (* ionization potential of Na*)
EA=0.1329  (*electron affinity of Cl*)

S=R*Exp[-R/2] (*modelling the overlap integral of the atomic orbitals of Na and of Cl. *)
E11=-IP+10*Exp[-R]-(EA+1/R)*S^2(*this comes from the model Hamiltonian in the form:
H=-IP*|i><i|-EA*|j><j|-1/R|j><j|+exp(-R)
which takes into account that the electron, when in the |i> atomic orbital of Na 
has the -IP energy and that the cores of the atoms repel; there are also some overlap dependent contributions
which become irrelevant for large distances R, but may be problematic for short ones*)

E22=-EA-1/R+10*Exp[-R]-IP*S^2 (*the same Hamiltonian says that the electron, when 
on Cl is bound by the electron affinity energy, and that in such a case the two ions attract,
and the cores repel *)
h=S*(-IP-EA-1/R+10*Exp[-R]) (*the non-diagonal Hamiltonian matrix element. Its form results from 
the assumed form of the Hamiltonian*)
Ear=(E11+E22)/2
Egeom=Sqrt[E11*E22]
Delta=(E11-E22)/2
Plot[{E11,E22},{R,3.,25.},PlotPoints->101,PlotStyle->{{GrayLevel[0.8],Thickness[0.005]},{GrayLevel[0.5],Thickness[0.005]}}](*equilibrium distance for NaCl is 5.33 A, and the depth of 0.157 au*)

Plot[E22,{R,5.20,5.30},PlotPoints->101](*this is to show precisely the ionic equilibrium distance*)

Plot[{E11,E22},{R,16.,19.},PlotPoints->101,PlotStyle->{{GrayLevel[0.8],Thickness[0.015]},{GrayLevel[0.5],Thickness[0.015]}}](*this is to show that the two diabatic curves (ionic and atomic)
 really intersect*)

Eplus=1/(1-S^2)(Ear-h*S-Sqrt[Delta^2+(h-S*Egeom)^2+
2*h*S*(Egeom-Ear)])
Eminus=1/(1-S^2)(Ear-h*S+Sqrt[Delta^2+(h-S*Egeom)^2+
2*h*S*(Egeom-Ear)])
Plot[{E11,E22,Eplus,Eminus},{R,3.,25.},PlotPoints->21,PlotStyle->{{GrayLevel[0.8],Thickness[0.005]},{GrayLevel[0.5],Thickness[0.005]},{Thickness[0.015]},{Thickness[0.01],Dashing[{0.05,0.025}]}}] (*the adiabatic and diabatic curves*)

Plot[{E11,E22,Eplus,Eminus},{R,17.,19.},PlotPoints->21,PlotStyle->{{GrayLevel[0.8],Thickness[0.005]},{GrayLevel[0.5],Thickness[0.005]},{Thickness[0.02]},{Thickness[0.015],Dashing[{0.1,0.025}]}}] (*this is to show just the crossing and avoided crossing*)

Plot[Eplus,{R,5.10,5.30},PlotPoints->101](*this is to show precisely the adiabatic ionic equilibrium distance*)

hS=h-S*E11
(*What about the mixing coefficients in the adiabatic wave function? cplus is the ratio of the coefficients
for the Eplus state, cminus for the Eminus state*)
cplus=1/hS*(Delta+Sqrt[Delta^2+hS*(h-S*E22)])
cminus=1/hS*(Delta-Sqrt[Delta^2+hS*(h-S*E22)])
Plot[{cminus,cplus},{R,15.,20.},PlotPoints->101,PlotStyle->{{Thickness[0.015]},{Thickness[0.01],Dashing[{0.05,0.025}]}}](*this is to show that the coefficients' ratio is zero or very large beyond the avoided crossing point. This means that beyond this point the adiabatic wave functions are practically the diabatic ones, 
and that there is an abrupt change of the chemical character at the avoided crossing*)

Plot[{cminus,cplus},{R,17.8,17.96},PlotPoints->41,PlotStyle->{{Thickness[0.015]},{Thickness[0.01],Dashing[{0.05,0.025}]}}](*this is to show that the coefficient ratio is -1 and 1 at the crossing point*)

Plot[{cminus,cplus},{R,3.,25.},PlotPoints->101,PlotStyle->{{Thickness[0.015]},{Thickness[0.01],Dashing[{0.05,0.025}]}}](*this is to show what happens to the ratio within the wide range of distances*)

Plot[{cminus,cplus},{R,5.,5.6},PlotPoints->101,PlotStyle->{{Thickness[0.015]},{Thickness[0.01],Dashing[{0.05,0.025}]}}] (*this is to show what happens to the ratio at the ionic equilibrium distance. It looks as if the contributions of the ionic and neutral forms are again similar (ratio about 2, and about -3). This, however, depends on the details of the overlap, which in this model are certainly poorly represented*)