修订版 | 16ef8baf4df572c8548c11251a8b26a8fd9cbe99 (tree) |
---|---|
时间 | 2011-11-24 04:07:51 |
作者 | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
CIS analytic force for NDDO series are is implemented. Parallerization is not carried out yet. #26396 #26626 #26630
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/MolDS/trunk@313 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -423,7 +423,8 @@ void Cndo2::DoesCIS(){ | ||
423 | 423 | |
424 | 424 | // elecState=0 means ground state |
425 | 425 | double Cndo2::GetElectronicEnergy(int elecState){ |
426 | - if(elecState==0){ | |
426 | + int groundState = 0; | |
427 | + if(elecState==groundState){ | |
427 | 428 | return this->elecEnergy; |
428 | 429 | } |
429 | 430 | else{ |
@@ -440,7 +441,7 @@ double Cndo2::GetElectronicEnergy(int elecState){ | ||
440 | 441 | ss << errorMessageGetElectronicEnergyNumberCISStates << numberExcitedStates << endl; |
441 | 442 | throw MolDSException(ss.str()); |
442 | 443 | } |
443 | - return this->elecEnergy + this->excitedEnergies[elecState+1]; | |
444 | + return this->elecEnergy + this->excitedEnergies[elecState-1]; | |
444 | 445 | } |
445 | 446 | } |
446 | 447 |
@@ -443,7 +443,6 @@ double Mndo::GetElectronCoreAttractionFirstDerivative(int atomAIndex, | ||
443 | 443 | return value; |
444 | 444 | } |
445 | 445 | |
446 | - | |
447 | 446 | void Mndo::CalcDiatomicOverlapInDiatomicFrame(double** diatomicOverlap, |
448 | 447 | Atom* atomA, |
449 | 448 | Atom* atomB){ |
@@ -778,30 +777,29 @@ void Mndo::CalcActiveSetVariablesQ(vector<MoIndexPair>* nonRedundantQIndeces, | ||
778 | 777 | vector<MoIndexPair>* redundantQIndeces){ |
779 | 778 | int numberAOs = this->molecule->GetTotalNumberAOs(); |
780 | 779 | int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2; |
781 | - int numberVir = numberAOs - numberOcc; | |
782 | 780 | int numberActiveOcc = Parameters::GetInstance()->GetActiveOccCIS(); |
783 | 781 | int numberActiveVir = Parameters::GetInstance()->GetActiveVirCIS(); |
784 | - for(int i=0; i<numberOcc; i++){ | |
785 | - bool isMoICIMO = numberOcc-numberActiveOcc<=i ? true : false; | |
786 | - for(int j=numberOcc; j<numberAOs; j++){ | |
787 | - bool isMoJCIMO = j<numberOcc+numberActiveVir ? true : false; | |
788 | - MoIndexPair moIndexPair = {i, j, isMoICIMO, isMoJCIMO}; | |
782 | + for(int moI=0; moI<numberOcc; moI++){ | |
783 | + bool isMoICIMO = numberOcc-numberActiveOcc<=moI ? true : false; | |
784 | + for(int moJ=numberOcc; moJ<numberAOs; moJ++){ | |
785 | + bool isMoJCIMO = moJ<numberOcc+numberActiveVir ? true : false; | |
786 | + MoIndexPair moIndexPair = {moI, moJ, isMoICIMO, isMoJCIMO}; | |
789 | 787 | nonRedundantQIndeces->push_back(moIndexPair); |
790 | 788 | } |
791 | 789 | } |
792 | - for(int i=numberOcc-numberActiveOcc; i<numberOcc; i++){ | |
790 | + for(int moI=numberOcc-numberActiveOcc; moI<numberOcc; moI++){ | |
793 | 791 | bool isMoICIMO = true; |
794 | - for(int j=i; j<numberOcc; j++){ | |
792 | + for(int moJ=moI; moJ<numberOcc; moJ++){ | |
795 | 793 | bool isMoJCIMO = true; |
796 | - MoIndexPair moIndexPair = {i, j, isMoICIMO, isMoJCIMO}; | |
794 | + MoIndexPair moIndexPair = {moI, moJ, isMoICIMO, isMoJCIMO}; | |
797 | 795 | redundantQIndeces->push_back(moIndexPair); |
798 | 796 | } |
799 | 797 | } |
800 | - for(int i=numberOcc; i<numberOcc+numberActiveVir; i++){ | |
798 | + for(int moI=numberOcc; moI<numberOcc+numberActiveVir; moI++){ | |
801 | 799 | bool isMoICIMO = true; |
802 | - for(int j=i; j<numberOcc+numberActiveVir; j++){ | |
800 | + for(int moJ=moI; moJ<numberOcc+numberActiveVir; moJ++){ | |
803 | 801 | bool isMoJCIMO = true; |
804 | - MoIndexPair moIndexPair = {i, j, isMoICIMO, isMoJCIMO}; | |
802 | + MoIndexPair moIndexPair = {moI, moJ, isMoICIMO, isMoJCIMO}; | |
805 | 803 | redundantQIndeces->push_back(moIndexPair); |
806 | 804 | } |
807 | 805 | } |
@@ -943,9 +941,9 @@ double Mndo::GetGammaNRElement(int moI, int moJ, int moK, int moL){ | ||
943 | 941 | double value=0.0; |
944 | 942 | if(moI==moK && moJ==moL){ |
945 | 943 | int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2; |
946 | - int nI = moI<numberOcc ? 2 : 1; | |
947 | - int nJ = moJ<numberOcc ? 2 : 1; | |
948 | - value = (energiesMO[moJ]-energiesMO[moI])/((double)(nJ-nI)); | |
944 | + double nI = moI<numberOcc ? 2.0 : 0.0; | |
945 | + double nJ = moJ<numberOcc ? 2.0 : 0.0; | |
946 | + value = (this->energiesMO[moJ]-this->energiesMO[moI])/(nJ-nI); | |
949 | 947 | } |
950 | 948 | return value; |
951 | 949 | } |
@@ -954,7 +952,7 @@ double Mndo::GetGammaNRElement(int moI, int moJ, int moK, int moL){ | ||
954 | 952 | double Mndo::GetGammaRElement(int moI, int moJ, int moK, int moL){ |
955 | 953 | double value=0.0; |
956 | 954 | if(moI==moK && moJ==moL){ |
957 | - value = moI==moJ ? 1 : energiesMO[moJ]-energiesMO[moI]; | |
955 | + value = moI==moJ ? 1.0 : this->energiesMO[moJ]-this->energiesMO[moI]; | |
958 | 956 | } |
959 | 957 | return value; |
960 | 958 | } |
@@ -964,9 +962,9 @@ double Mndo::GetNNRElement(int moI, int moJ, int moK, int moL){ | ||
964 | 962 | double value=0.0; |
965 | 963 | if(moI==moK && moJ==moL){ |
966 | 964 | int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2; |
967 | - int nI = moI<numberOcc ? 2 : 1; | |
968 | - int nJ = moJ<numberOcc ? 2 : 1; | |
969 | - value = ((double)(nJ-nI)); | |
965 | + double nI = moI<numberOcc ? 2.0 : 0.0; | |
966 | + double nJ = moJ<numberOcc ? 2.0 : 0.0; | |
967 | + value = (nJ-nI); | |
970 | 968 | } |
971 | 969 | return value; |
972 | 970 | } |
@@ -984,19 +982,22 @@ double Mndo::GetNRElement(int moI, int moJ, int moK, int moL){ | ||
984 | 982 | double Mndo::GetKNRElement(int moI, int moJ, int moK, int moL){ |
985 | 983 | double value=0.0; |
986 | 984 | int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2; |
987 | - int nI = moI<numberOcc ? 2 : 1; | |
988 | - int nJ = moJ<numberOcc ? 2 : 1; | |
989 | - int nK = moK<numberOcc ? 2 : 1; | |
990 | - int nL = moL<numberOcc ? 2 : 1; | |
985 | + int nI = moI<numberOcc ? 2 : 0; | |
986 | + int nJ = moJ<numberOcc ? 2 : 0; | |
987 | + int nK = moK<numberOcc ? 2 : 0; | |
988 | + int nL = moL<numberOcc ? 2 : 0; | |
991 | 989 | if(nI!=nJ && nK!=nL){ |
992 | 990 | value = 4.0*this->GetMolecularIntegralElement(moI, moJ, moK, moL, |
993 | - this->molecule, this->fockMatrix, NULL) | |
991 | + this->molecule, | |
992 | + this->fockMatrix, NULL) | |
994 | 993 | -1.0*this->GetMolecularIntegralElement(moI, moK, moJ, moL, |
995 | - this->molecule, this->fockMatrix, NULL) | |
994 | + this->molecule, | |
995 | + this->fockMatrix, NULL) | |
996 | 996 | -1.0*this->GetMolecularIntegralElement(moI, moL, moJ, moK, |
997 | - this->molecule, this->fockMatrix, NULL); | |
997 | + this->molecule, | |
998 | + this->fockMatrix, NULL); | |
998 | 999 | } |
999 | - return value; | |
1000 | + return 0.5*value; | |
1000 | 1001 | } |
1001 | 1002 | |
1002 | 1003 | // Dager of (45) in [PT_1996]. Note taht the (45) is real number. |
@@ -1008,23 +1009,26 @@ double Mndo::GetKRDagerElement(int moI, int moJ, int moK, int moL){ | ||
1008 | 1009 | double Mndo::GetKRElement(int moI, int moJ, int moK, int moL){ |
1009 | 1010 | double value=0.0; |
1010 | 1011 | int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2; |
1011 | - int nI = moI<numberOcc ? 2 : 1; | |
1012 | - int nJ = moJ<numberOcc ? 2 : 1; | |
1013 | - int nK = moK<numberOcc ? 2 : 1; | |
1014 | - int nL = moL<numberOcc ? 2 : 1; | |
1012 | + int nI = moI<numberOcc ? 2 : 0; | |
1013 | + int nJ = moJ<numberOcc ? 2 : 0; | |
1014 | + int nK = moK<numberOcc ? 2 : 0; | |
1015 | + int nL = moL<numberOcc ? 2 : 0; | |
1015 | 1016 | if(nI==nJ && nK!=nL){ |
1016 | 1017 | value = 4.0*this->GetMolecularIntegralElement(moI, moJ, moK, moL, |
1017 | - this->molecule, this->fockMatrix, NULL) | |
1018 | + this->molecule, | |
1019 | + this->fockMatrix, NULL) | |
1018 | 1020 | -1.0*this->GetMolecularIntegralElement(moI, moK, moJ, moL, |
1019 | - this->molecule, this->fockMatrix, NULL) | |
1021 | + this->molecule, | |
1022 | + this->fockMatrix, NULL) | |
1020 | 1023 | -1.0*this->GetMolecularIntegralElement(moI, moL, moJ, moK, |
1021 | - this->molecule, this->fockMatrix, NULL); | |
1024 | + this->molecule, | |
1025 | + this->fockMatrix, NULL); | |
1022 | 1026 | } |
1023 | - return value; | |
1027 | + return 0.5*value; | |
1024 | 1028 | } |
1025 | 1029 | |
1026 | 1030 | // see (9) in [PT_1997] |
1027 | -void Mndo::CalcDeltaVector(double* delta, int elecState){ | |
1031 | +void Mndo::CalcDeltaVector(double* delta, int exciteState){ | |
1028 | 1032 | int numberActiveOcc = Parameters::GetInstance()->GetActiveOccCIS(); |
1029 | 1033 | int numberActiveVir = Parameters::GetInstance()->GetActiveVirCIS(); |
1030 | 1034 | int numberActiveMO = numberActiveOcc + numberActiveVir; |
@@ -1033,24 +1037,18 @@ void Mndo::CalcDeltaVector(double* delta, int elecState){ | ||
1033 | 1037 | double value = 0.0; |
1034 | 1038 | if(r<numberActiveOcc){ |
1035 | 1039 | // r is active occupied MO |
1040 | + int rr=numberActiveOcc-(r+1); | |
1036 | 1041 | for(int a=0; a<numberActiveVir; a++){ |
1037 | - int slaterDeterminantIndex = this->GetSlaterDeterminantIndex(r,a); | |
1038 | - value -= pow(this->matrixCIS[elecState][slaterDeterminantIndex],2.0); | |
1039 | - //c.f. The index of each MO (r and a)is below: | |
1040 | - //int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2; | |
1041 | - //int moR = numberOcc - (slaterDeterminantIndex/numberActiveVir) -1; | |
1042 | - //int moA = numberOcc + (slaterDeterminantIndex%numberActiveVir); | |
1042 | + int slaterDeterminantIndex = this->GetSlaterDeterminantIndex(rr,a); | |
1043 | + value -= pow(this->matrixCIS[exciteState][slaterDeterminantIndex],2.0); | |
1043 | 1044 | } |
1044 | 1045 | } |
1045 | 1046 | else{ |
1046 | 1047 | // r is active virtual MO |
1048 | + int rr=r-numberActiveOcc; | |
1047 | 1049 | for(int i=0; i<numberActiveOcc; i++){ |
1048 | - int slaterDeterminantIndex = this->GetSlaterDeterminantIndex(i,(r-numberActiveOcc)); | |
1049 | - value += pow(this->matrixCIS[elecState][slaterDeterminantIndex],2.0); | |
1050 | - //c.f. The index of each MO (i and r)is below: | |
1051 | - //int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2; | |
1052 | - //int moI = numberOcc - (slaterDeterminantIndex/numberActiveVir) -1; | |
1053 | - //int moR = numberOcc + (slaterDeterminantIndex%numberActiveVir); | |
1050 | + int slaterDeterminantIndex = this->GetSlaterDeterminantIndex(i,rr); | |
1051 | + value += pow(this->matrixCIS[exciteState][slaterDeterminantIndex],2.0); | |
1054 | 1052 | } |
1055 | 1053 | } |
1056 | 1054 | delta[r] = value; |
@@ -1154,13 +1152,14 @@ double Mndo::GetSmallQElement(int moI, | ||
1154 | 1152 | int p = moP - numberOcc; |
1155 | 1153 | temp = 4.0*xiVir[p][mu]*eta[lambda][sigma] |
1156 | 1154 | -1.0*xiVir[p][lambda]*eta[sigma][mu] |
1157 | - -1.0*xiVir[p][sigma]*eta[lambda][mu]; | |
1155 | + -1.0*xiVir[p][sigma]*eta[lambda][mu]; | |
1158 | 1156 | value += twoElecInt*this->fockMatrix[moI][nu]*temp; |
1159 | 1157 | temp = 4.0*xiVir[p][sigma]*eta[nu][mu] |
1160 | 1158 | -1.0*xiVir[p][nu]*eta[mu][sigma] |
1161 | 1159 | -1.0*xiVir[p][mu]*eta[nu][sigma]; |
1162 | 1160 | value += twoElecInt*this->fockMatrix[moI][lambda]*temp; |
1163 | 1161 | } |
1162 | + } | |
1164 | 1163 | |
1165 | 1164 | if(mu!=nu && lambda!=sigma){ |
1166 | 1165 | if(isMoPOcc){ |
@@ -1187,7 +1186,6 @@ double Mndo::GetSmallQElement(int moI, | ||
1187 | 1186 | } |
1188 | 1187 | } |
1189 | 1188 | |
1190 | - } | |
1191 | 1189 | } |
1192 | 1190 | } |
1193 | 1191 | } |
@@ -1247,7 +1245,6 @@ void Mndo::CalcQVector(double* q, | ||
1247 | 1245 | double** xiOcc, |
1248 | 1246 | double** xiVir, |
1249 | 1247 | double** eta, |
1250 | - int elecState, | |
1251 | 1248 | vector<MoIndexPair> nonRedundantQIndeces, |
1252 | 1249 | vector<MoIndexPair> redundantQIndeces){ |
1253 | 1250 | MallocerFreer::GetInstance()->InitializeDoubleMatrix1d( |
@@ -1256,15 +1253,11 @@ void Mndo::CalcQVector(double* q, | ||
1256 | 1253 | |
1257 | 1254 | int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2; |
1258 | 1255 | int numberActiveOcc = Parameters::GetInstance()->GetActiveOccCIS(); |
1259 | - int moI = 0; | |
1260 | - int moJ = 0; | |
1261 | - bool isMoICIMO = false; | |
1262 | - bool isMoJCIMO = false; | |
1263 | 1256 | for(int i=0; i<nonRedundantQIndeces.size(); i++){ |
1264 | - moI = nonRedundantQIndeces[i].moI; | |
1265 | - moJ = nonRedundantQIndeces[i].moJ; | |
1266 | - isMoICIMO = nonRedundantQIndeces[i].isMoICIMO; | |
1267 | - isMoJCIMO = nonRedundantQIndeces[i].isMoJCIMO; | |
1257 | + int moI = nonRedundantQIndeces[i].moI; | |
1258 | + int moJ = nonRedundantQIndeces[i].moJ; | |
1259 | + bool isMoICIMO = nonRedundantQIndeces[i].isMoICIMO; | |
1260 | + bool isMoJCIMO = nonRedundantQIndeces[i].isMoJCIMO; | |
1268 | 1261 | if(!isMoICIMO && isMoJCIMO){ |
1269 | 1262 | q[i] = this->GetSmallQElement(moI, moJ, xiOcc, xiVir, eta); |
1270 | 1263 | } |
@@ -1281,8 +1274,8 @@ void Mndo::CalcQVector(double* q, | ||
1281 | 1274 | } |
1282 | 1275 | for(int i=0; i<redundantQIndeces.size(); i++){ |
1283 | 1276 | int r = nonRedundantQIndeces.size() + i; |
1284 | - moI = redundantQIndeces[i].moI; | |
1285 | - moJ = redundantQIndeces[i].moJ; | |
1277 | + int moI = redundantQIndeces[i].moI; | |
1278 | + int moJ = redundantQIndeces[i].moJ; | |
1286 | 1279 | if(moI == moJ){ |
1287 | 1280 | int rr = moI - (numberOcc-numberActiveOcc); |
1288 | 1281 | q[r] = delta[rr]; |
@@ -1290,10 +1283,9 @@ void Mndo::CalcQVector(double* q, | ||
1290 | 1283 | else{ |
1291 | 1284 | q[r] = this->GetSmallQElement(moI, moJ, xiOcc, xiVir, eta) |
1292 | 1285 | -this->GetSmallQElement(moJ, moI, xiOcc, xiVir, eta); |
1293 | - | |
1294 | 1286 | } |
1295 | 1287 | } |
1296 | - | |
1288 | + /* | |
1297 | 1289 | for(int i=0; i<nonRedundantQIndeces.size(); i++){ |
1298 | 1290 | printf("q[%d] = %e\n",i,q[i]); |
1299 | 1291 | } |
@@ -1301,18 +1293,17 @@ void Mndo::CalcQVector(double* q, | ||
1301 | 1293 | int r = nonRedundantQIndeces.size() + i; |
1302 | 1294 | printf("q[%d] = %e\n",r,q[r]); |
1303 | 1295 | } |
1304 | - | |
1296 | + */ | |
1305 | 1297 | } |
1306 | 1298 | |
1307 | 1299 | // see (43) and (45) in [PT_1996]. |
1308 | 1300 | // This method calculates "\Gamma_{NR} - K_{NR}". |
1309 | 1301 | // Note taht K_{NR} is not calculated. |
1310 | -// Note taht right upper part is only calulated because this matrix is symmetric. | |
1311 | 1302 | void Mndo::CalcKNRMatrix(double** kNR, vector<MoIndexPair> nonRedundantQIndeces){ |
1312 | 1303 | for(int i=0; i<nonRedundantQIndeces.size(); i++){ |
1313 | 1304 | int moI = nonRedundantQIndeces[i].moI; |
1314 | 1305 | int moJ = nonRedundantQIndeces[i].moJ; |
1315 | - for(int j=0; j<nonRedundantQIndeces.size(); j++){ | |
1306 | + for(int j=i; j<nonRedundantQIndeces.size(); j++){ | |
1316 | 1307 | int moK = nonRedundantQIndeces[j].moI; |
1317 | 1308 | int moL = nonRedundantQIndeces[j].moJ; |
1318 | 1309 | kNR[i][j] = this->GetGammaNRElement(moI, moJ, moK, moL) |
@@ -1340,7 +1331,7 @@ void Mndo::CalcKRDagerMatrix(double** kRDager, | ||
1340 | 1331 | } |
1341 | 1332 | |
1342 | 1333 | // right hand side of (54) in [PT_1996] |
1343 | -void Mndo::CaclAuxiliaryVector(double* y, | |
1334 | +void Mndo::CalcAuxiliaryVector(double* y, | |
1344 | 1335 | double* q, |
1345 | 1336 | double** kRDager, |
1346 | 1337 | vector<MoIndexPair> nonRedundantQIndeces, |
@@ -1351,11 +1342,9 @@ void Mndo::CaclAuxiliaryVector(double* y, | ||
1351 | 1342 | for(int i=0; i<nonRedundantQIndeces.size(); i++){ |
1352 | 1343 | int moI = nonRedundantQIndeces[i].moI; |
1353 | 1344 | int moJ = nonRedundantQIndeces[i].moJ; |
1354 | - y[i] += q[i]/this->GetNRElement(moI, moJ, moI, moJ); | |
1345 | + y[i] += q[i]/this->GetNNRElement(moI, moJ, moI, moJ); | |
1355 | 1346 | for(int j=0; j<redundantQIndeces.size(); j++){ |
1356 | 1347 | int k = nonRedundantQIndeces.size() + j; |
1357 | - int moK = redundantQIndeces[j].moI; | |
1358 | - int moL = redundantQIndeces[j].moJ; | |
1359 | 1348 | y[i] += kRDager[i][j]*q[k]; |
1360 | 1349 | } |
1361 | 1350 | } |
@@ -1390,8 +1379,7 @@ double Mndo::GetZMatrixForceElement(double* y, | ||
1390 | 1379 | int j = nonRedundantQIndeces.size() + i; |
1391 | 1380 | int moI = redundantQIndeces[i].moI; |
1392 | 1381 | int moJ = redundantQIndeces[i].moJ; |
1393 | - value +=(q[j] | |
1394 | - /this->GetGammaRElement(moI, moJ, moI, moJ)) | |
1382 | + value += (q[j]/this->GetGammaRElement(moI, moJ, moI, moJ)) | |
1395 | 1383 | *transposedFockMatrix[mu][moI] |
1396 | 1384 | *transposedFockMatrix[nu][moJ]; |
1397 | 1385 | } |
@@ -1400,9 +1388,10 @@ double Mndo::GetZMatrixForceElement(double* y, | ||
1400 | 1388 | |
1401 | 1389 | void Mndo::CalcXiMatrices(double** xiOcc, |
1402 | 1390 | double** xiVir, |
1403 | - int elecState, | |
1391 | + int exciteState, | |
1404 | 1392 | double** transposedFockMatrix){ |
1405 | 1393 | int numberAOs = this->molecule->GetTotalNumberAOs(); |
1394 | + int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2; | |
1406 | 1395 | int numberActiveOcc = Parameters::GetInstance()->GetActiveOccCIS(); |
1407 | 1396 | int numberActiveVir = Parameters::GetInstance()->GetActiveVirCIS(); |
1408 | 1397 | MallocerFreer::GetInstance()->InitializeDoubleMatrix2d( |
@@ -1412,22 +1401,22 @@ void Mndo::CalcXiMatrices(double** xiOcc, | ||
1412 | 1401 | // xiOcc |
1413 | 1402 | for(int p=0; p<numberActiveOcc; p++){ |
1414 | 1403 | for(int mu=0; mu<numberAOs; mu++){ |
1415 | - int slaterDeterminantIndex = 0; | |
1416 | 1404 | for(int a=0; a<numberActiveVir; a++){ |
1417 | - slaterDeterminantIndex = this->GetSlaterDeterminantIndex(p,a); | |
1418 | - xiOcc[p][mu] += this->matrixCIS[elecState][slaterDeterminantIndex] | |
1419 | - *transposedFockMatrix[mu][a]; | |
1405 | + int moA = numberOcc + a; | |
1406 | + int slaterDeterminantIndex = this->GetSlaterDeterminantIndex(p,a); | |
1407 | + xiOcc[p][mu] += this->matrixCIS[exciteState][slaterDeterminantIndex] | |
1408 | + *transposedFockMatrix[mu][moA]; | |
1420 | 1409 | } |
1421 | 1410 | } |
1422 | 1411 | } |
1423 | 1412 | // xiVir |
1424 | 1413 | for(int p=0; p<numberActiveVir; p++){ |
1425 | 1414 | for(int mu=0; mu<numberAOs; mu++){ |
1426 | - int slaterDeterminantIndex = 0; | |
1427 | 1415 | for(int i=0; i<numberActiveOcc; i++){ |
1428 | - slaterDeterminantIndex = this->GetSlaterDeterminantIndex(i,p); | |
1429 | - xiVir[p][mu] += this->matrixCIS[elecState][slaterDeterminantIndex] | |
1430 | - *transposedFockMatrix[mu][i]; | |
1416 | + int moI = numberOcc - (i+1); | |
1417 | + int slaterDeterminantIndex = this->GetSlaterDeterminantIndex(i,p); | |
1418 | + xiVir[p][mu] += this->matrixCIS[exciteState][slaterDeterminantIndex] | |
1419 | + *transposedFockMatrix[mu][moI]; | |
1431 | 1420 | } |
1432 | 1421 | } |
1433 | 1422 | } |
@@ -1441,11 +1430,6 @@ void Mndo::CalcZMatrixForce(vector<int> elecStates){ | ||
1441 | 1430 | throw MolDSException(ss.str()); |
1442 | 1431 | } |
1443 | 1432 | this->CheckZMatrixForce(elecStates); |
1444 | - int numberAOs = this->molecule->GetTotalNumberAOs(); | |
1445 | - int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2; | |
1446 | - int numberVir = numberAOs - numberOcc; | |
1447 | - int numberActiveOcc = Parameters::GetInstance()->GetActiveOccCIS(); | |
1448 | - int numberActiveVir = Parameters::GetInstance()->GetActiveVirCIS(); | |
1449 | 1433 | |
1450 | 1434 | // creat MO-index-pair for Q variables. |
1451 | 1435 | vector<MoIndexPair> nonRedundantQIndeces; |
@@ -1458,7 +1442,7 @@ void Mndo::CalcZMatrixForce(vector<int> elecStates){ | ||
1458 | 1442 | double** kNR = NULL; // K_{NR} matrix, see (45) in [PT_1996] |
1459 | 1443 | double** kRDager = NULL; // Dagar of K_{R} matrix, see (46) in [PT_1996] |
1460 | 1444 | double* y = NULL; // y-vector in (54) in [PT_1996] |
1461 | - double** transposedFockMatrix = NULL; // transposed CIS matrix | |
1445 | + double** transposedFockMatrix = NULL; // transposed Fock matrix | |
1462 | 1446 | double** xiOcc = NULL; |
1463 | 1447 | double** xiVir = NULL; |
1464 | 1448 | this->MallocTempMatrixForZMatrix(&delta, |
@@ -1475,28 +1459,27 @@ void Mndo::CalcZMatrixForce(vector<int> elecStates){ | ||
1475 | 1459 | this->TransposeFockMatrixMatrix(transposedFockMatrix); |
1476 | 1460 | this->CalcKNRMatrix(kNR, nonRedundantQIndeces); |
1477 | 1461 | this->CalcKRDagerMatrix(kRDager, nonRedundantQIndeces,redundantQIndeces); |
1462 | + int groundState=0; | |
1478 | 1463 | for(int n=0; n<elecStates.size(); n++){ |
1479 | - if(0 < elecStates[n]){ | |
1480 | - int elecState = elecStates[n]-1; | |
1481 | - this->CalcDeltaVector(delta, elecState); | |
1482 | - this->CalcXiMatrices(xiOcc, xiVir, elecState, transposedFockMatrix); | |
1464 | + if(groundState < elecStates[n]){ | |
1465 | + int exciteState = elecStates[n]-1; | |
1466 | + this->CalcDeltaVector(delta, exciteState); | |
1467 | + this->CalcXiMatrices(xiOcc, xiVir, exciteState, transposedFockMatrix); | |
1483 | 1468 | this->CalcQVector(q, |
1484 | 1469 | delta, |
1485 | 1470 | xiOcc, |
1486 | 1471 | xiVir, |
1487 | 1472 | this->etaMatrixForce[n], |
1488 | - elecState, | |
1489 | 1473 | nonRedundantQIndeces, |
1490 | 1474 | redundantQIndeces); |
1491 | - this->CaclAuxiliaryVector(y, q, kRDager, nonRedundantQIndeces, redundantQIndeces); | |
1475 | + this->CalcAuxiliaryVector(y, q, kRDager, nonRedundantQIndeces, redundantQIndeces); | |
1492 | 1476 | // solve (54) in [PT_1996] |
1493 | 1477 | MolDS_mkl_wrapper::LapackWrapper::GetInstance()->Dsysv(kNR, |
1494 | 1478 | y, |
1495 | 1479 | nonRedundantQIndeces.size()); |
1496 | - | |
1497 | 1480 | // calculate each element of Z matrix. |
1498 | - for(int mu=0; mu<numberAOs; mu++){ | |
1499 | - for(int nu=0; nu<numberAOs; nu++){ | |
1481 | + for(int mu=0; mu<this->molecule->GetTotalNumberAOs(); mu++){ | |
1482 | + for(int nu=0; nu<this->molecule->GetTotalNumberAOs(); nu++){ | |
1500 | 1483 | this->zMatrixForce[n][mu][nu] = this->GetZMatrixForceElement( |
1501 | 1484 | y, |
1502 | 1485 | q, |
@@ -1507,6 +1490,7 @@ void Mndo::CalcZMatrixForce(vector<int> elecStates){ | ||
1507 | 1490 | nu); |
1508 | 1491 | } |
1509 | 1492 | } |
1493 | + | |
1510 | 1494 | } |
1511 | 1495 | } |
1512 | 1496 | } |
@@ -1538,29 +1522,32 @@ void Mndo::CalcZMatrixForce(vector<int> elecStates){ | ||
1538 | 1522 | void Mndo::CalcEtaMatrixForce(vector<int> elecStates){ |
1539 | 1523 | this->CheckEtaMatrixForce(elecStates); |
1540 | 1524 | int numberAOs = this->molecule->GetTotalNumberAOs(); |
1525 | + int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2; | |
1541 | 1526 | int numberActiveOcc = Parameters::GetInstance()->GetActiveOccCIS(); |
1542 | 1527 | int numberActiveVir = Parameters::GetInstance()->GetActiveVirCIS(); |
1543 | - double** transposedFockMatrix = NULL; // transposed CIS matrix | |
1528 | + int groundState = 0; | |
1529 | + double** transposedFockMatrix = NULL; // transposed Fock matrix | |
1544 | 1530 | transposedFockMatrix = MallocerFreer::GetInstance()->MallocDoubleMatrix2d( |
1545 | 1531 | numberAOs, |
1546 | 1532 | numberAOs); |
1547 | 1533 | try{ |
1548 | 1534 | this->TransposeFockMatrixMatrix(transposedFockMatrix); |
1549 | 1535 | for(int n=0; n<elecStates.size(); n++){ |
1550 | - if(0 < elecStates[n]){ | |
1551 | - int elecState = elecStates[n]-1; | |
1536 | + if(groundState < elecStates[n]){ | |
1537 | + int exciteState = elecStates[n]-1; | |
1552 | 1538 | |
1553 | 1539 | // calc each element |
1554 | 1540 | for(int mu=0; mu<numberAOs; mu++){ |
1555 | 1541 | for(int nu=0; nu<numberAOs; nu++){ |
1556 | - int slaterDeterminantIndex = 0; | |
1557 | 1542 | for(int i=0; i<numberActiveOcc; i++){ |
1543 | + int moI = numberOcc-(i+1); | |
1558 | 1544 | for(int a=0; a<numberActiveVir; a++){ |
1559 | - slaterDeterminantIndex = this->GetSlaterDeterminantIndex(i,a); | |
1545 | + int moA = numberOcc+a; | |
1546 | + int slaterDeterminantIndex = this->GetSlaterDeterminantIndex(i,a); | |
1560 | 1547 | this->etaMatrixForce[n][mu][nu] |
1561 | - += this->matrixCIS[elecState][slaterDeterminantIndex] | |
1562 | - *transposedFockMatrix[mu][i] | |
1563 | - *transposedFockMatrix[nu][a]; | |
1548 | + += this->matrixCIS[exciteState][slaterDeterminantIndex] | |
1549 | + *transposedFockMatrix[mu][moI] | |
1550 | + *transposedFockMatrix[nu][moA]; | |
1564 | 1551 | } |
1565 | 1552 | } |
1566 | 1553 | } |
@@ -1595,11 +1582,8 @@ void Mndo::CalcForceHFElecCoreAttractionPart(double* force, | ||
1595 | 1582 | int atomBIndex, |
1596 | 1583 | double***** twoElecTwoCoreFirstDeriv){ |
1597 | 1584 | Atom* atomA = (*this->molecule->GetAtomVect())[atomAIndex]; |
1598 | - Atom* atomB = (*this->molecule->GetAtomVect())[atomBIndex]; | |
1599 | 1585 | int firstAOIndexA = atomA->GetFirstAOIndex(); |
1600 | - int firstAOIndexB = atomB->GetFirstAOIndex(); | |
1601 | 1586 | int numberAOsA = atomA->GetValence().size(); |
1602 | - int numberAOsB = atomB->GetValence().size(); | |
1603 | 1587 | for(int mu=firstAOIndexA; mu<firstAOIndexA+numberAOsA; mu++){ |
1604 | 1588 | for(int nu=firstAOIndexA; nu<firstAOIndexA+numberAOsA; nu++){ |
1605 | 1589 | for(int i=0; i<CartesianType_end; i++){ |
@@ -1681,6 +1665,130 @@ void Mndo::CalcForceHFTwoElecPart(double* force, | ||
1681 | 1665 | } |
1682 | 1666 | } |
1683 | 1667 | |
1668 | +void Mndo::CalcForceExcitedStaticPart(double* force, | |
1669 | + int elecStateIndex, | |
1670 | + int atomAIndex, | |
1671 | + int atomBIndex, | |
1672 | + double***** twoElecTwoCoreFirstDeriv){ | |
1673 | + Atom* atomA = (*this->molecule->GetAtomVect())[atomAIndex]; | |
1674 | + Atom* atomB = (*this->molecule->GetAtomVect())[atomBIndex]; | |
1675 | + int firstAOIndexA = atomA->GetFirstAOIndex(); | |
1676 | + int firstAOIndexB = atomB->GetFirstAOIndex(); | |
1677 | + int numberAOsA = atomA->GetValence().size(); | |
1678 | + int numberAOsB = atomB->GetValence().size(); | |
1679 | + for(int mu=firstAOIndexA; mu<firstAOIndexA+numberAOsA; mu++){ | |
1680 | + for(int nu=firstAOIndexA; nu<firstAOIndexA+numberAOsA; nu++){ | |
1681 | + for(int lambda=firstAOIndexB; lambda<firstAOIndexB+numberAOsB; lambda++){ | |
1682 | + for(int sigma=firstAOIndexB; sigma<firstAOIndexB+numberAOsB; sigma++){ | |
1683 | + for(int i=0; i<CartesianType_end; i++){ | |
1684 | + double temp= 2.0*this->etaMatrixForce[elecStateIndex][mu][nu] | |
1685 | + *this->etaMatrixForce[elecStateIndex][lambda][sigma] | |
1686 | + -1.0*this->etaMatrixForce[elecStateIndex][mu][lambda] | |
1687 | + *this->etaMatrixForce[elecStateIndex][nu][sigma]; | |
1688 | + force[i] += temp | |
1689 | + *twoElecTwoCoreFirstDeriv[mu-firstAOIndexA] | |
1690 | + [nu-firstAOIndexA] | |
1691 | + [lambda-firstAOIndexB] | |
1692 | + [sigma-firstAOIndexB] | |
1693 | + [i]; | |
1694 | + } | |
1695 | + } | |
1696 | + } | |
1697 | + } | |
1698 | + } | |
1699 | +} | |
1700 | + | |
1701 | +void Mndo::CalcForceExcitedElecCoreAttractionPart(double* force, | |
1702 | + int elecStateIndex, | |
1703 | + int atomAIndex, | |
1704 | + int atomBIndex, | |
1705 | + double***** twoElecTwoCoreFirstDeriv){ | |
1706 | + Atom* atomA = (*this->molecule->GetAtomVect())[atomAIndex]; | |
1707 | + int firstAOIndexA = atomA->GetFirstAOIndex(); | |
1708 | + int numberAOsA = atomA->GetValence().size(); | |
1709 | + for(int mu=firstAOIndexA; mu<firstAOIndexA+numberAOsA; mu++){ | |
1710 | + for(int nu=firstAOIndexA; nu<firstAOIndexA+numberAOsA; nu++){ | |
1711 | + for(int i=0; i<CartesianType_end; i++){ | |
1712 | + force[i] += this->zMatrixForce[elecStateIndex][mu][nu] | |
1713 | + *this->GetElectronCoreAttractionFirstDerivative( | |
1714 | + atomAIndex, | |
1715 | + atomBIndex, | |
1716 | + mu-firstAOIndexA, | |
1717 | + nu-firstAOIndexA, | |
1718 | + twoElecTwoCoreFirstDeriv, | |
1719 | + (CartesianType)i); | |
1720 | + } | |
1721 | + } | |
1722 | + } | |
1723 | +} | |
1724 | + | |
1725 | +void Mndo::CalcForceExcitedOverlapPart(double* force, | |
1726 | + int elecStateIndex, | |
1727 | + int atomAIndex, | |
1728 | + int atomBIndex, | |
1729 | + double*** overlapDer){ | |
1730 | + Atom* atomA = (*this->molecule->GetAtomVect())[atomAIndex]; | |
1731 | + Atom* atomB = (*this->molecule->GetAtomVect())[atomBIndex]; | |
1732 | + int firstAOIndexA = atomA->GetFirstAOIndex(); | |
1733 | + int firstAOIndexB = atomB->GetFirstAOIndex(); | |
1734 | + int numberAOsA = atomA->GetValence().size(); | |
1735 | + int numberAOsB = atomB->GetValence().size(); | |
1736 | + for(int mu=firstAOIndexA; mu<firstAOIndexA+numberAOsA; mu++){ | |
1737 | + for(int nu=firstAOIndexB; nu<firstAOIndexB+numberAOsB; nu++){ | |
1738 | + double bondParameter = atomA->GetBondingParameter( | |
1739 | + this->theory, | |
1740 | + atomA->GetValence()[mu-firstAOIndexA]) | |
1741 | + +atomB->GetBondingParameter( | |
1742 | + this->theory, | |
1743 | + atomB->GetValence()[nu-firstAOIndexB]); | |
1744 | + bondParameter *= 0.5; | |
1745 | + for(int i=0; i<CartesianType_end; i++){ | |
1746 | + force[i] += this->zMatrixForce[elecStateIndex][mu][nu] | |
1747 | + *bondParameter | |
1748 | + *overlapDer[mu-firstAOIndexA][nu-firstAOIndexB][i]; | |
1749 | + } | |
1750 | + } | |
1751 | + } | |
1752 | +} | |
1753 | + | |
1754 | +void Mndo::CalcForceExcitedTwoElecPart(double* force, | |
1755 | + int elecStateIndex, | |
1756 | + int atomAIndex, | |
1757 | + int atomBIndex, | |
1758 | + double***** twoElecTwoCoreFirstDeriv){ | |
1759 | + Atom* atomA = (*this->molecule->GetAtomVect())[atomAIndex]; | |
1760 | + Atom* atomB = (*this->molecule->GetAtomVect())[atomBIndex]; | |
1761 | + int firstAOIndexA = atomA->GetFirstAOIndex(); | |
1762 | + int firstAOIndexB = atomB->GetFirstAOIndex(); | |
1763 | + int numberAOsA = atomA->GetValence().size(); | |
1764 | + int numberAOsB = atomB->GetValence().size(); | |
1765 | + for(int mu=firstAOIndexA; mu<firstAOIndexA+numberAOsA; mu++){ | |
1766 | + for(int nu=firstAOIndexA; nu<firstAOIndexA+numberAOsA; nu++){ | |
1767 | + for(int lambda=firstAOIndexB; lambda<firstAOIndexB+numberAOsB; lambda++){ | |
1768 | + for(int sigma=firstAOIndexB; sigma<firstAOIndexB+numberAOsB; sigma++){ | |
1769 | + for(int i=0; i<CartesianType_end; i++){ | |
1770 | + force[i] += this->zMatrixForce[elecStateIndex][mu][nu] | |
1771 | + *this->orbitalElectronPopulation[lambda][sigma] | |
1772 | + *twoElecTwoCoreFirstDeriv[mu-firstAOIndexA] | |
1773 | + [nu-firstAOIndexA] | |
1774 | + [lambda-firstAOIndexB] | |
1775 | + [sigma-firstAOIndexB] | |
1776 | + [i]; | |
1777 | + force[i] -= 0.50 | |
1778 | + *this->zMatrixForce[elecStateIndex][mu][lambda] | |
1779 | + *this->orbitalElectronPopulation[nu][sigma] | |
1780 | + *twoElecTwoCoreFirstDeriv[mu-firstAOIndexA] | |
1781 | + [nu-firstAOIndexA] | |
1782 | + [lambda-firstAOIndexB] | |
1783 | + [sigma-firstAOIndexB] | |
1784 | + [(CartesianType)i]; | |
1785 | + } | |
1786 | + } | |
1787 | + } | |
1788 | + } | |
1789 | + } | |
1790 | +} | |
1791 | + | |
1684 | 1792 | // electronicStateIndex is index of the electroinc eigen state. |
1685 | 1793 | // "electronicStateIndex = 0" means electronic ground state. |
1686 | 1794 | void Mndo::CalcForce(vector<int> elecStates){ |
@@ -1702,7 +1810,7 @@ void Mndo::CalcForce(vector<int> elecStates){ | ||
1702 | 1810 | OrbitalType_end, |
1703 | 1811 | CartesianType_end); |
1704 | 1812 | try{ |
1705 | - #pragma omp for schedule(auto) | |
1813 | + #pragma omp for schedule(auto) | |
1706 | 1814 | for(int a=0; a<this->molecule->GetAtomVect()->size(); a++){ |
1707 | 1815 | Atom* atomA = (*molecule->GetAtomVect())[a]; |
1708 | 1816 | int firstAOIndexA = atomA->GetFirstAOIndex(); |
@@ -1726,28 +1834,24 @@ void Mndo::CalcForce(vector<int> elecStates){ | ||
1726 | 1834 | coreRepulsion[i] += this->GetDiatomCoreRepulsionFirstDerivative( |
1727 | 1835 | a, b, (CartesianType)i); |
1728 | 1836 | } |
1729 | - | |
1730 | 1837 | // electron core attraction part (ground state) |
1731 | 1838 | double forceElecCoreAttPart[CartesianType_end] = {0.0,0.0,0.0}; |
1732 | 1839 | this->CalcForceHFElecCoreAttractionPart(forceElecCoreAttPart, |
1733 | 1840 | a, |
1734 | 1841 | b, |
1735 | 1842 | twoElecTwoCoreFirstDeriv); |
1736 | - | |
1737 | 1843 | // overlap part (ground state) |
1738 | 1844 | double forceOverlapPart[CartesianType_end] = {0.0,0.0,0.0}; |
1739 | 1845 | this->CalcForceHFOverlapPart(forceOverlapPart, |
1740 | 1846 | a, |
1741 | 1847 | b, |
1742 | 1848 | overlapDer); |
1743 | - | |
1744 | 1849 | // two electron part (ground state) |
1745 | 1850 | double forceTwoElecPart[CartesianType_end] = {0.0,0.0,0.0}; |
1746 | 1851 | this->CalcForceHFTwoElecPart(forceTwoElecPart, |
1747 | 1852 | a, |
1748 | 1853 | b, |
1749 | 1854 | twoElecTwoCoreFirstDeriv); |
1750 | - | |
1751 | 1855 | // sum up contributions from each part (ground state) |
1752 | 1856 | for(int n=0; n<elecStates.size(); n++){ |
1753 | 1857 | for(int i=0; i<CartesianType_end; i++){ |
@@ -1759,7 +1863,58 @@ void Mndo::CalcForce(vector<int> elecStates){ | ||
1759 | 1863 | +forceTwoElecPart[i]; |
1760 | 1864 | } |
1761 | 1865 | } |
1866 | + | |
1867 | + // excited state potential | |
1868 | + for(int n=0; n<elecStates.size(); n++){ | |
1869 | + if(0<elecStates[n]){ | |
1870 | + // static part | |
1871 | + double forceExcitedStaticPart[CartesianType_end] = {0.0,0.0,0.0}; | |
1872 | + this->CalcForceExcitedStaticPart(forceExcitedStaticPart, | |
1873 | + n, | |
1874 | + a, | |
1875 | + b, | |
1876 | + twoElecTwoCoreFirstDeriv); | |
1877 | + // sum up contributions from static part (excited state) | |
1878 | + for(int i=0; i<CartesianType_end; i++){ | |
1879 | + this->matrixForce[n][b][i] += forceExcitedStaticPart[i]; | |
1880 | + this->matrixForce[n][a][i] -= forceExcitedStaticPart[i]; | |
1881 | + } | |
1882 | + | |
1883 | + // response part | |
1884 | + // electron core attraction part (excited state) | |
1885 | + double forceExcitedElecCoreAttPart[CartesianType_end]={0.0,0.0,0.0}; | |
1886 | + this->CalcForceExcitedElecCoreAttractionPart( | |
1887 | + forceExcitedElecCoreAttPart, | |
1888 | + n, | |
1889 | + a, | |
1890 | + b, | |
1891 | + twoElecTwoCoreFirstDeriv); | |
1892 | + // overlap part (excited state) | |
1893 | + double forceExcitedOverlapPart[CartesianType_end] = {0.0,0.0,0.0}; | |
1894 | + this->CalcForceExcitedOverlapPart(forceExcitedOverlapPart, | |
1895 | + n, | |
1896 | + a, | |
1897 | + b, | |
1898 | + overlapDer); | |
1899 | + // two electron part (ground state) | |
1900 | + double forceExcitedTwoElecPart[CartesianType_end] = {0.0,0.0,0.0}; | |
1901 | + this->CalcForceExcitedTwoElecPart(forceExcitedTwoElecPart, | |
1902 | + n, | |
1903 | + a, | |
1904 | + b, | |
1905 | + twoElecTwoCoreFirstDeriv); | |
1906 | + // sum up contributions from response part (excited state) | |
1907 | + for(int i=0; i<CartesianType_end; i++){ | |
1908 | + this->matrixForce[n][b][i] += forceExcitedElecCoreAttPart[i]; | |
1909 | + this->matrixForce[n][b][i] += forceExcitedOverlapPart[i]; | |
1910 | + this->matrixForce[n][b][i] += forceExcitedTwoElecPart[i]; | |
1911 | + this->matrixForce[n][a][i] -= forceExcitedElecCoreAttPart[i]; | |
1912 | + this->matrixForce[n][a][i] -= forceExcitedOverlapPart[i]; | |
1913 | + this->matrixForce[n][a][i] -= forceExcitedTwoElecPart[i]; | |
1914 | + } | |
1762 | 1915 | |
1916 | + } | |
1917 | + } | |
1763 | 1918 | } |
1764 | 1919 | } |
1765 | 1920 | } |
@@ -118,7 +118,7 @@ private: | ||
118 | 118 | double*** xiVir, |
119 | 119 | int sizeQNR, |
120 | 120 | int sizeQR); |
121 | - void CalcDeltaVector(double* delta, int elecState); | |
121 | + void CalcDeltaVector(double* delta, int exciteState); | |
122 | 122 | double GetSmallQElement(int moI, |
123 | 123 | int moP, |
124 | 124 | double**xiOcc, |
@@ -129,7 +129,6 @@ private: | ||
129 | 129 | double** xiOcc, |
130 | 130 | double** xiVir, |
131 | 131 | double** eta, |
132 | - int elecState, | |
133 | 132 | std::vector<MoIndexPair> nonRedundantQIndeces, |
134 | 133 | std::vector<MoIndexPair> redundantQIndeces); |
135 | 134 | void TransposeFockMatrixMatrix(double** transposedFockMatrix); |
@@ -138,14 +137,14 @@ private: | ||
138 | 137 | void CalcKRDagerMatrix(double** kRDager, |
139 | 138 | std::vector<MoIndexPair> nonRedundantQIndeces, |
140 | 139 | std::vector<MoIndexPair> redundantQIndeces); |
141 | - void CaclAuxiliaryVector(double* y, | |
140 | + void CalcAuxiliaryVector(double* y, | |
142 | 141 | double* q, |
143 | 142 | double** kRDager, |
144 | 143 | std::vector<MoIndexPair> nonRedundantQIndeces, |
145 | 144 | std::vector<MoIndexPair> redundantQIndeces); |
146 | 145 | void CalcXiMatrices(double** xiOcc, |
147 | 146 | double** xiVir, |
148 | - int elecState, | |
147 | + int exciteState, | |
149 | 148 | double** transposedFockMatrix); |
150 | 149 | double GetZMatrixForceElement(double* y, |
151 | 150 | double* q, |
@@ -219,6 +218,26 @@ private: | ||
219 | 218 | int atomAIndex, |
220 | 219 | int atomBIndex, |
221 | 220 | double***** twoElecTwoCoreFirstDeriv); |
221 | + void CalcForceExcitedStaticPart(double* force, | |
222 | + int elecStateIndex, | |
223 | + int atomAIndex, | |
224 | + int atomBIndex, | |
225 | + double***** twoElecTwoCoreFirstDeriv); | |
226 | + void CalcForceExcitedElecCoreAttractionPart(double* force, | |
227 | + int elecStateIndex, | |
228 | + int atomAIndex, | |
229 | + int atomBIndex, | |
230 | + double***** twoElecTwoCoreFirstDeriv); | |
231 | + void CalcForceExcitedOverlapPart(double* force, | |
232 | + int elecStateIndex, | |
233 | + int atomAIndex, | |
234 | + int atomBIndex, | |
235 | + double*** overlapDer); | |
236 | + void CalcForceExcitedTwoElecPart(double* force, | |
237 | + int elecStateIndex, | |
238 | + int atomAIndex, | |
239 | + int atomBIndex, | |
240 | + double***** twoElecTwoCoreFirstDeriv); | |
222 | 241 | |
223 | 242 | }; |
224 | 243 |
@@ -1436,6 +1436,7 @@ void ZindoS::CheckMatrixForce(vector<int> elecStates){ | ||
1436 | 1436 | } |
1437 | 1437 | |
1438 | 1438 | // Note taht activeOccIndex and activeVirIndex are not MO's number. |
1439 | +// activeOccIndex=0 means HOMO and activeVirIndex=0 means LUMO. | |
1439 | 1440 | int ZindoS::GetSlaterDeterminantIndex(int activeOccIndex, |
1440 | 1441 | int activeVirIndex){ |
1441 | 1442 | return Parameters::GetInstance()->GetActiveVirCIS() |
@@ -1443,7 +1444,7 @@ int ZindoS::GetSlaterDeterminantIndex(int activeOccIndex, | ||
1443 | 1444 | +activeVirIndex; |
1444 | 1445 | } |
1445 | 1446 | |
1446 | -// electronicStates is indeces of the electroinc eigen states. | |
1447 | +// elecStates is indeces of the electroinc eigen states. | |
1447 | 1448 | // The index = 0 means electronic ground state. |
1448 | 1449 | void ZindoS::CalcForce(vector<int> elecStates){ |
1449 | 1450 | int elecState = elecStates[0]; |