28 #ifndef _chemistry_qc_basis_petite_h
29 #define _chemistry_qc_basis_petite_h
31 #include <mpqc_config.h>
33 #include <mpqc_config.h>
35 #include <util/misc/scint.h>
36 #include <util/ref/ref.h>
37 #include <math/scmat/blocked.h>
38 #include <math/scmat/offset.h>
39 #include <chemistry/molecule/molecule.h>
40 #include <chemistry/qc/basis/gaussbas.h>
41 #include <chemistry/qc/basis/integral.h>
47 inline sc_int_least64_t
48 ij_offset64(sc_int_least64_t i, sc_int_least64_t j)
50 return (i>j) ? (((i*(i+1)) >> 1) + j) : (((j*(j+1)) >> 1) + i);
53 inline sc_int_least64_t
54 i_offset64(sc_int_least64_t i)
56 return ((i*(i+1)) >> 1);
62 int **compute_atom_map(
const Ref<GaussianBasisSet> &);
63 void delete_atom_map(
int **atom_map,
const Ref<GaussianBasisSet> &);
65 int **compute_shell_map(
int **atom_map,
const Ref<GaussianBasisSet> &);
66 void delete_shell_map(
int **shell_map,
const Ref<GaussianBasisSet> &);
88 SO& operator=(
const SO&);
91 void reset_length(
int);
94 int equiv(
const SO& so);
105 void set_length(
int);
106 void reset_length(
int);
108 int add(
SO& s,
int i);
109 void print(
const char *title);
151 int nirrep()
const {
return nirrep_; }
152 int order()
const {
return ng_; }
153 int atom_map(
int n,
int g)
const {
return (c1_) ? n : atom_map_[n][g]; }
154 int shell_map(
int n,
int g)
const {
return (c1_) ? n : shell_map_[n][g]; }
155 int lambda(
int ij)
const {
return (c1_) ? 1 : (int) lamij_[ij]; }
156 int lambda(
int i,
int j)
const
157 {
return (c1_) ? 1 : (int) lamij_[ij_offset(i,j)]; }
159 int in_p1(
int n)
const {
return (c1_) ? 1 : (int) p1_[n]; }
160 int in_p2(
int ij)
const {
return (c1_) ? 1 : (int) lamij_[ij]; }
162 int in_p2(
int i,
int j)
const {
return (c1_) ? 1 : (int) lamij_[ij_offset(i,j)]; }
163 int in_p4(
int ij,
int kl,
int i,
int j,
int k,
int l)
const;
165 int in_p4(
int i,
int j,
int k,
int l)
const;
167 int nfunction(
int i)
const
168 {
return (c1_) ? gbs_->nbasis() : nbf_in_ir_[i]; }
170 int nblocks()
const {
return nblocks_; }
172 void print(std::ostream& =
ExEnv::out0(),
int verbose=1);
182 RefSCMatrix
r(
int g);
214 void symmetrize(
const RefSymmSCMatrix& skel,
const RefSymmSCMatrix& sym);
219 RefSymmSCMatrix
to_SO_basis(
const RefSymmSCMatrix& O_ao);
223 RefSymmSCMatrix
to_AO_basis(
const RefSymmSCMatrix& O_so);
236 PetiteList::in_p4(
int ij,
int kl,
int i,
int j,
int k,
int l)
const
241 sc_int_least64_t ijkl = i_offset64(ij)+kl;
244 for (
int g=1; g < ng_; g++) {
245 int gij = ij_offset(shell_map_[i][g],shell_map_[j][g]);
246 int gkl = ij_offset(shell_map_[k][g],shell_map_[l][g]);
247 sc_int_least64_t gijkl = ij_offset64(gij,gkl);
251 else if (gijkl == ijkl)
259 PetiteList::in_p4(
int i,
int j,
int k,
int l)
const
264 int ij = ij_offset(i,j);
265 int kl = ij_offset(k,l);
266 sc_int_least64_t ijkl = ij_offset64(ij,kl);
269 for (
int g=1; g < ng_; g++) {
270 int gij = ij_offset(shell_map_[i][g],shell_map_[j][g]);
271 int gkl = ij_offset(shell_map_[k][g],shell_map_[l][g]);
272 sc_int_least64_t gijkl = ij_offset64(gij,gkl);
276 else if (gijkl == ijkl)