1#ifndef MPQC_CI_INTEGRALS_HPP
2#define MPQC_CI_INTEGRALS_HPP
4#include "mpqc/math/matrix.hpp"
5#include <boost/foreach.hpp>
7#include <chemistry/qc/basis/tbint.h>
12 template<
class C,
class U,
class T>
13 void transform(
const range &p,
const C &c,
const U &u, T &t) {
14 t += u.transpose() * c(range(c.rows()), p).transpose();
21 range shells(basis->nshell());
23 V.resize((no * no + no) / 2, (no * no + no) / 2);
27 T4.resize(no * no * no, no);
30 BOOST_FOREACH (
auto s, shells) {
31 range S = basis->range(s);
33 T3.resize(ns*no*no, no);
35 BOOST_FOREACH (
auto r, shells) {
36 range R = basis->range(r);
38 T2.resize(nr*ns*no, no);
40 BOOST_FOREACH (
auto q, shells) {
41 range Q = basis->range(q);
43 T1.resize(nq*nr*ns, no);
45 BOOST_FOREACH (
auto p, shells) {
46 range P = basis->range(p);
48 int2->compute_shell(s, r, q, p);
49 auto G = Matrix::Map(int2->buffer(), np, nq*nr*ns);
52 T1.resize(nq, nr*ns*no);
55 T2.resize(nr, ns*no*no);
58 T3.resize(ns, no*no*no);
62 for (
size_t l = 0, kl = 0; l < no; ++l) {
63 for (
size_t k = 0; k <= l; ++k, ++kl) {
64 for (
size_t j = 0, ij = 0; j < no; ++j) {
65 for (
size_t i = 0; i <= j; ++i, ++ij) {
68 V(index(j, i), index(k, l)) - V(index(i, j), index(k, l))
70 auto v = T4(i + j * no + k * no * no, l);
85 Matrix T2 = T1 * C.transpose();
86 h.resize((no * no + no) / 2);
88 for (
size_t l = 0, kl = 0; l < no; ++l) {
89 for (
size_t k = 0; k <= l; ++k, ++kl) {
97 range shells(basis->nshell());
101 BOOST_FOREACH (
auto s, shells) {
102 range S = basis->range(s);
104 BOOST_FOREACH (
auto r, shells) {
105 range R = basis->range(r);
107 int1->compute_shell(s, r);
108 h_ao(R,S) = Matrix::Map(int1->buffer(), nr, ns);
111 integrals(C, h_ao, h);
A template class that maintains references counts.
Definition ref.h:361
RefSCMatrix transform(const OrbitalSpace &space2, const OrbitalSpace &space1, const Ref< SCMatrixKit > &kit=SCMatrixKit::default_matrixkit())
transform(s2,s1) returns matrix that transforms s1 to s2.
matrix< double > Matrix
Convience double matrix type.
Definition matrix.hpp:170
vector< double > Vector
Convience double vector type.
Definition matrix.hpp:172
Contains new MPQC code since version 3.
Definition integralenginepool.hpp:37