修訂 | ae96610e34f57756afb142ee0208f7664b1686b2 (tree) |
---|---|
時間 | 2012-06-02 08:33:29 |
作者 | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Cndo2::CalcRotatingMatrixSecondDerivatives is added. #28554
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@691 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -4632,6 +4632,157 @@ void Cndo2::CalcRotatingMatrixFirstDerivatives(double*** rotMatFirstDerivatives, | ||
4632 | 4632 | |
4633 | 4633 | } |
4634 | 4634 | |
4635 | +// Second derivative of rotating matirx. | |
4636 | +// Both derivatives are related to a coordinate of atom A. | |
4637 | +// This method can not calculate d-orbital yet. | |
4638 | +// For rotating matirxi, see J. Mol. Struc. (Theochem), 419, 19 (1997) (ref. [BFB_1997]) | |
4639 | +// we set gamma=0 always. | |
4640 | +void Cndo2::CalcRotatingMatrixSecondDerivatives(double**** rotMatSecondDerivatives, | |
4641 | + const Atom& atomA, | |
4642 | + const Atom& atomB) const{ | |
4643 | + | |
4644 | + MallocerFreer::GetInstance()->Initialize<double>( | |
4645 | + rotMatSecondDerivatives, | |
4646 | + OrbitalType_end, | |
4647 | + OrbitalType_end, | |
4648 | + CartesianType_end, | |
4649 | + CartesianType_end); | |
4650 | + | |
4651 | + double x = atomB.GetXyz()[0] - atomA.GetXyz()[0]; | |
4652 | + double y = atomB.GetXyz()[1] - atomA.GetXyz()[1]; | |
4653 | + double z = atomB.GetXyz()[2] - atomA.GetXyz()[2]; | |
4654 | + double r = sqrt( pow(x,2.0) + pow(y,2.0) ); | |
4655 | + double R = sqrt( pow(x,2.0) + pow(y,2.0) + pow(z,2.0) ); | |
4656 | + | |
4657 | + // for s-function | |
4658 | + rotMatSecondDerivatives[s][s][XAxis][XAxis] = 0.0; | |
4659 | + rotMatSecondDerivatives[s][s][XAxis][YAxis] = 0.0; | |
4660 | + rotMatSecondDerivatives[s][s][XAxis][ZAxis] = 0.0; | |
4661 | + rotMatSecondDerivatives[s][s][YAxis][XAxis] = 0.0; | |
4662 | + rotMatSecondDerivatives[s][s][YAxis][YAxis] = 0.0; | |
4663 | + rotMatSecondDerivatives[s][s][YAxis][ZAxis] = 0.0; | |
4664 | + rotMatSecondDerivatives[s][s][ZAxis][XAxis] = 0.0; | |
4665 | + rotMatSecondDerivatives[s][s][ZAxis][YAxis] = 0.0; | |
4666 | + rotMatSecondDerivatives[s][s][ZAxis][ZAxis] = 0.0; | |
4667 | + | |
4668 | + // for p-function, xx-derivatives | |
4669 | + rotMatSecondDerivatives[py][py][XAxis][XAxis] = -3.0*x*pow(r,-3.0) + 3.0*pow(x,3.0)*pow(r,-5.0); | |
4670 | + rotMatSecondDerivatives[py][pz][XAxis][XAxis] = -1.0*y*pow(R,-3.0) + 3.0*pow(x,2.0)*y*pow(R,-5.0); | |
4671 | + rotMatSecondDerivatives[py][px][XAxis][XAxis] = -1.0*(1.0/(pow(r,3.0)*R) + 1.0/(r*pow(R,3.0)))*y*z | |
4672 | + +(2.0*pow(r*R,-3.0) + 3.0/(pow(r,5.0)*R) + 3.0/(r*pow(R,5.0)))*pow(x,2.0)*y*z; | |
4673 | + | |
4674 | + rotMatSecondDerivatives[pz][py][XAxis][XAxis] = 0.0; | |
4675 | + rotMatSecondDerivatives[pz][pz][XAxis][XAxis] = -1.0*z*pow(R,-3.0) + 3.0*pow(x,2.0)*z*pow(R,-5.0); | |
4676 | + rotMatSecondDerivatives[pz][px][XAxis][XAxis] = -1.0*pow(r*R,-1.0) + (1.0/(pow(r,3.0)*R) + 1.0/(r*pow(R,3.0)))*pow(x,2.0) | |
4677 | + +r*pow(R,-3.0) - 3.0*pow(x,2.0)*r*pow(R,-5.0) + pow(x,2.0)*pow(r,-1.0)*pow(R,-3.0); | |
4678 | + | |
4679 | + rotMatSecondDerivatives[px][py][XAxis][XAxis] = y*pow(r,-3.0) - 3.0*pow(x,2.0)*y*pow(r,-5.0); | |
4680 | + rotMatSecondDerivatives[px][pz][XAxis][XAxis] = -3.0*x*pow(R,-3.0) + 3.0*pow(x,3.0)*pow(R,-5.0); | |
4681 | + rotMatSecondDerivatives[px][px][XAxis][XAxis] = -3.0*(1.0/(pow(r,3.0)*R) + 1.0/(r*pow(R,3.0)))*x*z | |
4682 | + +(2.0*pow(r*R,-3.0) + 3.0/(pow(r,5.0)*R) + 3.0/(r*pow(R,5.0)))*pow(x,3.0)*z; | |
4683 | + | |
4684 | + // for p-function, xy-derivatives | |
4685 | + rotMatSecondDerivatives[py][py][XAxis][YAxis] = -1.0*y*pow(r,-3.0) + 3.0*pow(x,2.0)*y*pow(r,-5.0); | |
4686 | + rotMatSecondDerivatives[py][pz][XAxis][YAxis] = -1.0*x*pow(R,-3.0) + 3.0*x*pow(y,2.0)*pow(R,-5.0); | |
4687 | + rotMatSecondDerivatives[py][px][XAxis][YAxis] = -1.0*(1.0/(pow(r,3.0)*R) + 1.0/(r*pow(R,3.0)))*x*z | |
4688 | + +(2.0*pow(r*R,-3.0) + 3.0/(pow(r,5.0)*R) + 3.0/(r*pow(R,5.0)))*x*pow(y,2.0)*z; | |
4689 | + | |
4690 | + rotMatSecondDerivatives[pz][py][XAxis][YAxis] = 0.0; | |
4691 | + rotMatSecondDerivatives[pz][pz][XAxis][YAxis] = 3.0*x*y*z*pow(R,-5.0); | |
4692 | + rotMatSecondDerivatives[pz][px][XAxis][YAxis] = (1.0/(pow(r,3.0)*R) + 1.0/(r*pow(R,3.0)))*x*y + x*y*pow(r,-1.0)*pow(R,-3.0) - 3.0*x*y*r*pow(R,-5.0); | |
4693 | + | |
4694 | + rotMatSecondDerivatives[px][py][XAxis][YAxis] = x*pow(r,-3.0) - 3.0*x*pow(y,2.0)*pow(R,-5.0); | |
4695 | + rotMatSecondDerivatives[px][pz][XAxis][YAxis] = rotMatSecondDerivatives[py][pz][XAxis][XAxis]; | |
4696 | + rotMatSecondDerivatives[px][px][XAxis][YAxis] = rotMatSecondDerivatives[py][px][XAxis][XAxis]; | |
4697 | + | |
4698 | + // for p-function, yx-derivatives | |
4699 | + for(int i=py; i<=px; i++){ | |
4700 | + for(int j=py; j<=px; j++){ | |
4701 | + rotMatSecondDerivatives[i][j][YAxis][XAxis] = rotMatSecondDerivatives[i][j][XAxis][YAxis]; | |
4702 | + } | |
4703 | + } | |
4704 | + | |
4705 | + // for p-function, xz-derivatives | |
4706 | + rotMatSecondDerivatives[py][py][XAxis][ZAxis] = 0.0; | |
4707 | + rotMatSecondDerivatives[py][pz][XAxis][ZAxis] = rotMatSecondDerivatives[pz][pz][XAxis][YAxis]; | |
4708 | + rotMatSecondDerivatives[py][px][XAxis][ZAxis] = -1.0*(1.0/(pow(r,3.0)*R) + 1.0/(r*pow(R,3.0)))*x*y | |
4709 | + +(pow(r*R,-3.0) + 3.0/(r*pow(R,5.0)))*x*y*pow(z,2.0); | |
4710 | + | |
4711 | + rotMatSecondDerivatives[pz][py][XAxis][ZAxis] = 0.0; | |
4712 | + rotMatSecondDerivatives[pz][pz][XAxis][ZAxis] = -1.0*x*pow(R,-3.0) + 3.0*x*pow(z,2.0)*pow(R,-5.0); | |
4713 | + rotMatSecondDerivatives[pz][px][XAxis][ZAxis] = x*z*pow(r,-1.0)*pow(R,-3.0) - 3.0*x*z*r*pow(R,-5.0); | |
4714 | + | |
4715 | + rotMatSecondDerivatives[px][py][XAxis][ZAxis] = 0.0; | |
4716 | + rotMatSecondDerivatives[px][pz][XAxis][ZAxis] = rotMatSecondDerivatives[pz][pz][XAxis][XAxis]; | |
4717 | + rotMatSecondDerivatives[px][px][XAxis][ZAxis] = pow(r*R,-1.0) - pow(z,2.0)*pow(r,-1.0)*pow(R,-3.0) | |
4718 | + -1.0*(1.0/(pow(r,3.0)*R) + 1.0/(r*pow(R,3.0)))*pow(x,2.0) | |
4719 | + +(pow(r*R,-3.0) + 3.0/(r*pow(R,5.0)))*pow(x*z,2.0); | |
4720 | + | |
4721 | + | |
4722 | + // for p-function, zx-derivatives | |
4723 | + for(int i=py; i<=px; i++){ | |
4724 | + for(int j=py; j<=px; j++){ | |
4725 | + rotMatSecondDerivatives[i][j][ZAxis][XAxis] = rotMatSecondDerivatives[i][j][XAxis][ZAxis]; | |
4726 | + } | |
4727 | + } | |
4728 | + | |
4729 | + // for p-function, yy-derivatives | |
4730 | + rotMatSecondDerivatives[py][py][YAxis][YAxis] = -1.0*x*pow(r,-3.0) + 3.0*x*pow(y,2.0)*pow(r,-5.0); | |
4731 | + rotMatSecondDerivatives[py][pz][YAxis][YAxis] = -3.0*y*pow(R,-3.0) + 3.0*pow(y,3.0)*pow(R,-5.0); | |
4732 | + rotMatSecondDerivatives[py][px][YAxis][YAxis] = -3.0*(1.0/(pow(r,3.0)*R) + 1.0/(r*pow(R,3.0)))*y*z | |
4733 | + +(2.0*pow(r*R,-3.0) + 3.0/(pow(r,5.0)*R) + 3.0/(r*pow(R,5.0)))*pow(y,3.0)*z; | |
4734 | + | |
4735 | + rotMatSecondDerivatives[pz][py][YAxis][YAxis] = 0.0; | |
4736 | + rotMatSecondDerivatives[pz][pz][YAxis][YAxis] = -1.0*z*pow(R,-3.0) + 3.0*pow(y,2.0)*z*pow(R,-5.0); | |
4737 | + rotMatSecondDerivatives[pz][px][YAxis][YAxis] = -1.0*pow(r*R,-1.0) + (1.0/(pow(r,3.0)*R) + 1.0/(r*pow(R,3.0)))*pow(y,2.0) | |
4738 | + +r*pow(R,-3.0) - 3.0*pow(y,2.0)*r*pow(R,-5.0) + pow(y,2.0)*pow(r,-1.0)*pow(R,-3.0); | |
4739 | + | |
4740 | + rotMatSecondDerivatives[px][py][YAxis][YAxis] = 3.0*y*pow(r,-3.0) - 3.0*pow(y,3.0)*pow(r,-5.0); | |
4741 | + rotMatSecondDerivatives[px][pz][YAxis][YAxis] = rotMatSecondDerivatives[py][pz][XAxis][YAxis]; | |
4742 | + rotMatSecondDerivatives[px][px][YAxis][YAxis] = -1.0*(1.0/(pow(r,3.0)*R) + 1.0/(r*pow(R,3.0)))*x*z | |
4743 | + +(2.0*pow(r*R,-3.0) + 3.0/(pow(r,5.0)*R) + 3.0/(r*pow(R,5.0)))*x*pow(y,2.0)*z; | |
4744 | + | |
4745 | + // for p-function, yz-derivatives | |
4746 | + rotMatSecondDerivatives[py][py][YAxis][ZAxis] = 0.0; | |
4747 | + rotMatSecondDerivatives[py][pz][YAxis][ZAxis] = rotMatSecondDerivatives[pz][pz][YAxis][YAxis]; | |
4748 | + rotMatSecondDerivatives[py][px][YAxis][ZAxis] = pow(r*R,-1.0) - pow(z,2.0)*pow(r,-1.0)*pow(R,-3.0) | |
4749 | + -1.0*(1.0/(pow(r,3.0)*R) + 1.0/(r*pow(R,3.0)))*pow(y,2.0) | |
4750 | + +(pow(r*R,-3.0) + 3.0/(r*pow(R,5.0)))*pow(y*z,2.0); | |
4751 | + | |
4752 | + rotMatSecondDerivatives[pz][py][YAxis][ZAxis] = 0.0; | |
4753 | + rotMatSecondDerivatives[pz][pz][YAxis][ZAxis] = -1.0*y*pow(R,-3.0) + 3.0*y*pow(z,2.0)*pow(R,-5.0); | |
4754 | + rotMatSecondDerivatives[pz][px][YAxis][ZAxis] = y*z*pow(r,-1.0)*pow(R,-3.0) - 3.0*y*z*r*pow(R,-5.0); | |
4755 | + | |
4756 | + rotMatSecondDerivatives[px][py][YAxis][ZAxis] = 0.0; | |
4757 | + rotMatSecondDerivatives[px][pz][YAxis][ZAxis] = rotMatSecondDerivatives[pz][pz][XAxis][YAxis]; | |
4758 | + rotMatSecondDerivatives[px][px][YAxis][ZAxis] = -1.0*(1.0/(pow(r,3.0)*R) + 1.0/(r*pow(R,3.0)))*x*y | |
4759 | + +(pow(r*R,-3.0) + 3.0/(r*pow(R,5.0)))*x*y*pow(z,2.0); | |
4760 | + | |
4761 | + | |
4762 | + // for p-function, zy-derivatives | |
4763 | + for(int i=py; i<=px; i++){ | |
4764 | + for(int j=py; j<=px; j++){ | |
4765 | + rotMatSecondDerivatives[i][j][ZAxis][YAxis] = rotMatSecondDerivatives[i][j][YAxis][ZAxis]; | |
4766 | + } | |
4767 | + } | |
4768 | + | |
4769 | + // for p-function, zz-derivatives | |
4770 | + rotMatSecondDerivatives[py][py][ZAxis][ZAxis] = 0.0; | |
4771 | + rotMatSecondDerivatives[py][pz][ZAxis][ZAxis] = rotMatSecondDerivatives[pz][pz][YAxis][ZAxis]; | |
4772 | + rotMatSecondDerivatives[py][px][ZAxis][ZAxis] = -3.0*y*z*pow(r,-1.0)*pow(R,-3.0) + 3.0*y*pow(z,3.0)*pow(r,-1.0)*pow(R,-5.0); | |
4773 | + | |
4774 | + rotMatSecondDerivatives[pz][py][ZAxis][ZAxis] = 0.0; | |
4775 | + rotMatSecondDerivatives[pz][pz][ZAxis][ZAxis] = -3.0*z*pow(R,-3.0) + 3.0*pow(z,3.0)*pow(R,-5.0); | |
4776 | + rotMatSecondDerivatives[pz][px][ZAxis][ZAxis] = -3.0*pow(z,2.0)*r*pow(R,-5.0) + r*pow(R,-3.0); | |
4777 | + | |
4778 | + rotMatSecondDerivatives[px][py][ZAxis][ZAxis] = 0.0; | |
4779 | + rotMatSecondDerivatives[px][pz][ZAxis][ZAxis] = rotMatSecondDerivatives[pz][pz][XAxis][ZAxis]; | |
4780 | + rotMatSecondDerivatives[px][px][ZAxis][ZAxis] = -3.0*x*z*pow(r,-1.0)*pow(R,-3.0) + 3.0*x*pow(z,3.0)*pow(r,-1.0)*pow(R,-5.0); | |
4781 | + | |
4782 | + // for d-function | |
4783 | + // ToDo: Second derivative of rotating matrix for d-orbital... | |
4784 | +} | |
4785 | + | |
4635 | 4786 | // see (B.40) in J. A. Pople book. |
4636 | 4787 | void Cndo2::CalcDiatomicOverlapInDiatomicFrame(double** diatomicOverlap, |
4637 | 4788 | const Atom& atomA, |
@@ -177,9 +177,12 @@ protected: | ||
177 | 177 | virtual void CalcTwoElecTwoCore(double****** twoElecTwoCore, |
178 | 178 | const MolDS_base::Molecule& molecule) const; |
179 | 179 | virtual void CalcForce(const std::vector<int>& elecStates); |
180 | - void CalcRotatingMatrixFirstDerivatives(double*** rMatFirstDeri, | |
180 | + void CalcRotatingMatrixFirstDerivatives(double*** rotMatFirstDerivatives, | |
181 | 181 | const MolDS_base_atoms::Atom& atomA, |
182 | 182 | const MolDS_base_atoms::Atom& atomB) const; |
183 | + void CalcRotatingMatrixSecondDerivatives(double**** rotMatSecondDerivatives, | |
184 | + const MolDS_base_atoms::Atom& atomA, | |
185 | + const MolDS_base_atoms::Atom& atomB) const; | |
183 | 186 | struct MoEnergyGap{ |
184 | 187 | double energyGap; |
185 | 188 | int occIndex; |