Revisión | cd8563de69c739f1a7371700b6fce69091e3e18c (tree) |
---|---|
Tiempo | 2013-01-22 00:11:44 |
Autor | okymmolds <okymmolds@gmai...> |
Commiter | okymmolds |
Unpaired electron population at Mulliken type. #29958
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1236 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -311,6 +311,7 @@ void InputParser::SetMessages(){ | ||
311 | 311 | this->stringCISAllTransitionDipoleMoments = "all_transition_dipole_moments"; |
312 | 312 | this->stringCISNumPrintCoefficients = "num_print_coefficients"; |
313 | 313 | this->stringCISMulliken = "mulliken"; |
314 | + this->stringCISUnpairedPop = "unpaired_electron_population"; | |
314 | 315 | |
315 | 316 | // Memory |
316 | 317 | this->stringMemory = "memory"; |
@@ -823,6 +824,16 @@ int InputParser::ParseConditionsCIS(vector<string>* inputTerms, int parseIndex) | ||
823 | 824 | } |
824 | 825 | parseIndex++; |
825 | 826 | } |
827 | + // unpaired electron population | |
828 | + if((*inputTerms)[parseIndex].compare(this->stringCISUnpairedPop) == 0){ | |
829 | + if((*inputTerms)[parseIndex+1].compare(this->stringYES) == 0){ | |
830 | + Parameters::GetInstance()->SetRequiresUnpairedPopCIS(true); | |
831 | + } | |
832 | + else { | |
833 | + Parameters::GetInstance()->SetRequiresUnpairedPopCIS(false); | |
834 | + } | |
835 | + parseIndex++; | |
836 | + } | |
826 | 837 | parseIndex++; |
827 | 838 | } |
828 | 839 | return parseIndex; |
@@ -236,6 +236,7 @@ private: | ||
236 | 236 | std::string stringCISAllTransitionDipoleMoments; |
237 | 237 | std::string stringCISNumPrintCoefficients; |
238 | 238 | std::string stringCISMulliken; |
239 | + std::string stringCISUnpairedPop; | |
239 | 240 | // Memory |
240 | 241 | std::string stringMemory; |
241 | 242 | std::string stringMemoryEnd; |
@@ -1,6 +1,7 @@ | ||
1 | 1 | //************************************************************************// |
2 | 2 | // Copyright (C) 2011-2012 Mikiya Fujii // |
3 | 3 | // Copyright (C) 2012-2012 Katsuhiko Nishimra // |
4 | +// Copyright (C) 2012-2013 Michihiro Okuyama | |
4 | 5 | // // |
5 | 6 | // This file is part of MolDS. // |
6 | 7 | // // |
@@ -171,6 +172,7 @@ void Parameters::SetDefaultValues(){ | ||
171 | 172 | this->numberPrintCoefficientsCIS = 1; |
172 | 173 | this->requiresExcitonEnergiesCIS = false; |
173 | 174 | this->requiresAllTransitionDipoleMomentsCIS = false; |
175 | + this->requiresUnpairedPopCIS = false; | |
174 | 176 | // Memory |
175 | 177 | this->limitHeapMemory = 256; |
176 | 178 | // MD |
@@ -705,6 +707,14 @@ bool Parameters::RequiresMullikenCIS() const{ | ||
705 | 707 | 0<this->electronicStateIndecesMullikenCIS->size()); |
706 | 708 | } |
707 | 709 | |
710 | +void Parameters::SetRequiresUnpairedPopCIS(bool requiresUnpairedPopCIS){ | |
711 | + this->requiresUnpairedPopCIS = requiresUnpairedPopCIS; | |
712 | +} | |
713 | + | |
714 | +bool Parameters::RequiresUnpairedPopCIS() const{ | |
715 | + return this->requiresUnpairedPopCIS; | |
716 | +} | |
717 | + | |
708 | 718 | // methods for Memory |
709 | 719 | double Parameters::GetLimitHeapMemory() const{ |
710 | 720 | return this->limitHeapMemory; |
@@ -1,6 +1,7 @@ | ||
1 | 1 | //************************************************************************// |
2 | 2 | // Copyright (C) 2011-2012 Mikiya Fujii // |
3 | 3 | // Copyright (C) 2012-2012 Katsuhiko Nishimra // |
4 | +// Copyright (C) 2012-2013 Michihiro Okuyama | |
4 | 5 | // // |
5 | 6 | // This file is part of MolDS. // |
6 | 7 | // // |
@@ -141,6 +142,8 @@ public: | ||
141 | 142 | std::vector<int>* GetElectronicStateIndecesMullikenCIS() const; |
142 | 143 | void AddElectronicStateIndexMullikenCIS(int electronicStateIndex); |
143 | 144 | bool RequiresMullikenCIS() const; |
145 | + void SetRequiresUnpairedPopCIS(bool requiresUnpairedPopCIS); | |
146 | + bool RequiresUnpairedPopCIS() const; | |
144 | 147 | // Memory |
145 | 148 | double GetLimitHeapMemory() const; |
146 | 149 | void SetLimitHeapMemory(double limitHeap); |
@@ -285,6 +288,7 @@ private: | ||
285 | 288 | bool requiresExcitonEnergiesCIS; |
286 | 289 | bool requiresAllTransitionDipoleMomentsCIS; |
287 | 290 | std::vector<int>* electronicStateIndecesMullikenCIS; |
291 | + bool requiresUnpairedPopCIS; | |
288 | 292 | // Memory |
289 | 293 | double limitHeapMemory; |
290 | 294 | // MD |
@@ -1,5 +1,6 @@ | ||
1 | 1 | //************************************************************************// |
2 | 2 | // Copyright (C) 2011-2012 Mikiya Fujii // |
3 | +// Copyright (C) 2012-2013 Michihiro Okuyama | |
3 | 4 | // // |
4 | 5 | // This file is part of MolDS. // |
5 | 6 | // // |
@@ -72,6 +73,7 @@ Cndo2::Cndo2(){ | ||
72 | 73 | this->orbitalElectronPopulationCIS = NULL; |
73 | 74 | this->atomicElectronPopulation = NULL; |
74 | 75 | this->atomicElectronPopulationCIS = NULL; |
76 | + this->atomicUnpairedPopulationCIS = NULL; | |
75 | 77 | this->overlapAOs = NULL; |
76 | 78 | this->twoElecTwoCore = NULL; |
77 | 79 | this->cartesianMatrix = NULL; |
@@ -205,6 +207,8 @@ void Cndo2::SetMessages(){ | ||
205 | 207 | this->messageMullikenAtomsSCF = "\tMulliken charge(SCF):"; |
206 | 208 | this->messageMullikenAtoms = "\tMulliken charge:"; |
207 | 209 | this->messageMullikenAtomsTitle = "\t\t\t\t| k-th eigenstate | i-th atom | atom type | core charge[a.u.] | Mulliken charge[a.u.]| \n"; |
210 | + this->messageUnpairedAtoms = "\tUnpaired electron population:"; | |
211 | + this->messageUnpairedAtomsTitle = "\t\t\t\t| k-th eigenstate | i-th atom | atom type | Unpaired electron population[a.u.]| \n"; | |
208 | 212 | this->messageElecEnergy = "\tElectronic energy(SCF):"; |
209 | 213 | this->messageNoteElecEnergy = "\tNote that this electronic energy includes core-repulsions.\n\n"; |
210 | 214 | this->messageNoteElecEnergyVdW = "\tNote that this electronic energy includes core-repulsions and vdW correction.\n\n"; |
@@ -1,5 +1,6 @@ | ||
1 | 1 | //************************************************************************// |
2 | 2 | // Copyright (C) 2011-2012 Mikiya Fujii // |
3 | +// Copyright (C) 2012-2013 Michihiro Okuyama | |
3 | 4 | // // |
4 | 5 | // This file is part of MolDS. // |
5 | 6 | // // |
@@ -86,6 +87,8 @@ protected: | ||
86 | 87 | std::string messageOmpElapsedTimeSCF; |
87 | 88 | std::string messageMullikenAtoms; |
88 | 89 | std::string messageMullikenAtomsTitle; |
90 | + std::string messageUnpairedAtoms; | |
91 | + std::string messageUnpairedAtomsTitle; | |
89 | 92 | std::string messageUnitSec; |
90 | 93 | std::vector<MolDS_base::AtomType> enableAtomTypes; |
91 | 94 | MolDS_base::Molecule* molecule; |
@@ -99,6 +102,7 @@ protected: | ||
99 | 102 | double*** orbitalElectronPopulationCIS; |
100 | 103 | double* atomicElectronPopulation; //P_{AB} of (3.21) in J. A. Pople book. |
101 | 104 | double** atomicElectronPopulationCIS; |
105 | + double** atomicUnpairedPopulationCIS; | |
102 | 106 | double** overlapAOs; // overlap integral between AOs |
103 | 107 | double****** twoElecTwoCore; |
104 | 108 | double*** cartesianMatrix; // cartesian matrix represented by AOs |
@@ -1,5 +1,6 @@ | ||
1 | 1 | //************************************************************************// |
2 | 2 | // Copyright (C) 2011-2012 Mikiya Fujii // |
3 | +// Copyright (C) 2012-2013 Michihiro Okuyama | |
3 | 4 | // // |
4 | 5 | // This file is part of MolDS. // |
5 | 6 | // // |
@@ -1020,6 +1021,10 @@ void ZindoS::CalcCISProperties(){ | ||
1020 | 1021 | this->CalcAtomicElectronPopulationCIS(&this->atomicElectronPopulationCIS, |
1021 | 1022 | this->orbitalElectronPopulationCIS, |
1022 | 1023 | *this->molecule); |
1024 | + // atomic unpaired electron population | |
1025 | + this->CalcAtomicUnpairedPopulationCIS(&this->atomicUnpairedPopulationCIS, | |
1026 | + this->orbitalElectronPopulationCIS, | |
1027 | + *this->molecule); | |
1023 | 1028 | } |
1024 | 1029 | |
1025 | 1030 | void ZindoS::CalcElectronicDipoleMomentsExcitedState(double*** electronicTransitionDipoleMoments, |
@@ -1406,6 +1411,58 @@ void ZindoS::CalcAtomicElectronPopulationCIS(double*** atomicElectronPopulationC | ||
1406 | 1411 | } |
1407 | 1412 | } |
1408 | 1413 | |
1414 | +void ZindoS::CalcAtomicUnpairedPopulationCIS(double*** atomicUnpairedPopulationCIS, | |
1415 | + double const* const* const* orbitalElectronPopulationCIS, | |
1416 | + const Molecule& molecule) const{ | |
1417 | + if(!Parameters::GetInstance()->RequiresMullikenCIS()){ | |
1418 | + return; | |
1419 | + } | |
1420 | + if(!Parameters::GetInstance()->RequiresUnpairedPopCIS()){ | |
1421 | + return; | |
1422 | + } | |
1423 | + int totalNumberAtoms = molecule.GetNumberAtoms(); | |
1424 | + vector<int>* elecStates = Parameters::GetInstance()->GetElectronicStateIndecesMullikenCIS(); | |
1425 | + // malloc or initialize free exciton energies | |
1426 | + if(*atomicUnpairedPopulationCIS == NULL){ | |
1427 | + MallocerFreer::GetInstance()->Malloc<double>(atomicUnpairedPopulationCIS, | |
1428 | + elecStates->size(), | |
1429 | + totalNumberAtoms); | |
1430 | + } | |
1431 | + else{ | |
1432 | + MallocerFreer::GetInstance()->Initialize<double>(*atomicUnpairedPopulationCIS, | |
1433 | + elecStates->size(), | |
1434 | + totalNumberAtoms); | |
1435 | + } | |
1436 | + // calc atomic electron population | |
1437 | + for(int k=0; k<elecStates->size(); k++){ | |
1438 | + stringstream ompErrors; | |
1439 | +#pragma omp parallel for schedule(auto) | |
1440 | + for(int a=0; a<totalNumberAtoms; a++){ | |
1441 | + try{ | |
1442 | + int firstAOIndex = molecule.GetAtom(a)->GetFirstAOIndex(); | |
1443 | + int numberAOs = molecule.GetAtom(a)->GetValenceSize(); | |
1444 | + (*atomicUnpairedPopulationCIS)[k][a] = 0.0; | |
1445 | + for(int i=firstAOIndex; i<firstAOIndex+numberAOs; i++){ | |
1446 | + double orbitalSquarePopulation = 0.0; | |
1447 | + int totalNumberAOs = molecule.GetTotalNumberAOs(); | |
1448 | + for(int j=0; j<totalNumberAOs; j++) { | |
1449 | + orbitalSquarePopulation += orbitalElectronPopulationCIS[k][i][j] * orbitalElectronPopulationCIS[k][j][i]; | |
1450 | + } | |
1451 | + (*atomicUnpairedPopulationCIS)[k][a] += 2.0 * orbitalElectronPopulationCIS[k][i][i] - orbitalSquarePopulation; | |
1452 | + } | |
1453 | + } | |
1454 | + catch(MolDSException ex){ | |
1455 | +#pragma omp critical | |
1456 | + ompErrors << ex.what() << endl ; | |
1457 | + } | |
1458 | + } | |
1459 | + // Exception throwing for omp-region | |
1460 | + if(!ompErrors.str().empty()){ | |
1461 | + throw MolDSException(ompErrors.str()); | |
1462 | + } | |
1463 | + } | |
1464 | +} | |
1465 | + | |
1409 | 1466 | void ZindoS::OutputCISResults() const{ |
1410 | 1467 | int numberActiveOcc = Parameters::GetInstance()->GetActiveOccCIS(); |
1411 | 1468 | int numberActiveVir = Parameters::GetInstance()->GetActiveVirCIS(); |
@@ -1441,6 +1498,9 @@ void ZindoS::OutputCISResults() const{ | ||
1441 | 1498 | // output mulliken population |
1442 | 1499 | this->OutputCISMulliken(); |
1443 | 1500 | |
1501 | + // output unpaired electron population | |
1502 | + this->OutputCISUnpairedPop(); | |
1503 | + | |
1444 | 1504 | // output exciton energies |
1445 | 1505 | if(Parameters::GetInstance()->RequiresExcitonEnergiesCIS()){ |
1446 | 1506 | this->OutputLog(this->messageExcitonEnergiesCIS); |
@@ -1588,6 +1648,29 @@ void ZindoS::OutputCISMulliken() const{ | ||
1588 | 1648 | } |
1589 | 1649 | } |
1590 | 1650 | |
1651 | +void ZindoS::OutputCISUnpairedPop() const{ | |
1652 | + if(!Parameters::GetInstance()->RequiresMullikenCIS()){ | |
1653 | + return; | |
1654 | + } | |
1655 | + if(!Parameters::GetInstance()->RequiresUnpairedPopCIS()){ | |
1656 | + return; | |
1657 | + } | |
1658 | + int totalNumberAtoms = this->molecule->GetNumberAtoms(); | |
1659 | + this->OutputLog(this->messageUnpairedAtomsTitle); | |
1660 | + vector<int>* elecStates = Parameters::GetInstance()->GetElectronicStateIndecesMullikenCIS(); | |
1661 | + for(int k=0; k<elecStates->size(); k++){ | |
1662 | + for(int a=0; a<totalNumberAtoms; a++){ | |
1663 | + const Atom& atom = *this->molecule->GetAtom(a); | |
1664 | + this->OutputLog(boost::format("%s\t%d\t%d\t%s\t%e\n") % this->messageUnpairedAtoms | |
1665 | + % (*elecStates)[k] | |
1666 | + % a | |
1667 | + % AtomTypeStr(atom.GetAtomType()) | |
1668 | + % this->atomicUnpairedPopulationCIS[k][a]); | |
1669 | + } | |
1670 | + this->OutputLog("\n"); | |
1671 | + } | |
1672 | +} | |
1673 | + | |
1591 | 1674 | void ZindoS::SortCISEigenVectorCoefficients(vector<CISEigenVectorCoefficient>* cisEigenVectorCoefficients, |
1592 | 1675 | double* cisEigenVector) const{ |
1593 | 1676 | for(int l=0; l<this->matrixCISdimension; l++){ |
@@ -1,5 +1,6 @@ | ||
1 | 1 | //************************************************************************// |
2 | 2 | // Copyright (C) 2011-2012 Mikiya Fujii // |
3 | +// Copyright (C) 2012-2013 Michihiro Okuyama | |
3 | 4 | // // |
4 | 5 | // This file is part of MolDS. // |
5 | 6 | // // |
@@ -139,6 +140,7 @@ private: | ||
139 | 140 | void OutputCISDipole() const; |
140 | 141 | void OutputCISTransitionDipole() const; |
141 | 142 | void OutputCISMulliken() const; |
143 | + void OutputCISUnpairedPop() const; | |
142 | 144 | void CalcFreeExcitonEnergies(double** freeExcitonEnergiesCIS, |
143 | 145 | const MolDS_base::Molecule& molecule, |
144 | 146 | double const* energiesMO, |
@@ -152,6 +154,9 @@ private: | ||
152 | 154 | void CalcAtomicElectronPopulationCIS(double*** atomicElectronPopulationCIS, |
153 | 155 | double const* const* const* orbitalElectronPopulationCIS, |
154 | 156 | const MolDS_base::Molecule& molecule) const; |
157 | + void CalcAtomicUnpairedPopulationCIS(double*** atomicUnpairedPopulationCIS, | |
158 | + double const* const* const* orbitalElectronPopulationCIS, | |
159 | + const MolDS_base::Molecule& molecule) const; | |
155 | 160 | void CalcElectronicDipoleMomentsExcitedState(double*** electronicTransitionDipoleMoments, |
156 | 161 | double const* const* fockMatrix, |
157 | 162 | double const* const* matrixCIS, |