28 #ifndef _chemistry_qc_lcao_utils_h
29 #define _chemistry_qc_lcao_utils_h
32 #include <math/scmat/matrix.h>
33 #include <chemistry/qc/wfn/spin.h>
34 #include <math/mmisc/pairiter.h>
35 #include <math/distarray4/distarray4.h>
45 template <PureSpinCase2 spin>
46 RefSCMatrix
spinadapt(
const RefSCMatrix &A,
47 const Ref<OrbitalSpace> &bra,
48 const Ref<OrbitalSpace> &ket);
54 const Ref<OrbitalSpace>& bra,
55 const Ref<OrbitalSpace>& ket,
56 bool accumulate =
false);
68 template <
bool accumulate>
70 const Ref<OrbitalSpace>& bra1,
71 const Ref<OrbitalSpace>& bra2,
72 const Ref<OrbitalSpace>& ket1,
73 const Ref<OrbitalSpace>& ket2);
81 template <
bool accumulate>
82 void antisymmetrize(RefSymmSCMatrix& Aanti,
const RefSymmSCMatrix& A,
83 const Ref<OrbitalSpace>& bra1);
87 template <
bool accumulate>
94 template <
bool Accumulate>
95 void symmetrize(RefSCMatrix& Asymm,
const RefSCMatrix& A,
96 const Ref<OrbitalSpace>& bra,
97 const Ref<OrbitalSpace>& ket);
110 template <
bool Accumulate, sc::fastpairiter::PairSymm BraSymm, sc::fastpairiter::PairSymm KetSymm>
111 void symmetrize12(RefSCMatrix& Asymm,
const RefSCMatrix& A,
112 const Ref<OrbitalSpace>& bra1,
113 const Ref<OrbitalSpace>& bra2,
114 const Ref<OrbitalSpace>& ket1,
115 const Ref<OrbitalSpace>& ket2);
126 template <
bool Accumulate,
127 sc::fastpairiter::PairSymm SrcBraSymm,
128 sc::fastpairiter::PairSymm SrcKetSymm,
129 sc::fastpairiter::PairSymm DstBraSymm,
130 sc::fastpairiter::PairSymm DstKetSymm
132 void symmetrize(RefSCMatrix& Aanti,
const RefSCMatrix& A,
133 const Ref<OrbitalSpace>& bra1,
134 const Ref<OrbitalSpace>& bra2,
135 const Ref<OrbitalSpace>& ket1,
136 const Ref<OrbitalSpace>& ket2);
140 std::vector<double>
convert(
const RefDiagSCMatrix& A);
147 bool transpose =
false);
154 map(
const Ref<DistArray4>& src,
155 const Ref<OrbitalSpace>& isrc,
156 const Ref<OrbitalSpace>& jsrc,
157 const Ref<OrbitalSpace>& xsrc,
158 const Ref<OrbitalSpace>& ysrc,
159 Ref<DistArray4>& dest,
160 const Ref<OrbitalSpace>& idest,
161 const Ref<OrbitalSpace>& jdest,
162 const Ref<OrbitalSpace>& xdest,
163 const Ref<OrbitalSpace>& ydest);
180 template <
typename T>
181 void bzerofast(T* s,
size_t n) {
182 memset(static_cast<void*>(s), 0, n*
sizeof(T));
void print_f77_mat(const std::string &comment, const double *A, unsigned int nrow, unsigned int ncol, bool transpose=false)
print out the Fortran-style matrix
Ref< SpatialMOPairIter > mopairiter(const Ref< OrbitalSpace > &space1, const Ref< OrbitalSpace > &space2)
Constructs an appropriate MOPairIter object.
A template class that maintains references counts.
Definition: ref.h:361
void symmetrize(const Ref< GPetiteList2 > &plist2, const Ref< Integral > &integral, const RefSymmSCMatrix &skel, const RefSymmSCMatrix &sym)
Uses plist2 to convert the "skeleton" matrix into the full matrix. Only applicable when the two basis...
void symmetrize12(RefSCMatrix &Asymm, const RefSCMatrix &A, const Ref< OrbitalSpace > &bra1, const Ref< OrbitalSpace > &bra2, const Ref< OrbitalSpace > &ket1, const Ref< OrbitalSpace > &ket2)
Generalization of the above.
Definition: utils.impl.h:329
std::vector< double > convert(const RefDiagSCMatrix &A)
Converts RefDiagSCMatrix to std::vector<double>
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition: dim.h:152
RefSCMatrix spinadapt(const RefSCMatrix &A, const Ref< OrbitalSpace > &bra, const Ref< OrbitalSpace > &ket)
Takes the 4-index quantity <ij|A|kl> and returns, depending on the value of the PureSpinCase2 spin,...
Definition: utils.impl.h:38
std::vector< int > map(const GaussianBasisSet &B, const GaussianBasisSet &A)
same as operator<<, except A does not have to be contained in B, map[a] = -1 if function a is not in ...
This class produces MOPairIter objects.
Definition: utils.h:166
RefSCDimension scdim_ab(const Ref< OrbitalSpace > &space1, const Ref< OrbitalSpace > &space2)
Constructs an appropriate RefSCDimension object for different-spin pair.
RefSCDimension scdim_aa(const Ref< OrbitalSpace > &space1, const Ref< OrbitalSpace > &space2)
Constructs an appropriate RefSCDimension object for same-spin pair.
RefSymmSCMatrix to_lower_triangle(const RefSCMatrix &B)
Returns the lower triangle of the matrix B (which should be symmetric)
void antisymmetrize(RefSCMatrix &Aanti, const RefSCMatrix &A, const Ref< OrbitalSpace > &bra, const Ref< OrbitalSpace > &ket, bool accumulate=false)
Antisymmetrizes 4-index quantity <ij|A|kl> -> <ij|A|kl> - <ij|A|lk> and saves to Aanti.
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
Generated at Sun Jan 26 2020 23:23:58 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.