• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisióncd8563de69c739f1a7371700b6fce69091e3e18c (tree)
Tiempo2013-01-22 00:11:44
Autorokymmolds <okymmolds@gmai...>
Commiterokymmolds

Log Message

Unpaired electron population at Mulliken type. #29958

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1236 1136aad2-a195-0410-b898-f5ea1d11b9d8

Cambiar Resumen

Diferencia incremental

--- a/src/base/InputParser.cpp
+++ b/src/base/InputParser.cpp
@@ -311,6 +311,7 @@ void InputParser::SetMessages(){
311311 this->stringCISAllTransitionDipoleMoments = "all_transition_dipole_moments";
312312 this->stringCISNumPrintCoefficients = "num_print_coefficients";
313313 this->stringCISMulliken = "mulliken";
314+ this->stringCISUnpairedPop = "unpaired_electron_population";
314315
315316 // Memory
316317 this->stringMemory = "memory";
@@ -823,6 +824,16 @@ int InputParser::ParseConditionsCIS(vector<string>* inputTerms, int parseIndex)
823824 }
824825 parseIndex++;
825826 }
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+ }
826837 parseIndex++;
827838 }
828839 return parseIndex;
--- a/src/base/InputParser.h
+++ b/src/base/InputParser.h
@@ -236,6 +236,7 @@ private:
236236 std::string stringCISAllTransitionDipoleMoments;
237237 std::string stringCISNumPrintCoefficients;
238238 std::string stringCISMulliken;
239+ std::string stringCISUnpairedPop;
239240 // Memory
240241 std::string stringMemory;
241242 std::string stringMemoryEnd;
--- a/src/base/Parameters.cpp
+++ b/src/base/Parameters.cpp
@@ -1,6 +1,7 @@
11 //************************************************************************//
22 // Copyright (C) 2011-2012 Mikiya Fujii //
33 // Copyright (C) 2012-2012 Katsuhiko Nishimra //
4+// Copyright (C) 2012-2013 Michihiro Okuyama
45 // //
56 // This file is part of MolDS. //
67 // //
@@ -171,6 +172,7 @@ void Parameters::SetDefaultValues(){
171172 this->numberPrintCoefficientsCIS = 1;
172173 this->requiresExcitonEnergiesCIS = false;
173174 this->requiresAllTransitionDipoleMomentsCIS = false;
175+ this->requiresUnpairedPopCIS = false;
174176 // Memory
175177 this->limitHeapMemory = 256;
176178 // MD
@@ -705,6 +707,14 @@ bool Parameters::RequiresMullikenCIS() const{
705707 0<this->electronicStateIndecesMullikenCIS->size());
706708 }
707709
710+void Parameters::SetRequiresUnpairedPopCIS(bool requiresUnpairedPopCIS){
711+ this->requiresUnpairedPopCIS = requiresUnpairedPopCIS;
712+}
713+
714+bool Parameters::RequiresUnpairedPopCIS() const{
715+ return this->requiresUnpairedPopCIS;
716+}
717+
708718 // methods for Memory
709719 double Parameters::GetLimitHeapMemory() const{
710720 return this->limitHeapMemory;
--- a/src/base/Parameters.h
+++ b/src/base/Parameters.h
@@ -1,6 +1,7 @@
11 //************************************************************************//
22 // Copyright (C) 2011-2012 Mikiya Fujii //
33 // Copyright (C) 2012-2012 Katsuhiko Nishimra //
4+// Copyright (C) 2012-2013 Michihiro Okuyama
45 // //
56 // This file is part of MolDS. //
67 // //
@@ -141,6 +142,8 @@ public:
141142 std::vector<int>* GetElectronicStateIndecesMullikenCIS() const;
142143 void AddElectronicStateIndexMullikenCIS(int electronicStateIndex);
143144 bool RequiresMullikenCIS() const;
145+ void SetRequiresUnpairedPopCIS(bool requiresUnpairedPopCIS);
146+ bool RequiresUnpairedPopCIS() const;
144147 // Memory
145148 double GetLimitHeapMemory() const;
146149 void SetLimitHeapMemory(double limitHeap);
@@ -285,6 +288,7 @@ private:
285288 bool requiresExcitonEnergiesCIS;
286289 bool requiresAllTransitionDipoleMomentsCIS;
287290 std::vector<int>* electronicStateIndecesMullikenCIS;
291+ bool requiresUnpairedPopCIS;
288292 // Memory
289293 double limitHeapMemory;
290294 // MD
--- a/src/cndo/Cndo2.cpp
+++ b/src/cndo/Cndo2.cpp
@@ -1,5 +1,6 @@
11 //************************************************************************//
22 // Copyright (C) 2011-2012 Mikiya Fujii //
3+// Copyright (C) 2012-2013 Michihiro Okuyama
34 // //
45 // This file is part of MolDS. //
56 // //
@@ -72,6 +73,7 @@ Cndo2::Cndo2(){
7273 this->orbitalElectronPopulationCIS = NULL;
7374 this->atomicElectronPopulation = NULL;
7475 this->atomicElectronPopulationCIS = NULL;
76+ this->atomicUnpairedPopulationCIS = NULL;
7577 this->overlapAOs = NULL;
7678 this->twoElecTwoCore = NULL;
7779 this->cartesianMatrix = NULL;
@@ -205,6 +207,8 @@ void Cndo2::SetMessages(){
205207 this->messageMullikenAtomsSCF = "\tMulliken charge(SCF):";
206208 this->messageMullikenAtoms = "\tMulliken charge:";
207209 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";
208212 this->messageElecEnergy = "\tElectronic energy(SCF):";
209213 this->messageNoteElecEnergy = "\tNote that this electronic energy includes core-repulsions.\n\n";
210214 this->messageNoteElecEnergyVdW = "\tNote that this electronic energy includes core-repulsions and vdW correction.\n\n";
--- a/src/cndo/Cndo2.h
+++ b/src/cndo/Cndo2.h
@@ -1,5 +1,6 @@
11 //************************************************************************//
22 // Copyright (C) 2011-2012 Mikiya Fujii //
3+// Copyright (C) 2012-2013 Michihiro Okuyama
34 // //
45 // This file is part of MolDS. //
56 // //
@@ -86,6 +87,8 @@ protected:
8687 std::string messageOmpElapsedTimeSCF;
8788 std::string messageMullikenAtoms;
8889 std::string messageMullikenAtomsTitle;
90+ std::string messageUnpairedAtoms;
91+ std::string messageUnpairedAtomsTitle;
8992 std::string messageUnitSec;
9093 std::vector<MolDS_base::AtomType> enableAtomTypes;
9194 MolDS_base::Molecule* molecule;
@@ -99,6 +102,7 @@ protected:
99102 double*** orbitalElectronPopulationCIS;
100103 double* atomicElectronPopulation; //P_{AB} of (3.21) in J. A. Pople book.
101104 double** atomicElectronPopulationCIS;
105+ double** atomicUnpairedPopulationCIS;
102106 double** overlapAOs; // overlap integral between AOs
103107 double****** twoElecTwoCore;
104108 double*** cartesianMatrix; // cartesian matrix represented by AOs
--- a/src/zindo/ZindoS.cpp
+++ b/src/zindo/ZindoS.cpp
@@ -1,5 +1,6 @@
11 //************************************************************************//
22 // Copyright (C) 2011-2012 Mikiya Fujii //
3+// Copyright (C) 2012-2013 Michihiro Okuyama
34 // //
45 // This file is part of MolDS. //
56 // //
@@ -1020,6 +1021,10 @@ void ZindoS::CalcCISProperties(){
10201021 this->CalcAtomicElectronPopulationCIS(&this->atomicElectronPopulationCIS,
10211022 this->orbitalElectronPopulationCIS,
10221023 *this->molecule);
1024+ // atomic unpaired electron population
1025+ this->CalcAtomicUnpairedPopulationCIS(&this->atomicUnpairedPopulationCIS,
1026+ this->orbitalElectronPopulationCIS,
1027+ *this->molecule);
10231028 }
10241029
10251030 void ZindoS::CalcElectronicDipoleMomentsExcitedState(double*** electronicTransitionDipoleMoments,
@@ -1406,6 +1411,58 @@ void ZindoS::CalcAtomicElectronPopulationCIS(double*** atomicElectronPopulationC
14061411 }
14071412 }
14081413
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+
14091466 void ZindoS::OutputCISResults() const{
14101467 int numberActiveOcc = Parameters::GetInstance()->GetActiveOccCIS();
14111468 int numberActiveVir = Parameters::GetInstance()->GetActiveVirCIS();
@@ -1441,6 +1498,9 @@ void ZindoS::OutputCISResults() const{
14411498 // output mulliken population
14421499 this->OutputCISMulliken();
14431500
1501+ // output unpaired electron population
1502+ this->OutputCISUnpairedPop();
1503+
14441504 // output exciton energies
14451505 if(Parameters::GetInstance()->RequiresExcitonEnergiesCIS()){
14461506 this->OutputLog(this->messageExcitonEnergiesCIS);
@@ -1588,6 +1648,29 @@ void ZindoS::OutputCISMulliken() const{
15881648 }
15891649 }
15901650
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+
15911674 void ZindoS::SortCISEigenVectorCoefficients(vector<CISEigenVectorCoefficient>* cisEigenVectorCoefficients,
15921675 double* cisEigenVector) const{
15931676 for(int l=0; l<this->matrixCISdimension; l++){
--- a/src/zindo/ZindoS.h
+++ b/src/zindo/ZindoS.h
@@ -1,5 +1,6 @@
11 //************************************************************************//
22 // Copyright (C) 2011-2012 Mikiya Fujii //
3+// Copyright (C) 2012-2013 Michihiro Okuyama
34 // //
45 // This file is part of MolDS. //
56 // //
@@ -139,6 +140,7 @@ private:
139140 void OutputCISDipole() const;
140141 void OutputCISTransitionDipole() const;
141142 void OutputCISMulliken() const;
143+ void OutputCISUnpairedPop() const;
142144 void CalcFreeExcitonEnergies(double** freeExcitonEnergiesCIS,
143145 const MolDS_base::Molecule& molecule,
144146 double const* energiesMO,
@@ -152,6 +154,9 @@ private:
152154 void CalcAtomicElectronPopulationCIS(double*** atomicElectronPopulationCIS,
153155 double const* const* const* orbitalElectronPopulationCIS,
154156 const MolDS_base::Molecule& molecule) const;
157+ void CalcAtomicUnpairedPopulationCIS(double*** atomicUnpairedPopulationCIS,
158+ double const* const* const* orbitalElectronPopulationCIS,
159+ const MolDS_base::Molecule& molecule) const;
155160 void CalcElectronicDipoleMomentsExcitedState(double*** electronicTransitionDipoleMoments,
156161 double const* const* fockMatrix,
157162 double const* const* matrixCIS,