// // fock.cc // // Copyright (C) 2004 Edward Valeev // // Author: Edward Valeev // Maintainer: EV // // This file is part of the SC Toolkit. // // The SC Toolkit is free software; you can redistribute it and/or modify // it under the terms of the GNU Library General Public License as published by // the Free Software Foundation; either version 2, or (at your option) // any later version. // // The SC Toolkit is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Library General Public License for more details. // // You should have received a copy of the GNU Library General Public License // along with the SC Toolkit; see the file COPYING.LIB. If not, write to // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. // // The U.S. Government is granted a limited license as per AL 91-7. // #ifdef __GNUC__ #pragma implementation #endif #include #include using namespace std; using namespace sc; RefSCMatrix R12IntEval::fock_(const Ref& occ_space, const Ref& bra_space, const Ref& ket_space, double scale_J, double scale_K) { const Ref bs1 = bra_space->basis(); const Ref bs2 = ket_space->basis(); const bool bs1_eq_bs2 = (bs1 == bs2); int nshell1 = bs1->nshell(); int nshell2 = bs2->nshell(); RefSCMatrix vec1t = bra_space->coefs().t(); RefSCMatrix vec2 = ket_space->coefs(); Ref localints = r12info_->integral()->clone(); localints->set_basis(bs1,bs2); Ref h_ints = localints->hcore(); // form AO moment matrices RefSCDimension aodim1 = vec1t.coldim(); RefSCDimension aodim2 = vec2.rowdim(); Ref aokit = bs1->so_matrixkit(); RefSCMatrix h(aodim1, aodim2, aokit); h.assign(0.0); for(int sh1=0; sh1shell_to_function(sh1); int nbf1 = bs1->shell(sh1).nfunction(); int sh2max; if (bs1_eq_bs2) sh2max = sh1; else sh2max = nshell2-1; for(int sh2=0; sh2<=sh2max; sh2++) { int bf2_offset = bs2->shell_to_function(sh2); int nbf2 = bs2->shell(sh2).nfunction(); h_ints->compute_shell(sh1,sh2); const double *hintsptr = h_ints->buffer(); int bf1_index = bf1_offset; for(int bf1=0; bf1nbasis(); for(int bf1=0; bf1 1) { F.print("Fock matrix"); } return F; } /////////////////////////////////////////////////////////////// // Local Variables: // mode: c++ // c-file-style: "CLJ" // End: