00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifdef __GNUG__
00029 #pragma interface
00030 #endif
00031
00032 #ifndef _mpqc_src_lib_chemistry_qc_mbptr12_mointsruntime_h
00033 #define _mpqc_src_lib_chemistry_qc_mbptr12_mointsruntime_h
00034
00035 #include <util/state/state.h>
00036 #include <chemistry/qc/mbptr12/r12ia.h>
00037 #include <chemistry/qc/mbptr12/spin.h>
00038 #include <chemistry/qc/mbptr12/transform_factory.h>
00039
00040 namespace sc {
00041
00045 class MOIntsRuntime : virtual public SavableState {
00046 public:
00047
00048 typedef TwoBodyMOIntsTransform TwoBodyIntsTransform;
00049
00050 typedef R12IntsAcc TwoBodyIntsAcc;
00051 MOIntsRuntime(const Ref<MOIntsTransformFactory>& factory);
00052 MOIntsRuntime(StateIn& si);
00053 void save_data_state(StateOut& so);
00054
00057 bool exists(const std::string& key) const;
00058
00065 Ref<TwoBodyIntsTransform> get(const std::string& key);
00066
00069 std::string params_key(const Ref<IntParams>& params) const;
00072 Ref<IntParams> params(const std::string& key) const;
00073
00074 void register_params(const std::string& key, const Ref<IntParams>& params) const;
00075
00076 std::string register_params(const Ref<IntParams>& params) const;
00080 std::string descr_key(const Ref<TwoBodyIntDescr>& descr);
00081
00083 const Ref<MOIntsTransformFactory>& factory() const { return factory_; }
00084
00086 class Layout {
00087 public:
00088 Layout(const std::string& str);
00089 Layout(const Layout& other);
00090 Layout& operator=(const Layout& other);
00091 bool operator==(const Layout& other) const;
00092 operator std::string();
00093
00094 private:
00095 typedef enum {
00096 b1b2_k1k2,
00097 b1k1_b2k2
00098 } Type;
00099 Type type_;
00100 };
00101 static Layout Layout_b1b2_k1k2;
00102 static Layout Layout_b1k1_b2k2;
00103
00104 private:
00105 Ref<MOIntsTransformFactory> factory_;
00106
00107
00108 typedef Registry<std::string, Ref<IntParams>, detail::NonsingletonCreationPolicy, std::equal_to<std::string>,
00109 RefObjectEqual<IntParams> > ParamRegistry;
00110 Ref<ParamRegistry> params_;
00111
00112
00113 typedef Registry<std::string, Ref<TwoBodyMOIntsTransform>, detail::NonsingletonCreationPolicy > TformRegistry;
00114 Ref<TformRegistry> tforms_;
00115
00116
00117 const Ref<TwoBodyMOIntsTransform>& create_tform(const std::string& key);
00118
00122 Ref<TwoBodyIntDescr> create_descr(const std::string& oper_key,
00123 const std::string& params_key);
00124
00125 };
00126
00128 class ParsedTwoBodyIntKey {
00129 public:
00130 ParsedTwoBodyIntKey(const std::string& key);
00131
00132 const std::string& key() const { return key_; }
00133 const std::string& bra1() const { return bra1_; }
00134 const std::string& bra2() const { return bra2_; }
00135 const std::string& ket1() const { return ket1_; }
00136 const std::string& ket2() const { return ket2_; }
00137 const std::string& oper() const { return oper_; }
00138 const std::string& params() const { return params_; }
00139 const std::string& layout() const { return layout_; }
00140
00142 static std::string key(const std::string& bra1,
00143 const std::string& bra2,
00144 const std::string& ket1,
00145 const std::string& ket2,
00146 const std::string& oper,
00147 const std::string& params,
00148 const std::string& layout);
00150 static std::string key(const std::string& bra1,
00151 const std::string& bra2,
00152 const std::string& ket1,
00153 const std::string& ket2,
00154 const std::string& descr,
00155 const std::string& layout);
00157 static std::string key(const Ref<TwoBodyIntDescr>& descr);
00159 static Ref<TwoBodyIntDescr> create_descr(const std::string& oper_key,
00160 const Ref<IntParams>& p,
00161 const Ref<Integral>& integral);
00162
00163 private:
00164 std::string key_;
00165 std::string bra1_, bra2_, ket1_, ket2_;
00166 std::string oper_;
00167 std::string params_;
00168 std::string layout_;
00169 };
00170
00171 }
00172
00173 #endif
00174
00175
00176
00177
00178