quantumdot/RadialPotential.hpp

00001 #ifndef _RADIAL_POTENTIAL_HPP_
00002 #define _RADIAL_POTENTIAL_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 <vector>
00025 #include "linalg.hpp"
00026 
00027 namespace quantumdot
00028 {
00029 
00048   class RadialPotential
00049   {
00050     public:
00052       enum quad_enum { STANDARD_HERMITE_QUAD, GENERALIZED_HERMITE_QUAD };
00054       enum basis_enum { GENERALIZED_LAGUERRE_BASIS, GENERALIZED_HERMITE_BASIS };
00055      
00056 
00057     private:
00058       double lambda;         
00059       double alpha;          
00060       double beta;           
00061       std::vector<double> p; 
00062       bool p_iseven;         
00063       quad_enum quad_type;   
00064       basis_enum basis_type; 
00065 
00066     public:
00068       RadialPotential()
00069       {
00070         // Set default potential parameters: Coulomb potential, lambda = 1.
00071         alpha = 1;
00072         beta = 0;
00073         p.resize(1);
00074         p_iseven = true;
00075         p[0] = 1.0;
00076         lambda = 1;
00077         quad_type = STANDARD_HERMITE_QUAD;
00078         basis_type = GENERALIZED_LAGUERRE_BASIS;
00079       }
00080 
00082       void setIntegrationMethod(quad_enum x) { quad_type = x; }
00083 
00085       void setBasisType(basis_enum x) { basis_type = x; }
00086 
00088       void setPIsEven(bool x) { p_iseven = x; }
00089 
00091       void setP(std::vector<double> poly) 
00092       { 
00093         p = poly; 
00094       }
00095 
00097       void setAlpha(double x) { alpha = x; }
00099       void setBeta(double x) { beta = x; }
00101       void setLambda(double x) { lambda = x; }
00102 
00103 
00108       void computeMatrix(dense_matrix& C, int n_max, int m = 0);
00109 
00121       void computeEffectiveMatrix(dense_matrix& Ceff, int n_max, int m = 0);
00122 
00124       std::ostream& operator<<(std::ostream& os)
00125       {
00126         using namespace std;
00127         os << "Potential:" << endl;
00128         os << "  r^(-"<<alpha<<")*p(r)*exp(-r*"<<beta<<")"<<endl;
00129       }
00130 
00131 
00132   };
00133 
00134 
00135 
00143   void computeHOMatrixGenHer(dense_matrix& H0, int N, int m);
00144 
00151   void computeLagGenHerTrafo(dense_matrix& U, int N_lag, int N_her, int m);
00152 
00153   
00154 
00155 
00156 }
00157 
00158 
00159 
00160 
00161 
00162 #endif // _RADIAL_POTENTIAL_HPP_

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