00001 #ifndef _QDOT_INTERACTION_HPP_
00002 #define _QDOT_INTERACTION_HPP_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <cassert>
00025
00026 #include "linalg.hpp"
00027 #include "sparse.hpp"
00028 #include "RadialPotential.hpp"
00029
00044 namespace quantumdot {
00045
00046
00048 typedef struct
00049 {
00050 int N1, m1, N2, m2;
00051 } orb_pair;
00052
00088 class QdotInteraction
00089 {
00090
00091 private:
00093 int R;
00094
00096 std::vector<dense_matrix> C;
00097
00102 std::vector<int> C_index;
00103
00106 std::vector<dense_matrix> T;
00107
00109 double lambda;
00110
00113 std::vector<simple_sparse::SparseMatrix<size_t, double> > U;
00114
00116 std::vector<std::map<int, size_t> > state_map;
00117
00119 bool precomputed;
00120
00122 int n_orbitals;
00123
00125 RadialPotential potential;
00126
00127 protected:
00131 void buildTalmiBlocks();
00132
00133
00139 int orbitalMap2(int N, int m)
00140 {
00141 return (N*(N+2)+m)/2;
00142 }
00143
00144 public:
00146 QdotInteraction()
00147 {
00148 lambda = 1.0;
00149 R = -1;
00150 precomputed = false;
00151 }
00152
00154 void setRadialPotential(const RadialPotential& u) { potential = u; }
00155
00158 void buildInteractionComBlocks();
00159
00162 void buildEffectiveInteractionComBlocks(int g);
00163
00166 void setLambda(double ell) { lambda = ell; }
00167
00170 void setR(int the_R)
00171 {
00172 R = the_R;
00173 assert(R >= 0);
00174 buildTalmiBlocks();
00175 }
00176
00181 double singleElement(int N1, int m1, int N2, int m2, int N1pr, int m1pr, int N2pr, int m2pr);
00182
00193 double singleElementAnalytic(int N1, int m1, int N2, int m2, int N4, int m4, int N3, int m3);
00194
00196 void precomputeLabFrameMatrix();
00197
00198
00199 };
00200
00201
00206 void computeTalmiMatrix(dense_matrix& TN, int N);
00207
00208
00209
00210 }
00211
00212
00213 #endif