13 m_nNuclei(nucleiPositions.n_rows),
14 m_nOrbitalsPerNuclei(4)
16 alpha = zeros(m_nOrbitalsPerNuclei);
28 int pIndex = p % m_nOrbitalsPerNuclei;
29 int qIndex = q % m_nOrbitalsPerNuclei;
30 int rIndex = r % m_nOrbitalsPerNuclei;
31 int sIndex = s % m_nOrbitalsPerNuclei;
33 int Rp = p / m_nOrbitalsPerNuclei;
34 int Rq = q / m_nOrbitalsPerNuclei;
35 int Rr = r / m_nOrbitalsPerNuclei;
36 int Rs = s / m_nOrbitalsPerNuclei;
39 double B = alpha[rIndex] + alpha[sIndex];
41 rowvec Ra = (alpha[pIndex]*
R.row(Rp) + alpha[qIndex]*
R.row(Rq))/A;
42 rowvec Rb = (alpha[rIndex]*
R.row(Rr) + alpha[sIndex]*
R.row(Rs))/B;
45 double t = (A*B/(A + B))*
dot(Ra-Rb,Ra-Rb);
52 double repulsionEnergy = 0;
53 for(uint i = 0; i < m_nNuclei; i++) {
54 for(uint j = i + 1; j < m_nNuclei; j++) {
55 rowvec Rij =
R.row(i) -
R.row(j);
56 repulsionEnergy += 1/sqrt(
dot(Rij, Rij));
59 return repulsionEnergy;
70 double f = 1.0/arg * erf(arg) *sqrt(acos(-1))/2.0;
84 int pIndex = p % m_nOrbitalsPerNuclei;
85 int qIndex = q % m_nOrbitalsPerNuclei;
87 double ap =
alpha(pIndex);
88 double aq =
alpha(qIndex);
90 double factor = ap*aq/(ap+aq);
92 int RpIndex = p / m_nOrbitalsPerNuclei;
93 int RqIndex = q / m_nOrbitalsPerNuclei;
95 rowvec Rp =
R.row(RpIndex);
96 rowvec Rq =
R.row(RqIndex);
98 double Rpq =
dot(Rp-Rq,Rp-Rq);
99 double expTerm = exp(-factor*Rpq);
100 double kin = 0.5*factor*(6-4*factor*Rpq)*pow(acos(-1)/(ap+aq),3.0/2.0)*expTerm;
113 int pIndex = p % m_nOrbitalsPerNuclei;
114 int qIndex = q % m_nOrbitalsPerNuclei;
116 double ap =
alpha(pIndex);
117 double aq =
alpha(qIndex);
119 double apPlusAq = ap + aq;
120 double oneOverApPlusAq = 1.0/(apPlusAq);
122 int RpIndex = p / m_nOrbitalsPerNuclei;
123 int RqIndex = q / m_nOrbitalsPerNuclei;
125 rowvec Rp =
R.row(RpIndex);
126 rowvec Rq =
R.row(RqIndex);
130 double Rpq =
dot(Rp-Rq,Rp-Rq);
131 double expTerm = exp(-ap*aq*oneOverApPlusAq*Rpq);
133 rowvec RP = (ap*Rp + aq*Rq)*oneOverApPlusAq;
135 double errorFunctionSum = 0;
137 for(uint i = 0; i < m_nNuclei; i++) {
141 double nucAtt = -2*Z*oneOverApPlusAq*acos(-1)*expTerm*errorFunctionSum;
147 int pIndex = p % m_nOrbitalsPerNuclei;
148 int qIndex = q % m_nOrbitalsPerNuclei;
150 double ap =
alpha(pIndex);
151 double aq =
alpha(qIndex);
153 double factor = 1.0/(ap+aq);
155 int RpIndex = p / m_nOrbitalsPerNuclei;
156 int RqIndex = q / m_nOrbitalsPerNuclei;
158 rowvec Rp =
R.row(RpIndex);
159 rowvec Rq =
R.row(RqIndex);
161 double Rpq =
dot(Rp-Rq,Rp-Rq);
162 double expTerm = exp(-ap*aq*factor*Rpq);
163 double overlap = pow(acos(-1)*factor,3.0/2.0)*expTerm;