quantumdot/QdotInteraction.hpp

Go to the documentation of this file.
00001 #ifndef _QDOT_INTERACTION_HPP_
00002 #define _QDOT_INTERACTION_HPP_
00003 
00004 //
00005 // Copyright (c) 2008 Simen Kvaal
00006 //
00007 // This file is part of OpenFCI.
00008 //
00009 // OpenFCI is free software: you can redistribute it and/or modify
00010 // it under the terms of the GNU General Public License as published by
00011 // the Free Software Foundation, either version 3 of the License, or
00012 // (at your option) any later version.
00013 //
00014 // OpenFCI is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU General Public License
00020 // along with OpenFCI. If not, see <http://www.gnu.org/licenses/>.
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 } // namespace quantumdot
00211 
00212 
00213 #endif 

Generated on Wed Jun 17 11:44:02 2009 for OpenFCI by  doxygen 1.4.7