29 #pragma implementation
32 #ifndef _mpqc_src_lib_chemistry_qc_mbptr12_srr12intermediates_h
33 #define _mpqc_src_lib_chemistry_qc_mbptr12_srr12intermediates_h
35 #if defined(MPQC_NEW_FEATURES)
36 # include <tiledarray.h>
38 # error "sr_r12intermediates.h requires MPQC3 runtime, but it is not available"
41 #include <chemistry/qc/wfn/rdm.h>
42 #include <chemistry/qc/mbptr12/r12wfnworld.h>
43 #include <../bin/mpqc/mpqcinit.h>
45 namespace TA = TiledArray;
53 TA::Array<T, 4, DA4_Tile>* owner_;
54 std::array<std::size_t, 4> index_;
60 typedef TA::Tensor<T> eval_type;
61 typedef typename eval_type::range_type range_type;
65 DA4_Tile(TA::Array<T, 4, DA4_Tile>* owner,
66 const std::array<std::size_t, 4>& index,
69 owner_(owner), index_(index), darray4_(darray4), te_type_(te_type)
72 operator TA::Tensor<T> ()
const;
74 range_type
range()
const {
75 return owner_->trange().make_tile_range(index_);
80 template <
typename Archive>
91 TA::Array<TA::Tensor<T>, 2,
DA4_Tile34 >* owner_;
92 std::array<std::size_t, 2> index_;
98 typedef TA::Tensor<TA::Tensor<T> > eval_type;
99 typedef typename eval_type::range_type range_type;
100 typedef T numeric_type;
105 const std::array<std::size_t, 2>& index,
108 owner_(owner), index_(index), darray4_(darray4), te_type_(te_type)
112 operator TA::Tensor<TA::Tensor<T> > ()
const;
116 template <
typename Archive>
124 template <
typename T,
unsigned int DIM,
typename ElementGenerator>
127 TA::Array<T, DIM, LazyTensor>* owner_;
128 std::array<std::size_t, DIM> index_;
129 ElementGenerator* element_generator_;
132 typedef T value_type;
133 typedef TA::Tensor<T> eval_type;
134 typedef typename eval_type::range_type range_type;
139 owner_(
other.owner_), index_(
other.index_), element_generator_(
other.element_generator_)
143 owner_ =
other.owner_;
144 index_ =
other.index_;
145 element_generator_ =
other.element_generator_;
149 LazyTensor(TA::Array<T, DIM, LazyTensor>* owner,
150 const std::array<std::size_t, DIM>& index,
151 ElementGenerator* gen) :
152 owner_(owner), index_(index), element_generator_(gen)
155 operator TA::Tensor<T> ()
const {
157 eval_type tile(owner_->trange().make_tile_range(index_));
159 auto* ptr = tile.data();
160 for(
auto i = tile.range().begin();
161 i!=tile.range().end();
164 *ptr = (*element_generator_)(*i);
173 template <
typename Archive>
180 namespace expressions {
185 template <
typename T>
189 MPQC_ASSERT(s_ == 0 || s_ == 1);
192 template <
typename Index> T operator()(
const Index& i) {
194 if (i[0] == i[1] && i[0] == i[2] && i[0] == i[3])
196 else if (i[0] == i[2] && i[1] == i[3])
198 else if (i[0] == i[3] && i[1] == i[2])
202 if ((i[0] == i[2] && i[1] == i[3]) || (i[0] == i[3] && i[1] == i[2]))
217 template <
typename T>
237 typedef TA::Array<T, 4, LazyTensor<T, 4, expressions::TGeminalGenerator<T> > >
TArray4Tg;
255 const Ref<R12WavefunctionWorld>& r12world()
const {
262 std::pair<TArray2,TArray2>
V_diag();
267 std::pair<TArray2,TArray2>
X_diag();
272 std::pair<TArray2,TArray2>
B_diag();
287 TArray2 XaiAddToXam(
const TA::Array<double, 2 >& Xam,
288 const TA::Array<double, 2 >& Xai);
290 TArray2 BPk_Qk(
const char* p,
const char* q,
291 const double C_0,
const double C_1);
292 TArray4 Bpr_qs(
const char* p,
const char* q);
296 TArray4 VPq_Rs(
const char* p,
const char* q,
297 const char* r,
const char* s,
298 const double C_0,
const double C_1);
300 TArray2 VRk_Sk(
const char* r,
const char* s,
301 const double C_0,
const double C_1);
311 TArray2 Xam_Cmp2f12(
const double C_0,
const double C_1,
317 void compute_Df12_XB(
const double C_0,
const double C_1,
321 TArray2 Xam_Df12_XB(
const double C_0,
const double C_1,
326 TArray2 Xam_V(
const double C_0,
const double C_1);
328 TArray2 Xam_X(
const double C_0,
const double C_1);
330 TArray2 Xam_B(
const double C_0,
const double C_1);
333 TArray2 Xiip_VBX(
const double C_0,
const double C_1);
336 TArray2 Xiip_CVT(
const double C_0,
const double C_1,
340 TArray2 Xam_CT2_ccsd(
const double C_0,
const double C_1,
343 TArray2 Xam_VT_ccsd(
const double C_0,
const double C_1,
361 void compute_Delta_cc(
const TA::TiledRange& TR_ai,
362 const TA::TiledRange& TR_abij,
365 void compute_intermediates_TFW_ccsd(
374 void compute_intermediates_CW_ccsd(
383 void compute_T_ccsd(
TArray2& t1,
TArray4& t2,
const std::string method);
387 const std::string method);
390 void compute_cc2_1rdm_amp(
const TArray2& T1_cc2,
const TArray4& T2_cc2,
396 void compute_Gamma_ijab_ccsd(
const TArray2& T1,
const TArray4& T2,
423 TArray4 VPQ_RS(
const char* p,
const char* q,
424 const char* r,
const char* s);
425 TArray2 Xam_CT2L2_f12b(
const double C_0,
const double C_1,
428 TArray2 Xam_VTL_f12b(
const double C_0,
const double C_1,
432 TArray2 Xam_VT1T1_f12b(
const double C_0,
const double C_1,
435 TArray2 Xam_VT1T1_f12b_test(
const double C_0,
const double C_1,
438 TArray2 Xam_VL2T1_f12b(
const double C_0,
const double C_1,
441 TArray2 Xam_VL2T1_f12b_test(
const double C_0,
const double C_1,
444 TArray2 Xam_VL2T1T1_f12b(
const double C_0,
const double C_1,
447 TArray2 Xam_VL2T1T1_f12b_test(
const double C_0,
const double C_1,
451 TArray2 Xiip_CVT_f12b(
const double C_0,
const double C_1,
455 TArray2 Xiip_VT1T1_f12b(
const double C_0,
const double C_1,
549 TA::expressions::TsrExpr<const TArray4d, true>
_4(
const std::string& key);
573 TA::expressions::TsrExpr<const TArray2, true>
_2(
const std::string& key);
578 TA::expressions::TsrExpr<const TArray4Tg, true>
_Tg(
const std::string& key);
581 madness::World& world_;
596 std::shared_ptr<TArray22> ab_O_cd(
const std::string& key,
599 std::map<std::string, std::shared_ptr<TArray22> > tarray22_registry_;
600 std::map<std::string, std::shared_ptr<TArray4d> > tarray4_registry_;
601 std::map<std::string, std::shared_ptr<TArray2> > tarray2_registry_;
602 std::map<std::string, std::shared_ptr<TArray22d> > tarray22d_registry_;
603 std::map<std::string, std::shared_ptr<TArray4Tg> > tarray4tg_registry_;
610 TArray22& _(
const std::string& key);
621 std::string to_space(
const std::string& index);
641 static std::string to_space_(std::string index);
646 std::vector<size_t> space_hashmarks(std::string space_label)
const;
648 template <
size_t NDIM>
650 make_trange(
const std::array<std::string, NDIM>& spaces)
const;
663 template <
typename Array22>
664 TA::expressions::TsrExpr<const Array22, true> take(
const Array22& ij_o_pq,
667 typedef TA::Tensor<TA::Tensor<T> > value_type;
670 return make_unary_tensor(ij_o_pq(
"i,j"),
675 return make_unary_tensor(ij_o_pq(
"i,j"),
680 template <
typename Array22>
681 TA::expressions::TsrExpr<const TArray2, true> dotket(
const Array22& ij_o1_pq,
682 const Array22& ij_o2_pq,
683 bool transpose_o2_ket =
false) {
685 typedef TA::Tensor<TA::Tensor<T> > value_type;
686 if (transpose_o2_ket ==
false) {
688 return make_binary_tensor(ij_o1_pq(
"i,j"), ij_o2_pq(
"i,j"),
693 return make_binary_tensor(ij_o1_pq(
"i,j"), ij_o2_pq(
"j,i"),
701 #include <chemistry/qc/mbptr12/sr_r12intermediates_util.h>
702 #include <chemistry/qc/mbptr12/sr_r12intermediates_VXB_diag.h>
704 #endif // end of header guard
makes a geminal T tensor
Definition: sr_r12intermediates.h:186
void serialize(Archive &ar)
Definition: sr_r12intermediates.h:117
void serialize(Archive &ar)
Definition: sr_r12intermediates.h:174
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition: matrix.h:135
A template class that maintains references counts.
Definition: ref.h:361
void serialize(Archive &ar)
Definition: sr_r12intermediates.h:81
Tile of a DIM-order tensor that's "evaluated" when needed by calling ElementGenerator({i0,...
Definition: sr_r12intermediates.h:125
SpinCase1 other(SpinCase1 S)
given 1-spin return the other 1-spin
Definition: sr_r12intermediates.h:181
TGeminalGenerator(unsigned int spin=0)
Definition: sr_r12intermediates.h:188
Definition: sr_r12intermediates.h:182
Tile of a <34> slice of <1234> that's "evaluated" when needed by reading from DistArray4 holding pqrs...
Definition: sr_r12intermediates.h:89
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
Tile of a 4-index tensor that's "evaluated" when needed by reading from DistArray4.
Definition: sr_r12intermediates.h:51
Generated at Sun Jan 26 2020 23:23:59 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.