20 #ifndef JDFTX_ELECTRONIC_RADIALSCHRODINGER_H 21 #define JDFTX_ELECTRONIC_RADIALSCHRODINGER_H 23 #include <electronic/RadialFunction.h> 24 #include <electronic/matrix.h> 26 #include <core/scalar.h> 37 RadialSchrodinger(
const std::vector<double>& rArr,
const std::vector<double>& drArr,
38 const std::vector<double>& V,
double Z,
size_t iMatch=0.);
42 std::vector< std::vector<double> >
getFillings(
double nElectrons,
43 std::vector< std::vector<double> >* Eptr=0);
48 std::vector<double>*
n;
49 std::vector<double>*
Dn;
50 std::vector<double>*
tau;
51 std::vector< std::vector< std::vector<complex> > >*
z;
52 std::vector< std::vector<double> >*
E;
54 Outputs(std::vector<double>* n=0, std::vector<double>* Dn=0, std::vector<double>* tau=0,
55 std::vector< std::vector< std::vector<complex> > >* z=0, std::vector< std::vector<double> >* E=0)
56 : n(n), Dn(Dn), tau(tau), z(z), E(E) {}
60 double compute(
const std::vector< std::vector<double> >& F,
Outputs outputs);
63 const std::vector<double>& rArr;
64 const std::vector<double>& drArr;
65 std::vector<double> Vsub;
69 std::vector< std::map<int,double> > nodesEmin, nodesEmax;
70 std::vector< std::map<double,double> > cachedEerr;
71 std::vector< std::map<int,double> > cachedE;
77 {
double rInv = r ? 1./r : 0.;
78 double V = Vsub[iSub] - Z*rInv;
79 return complex(z.imag(), 2*(z.real()*(V-
E) - z.imag()*(l+1)*rInv));
90 int solveSchEqn(
int l,
double E,
complex* zSave=0);
97 void locateNodeCount(
int l,
int nNodes);
100 double getEerr(
int l,
double E);
103 double findE(
int l,
double Elo,
double Ehi,
double tol);
106 double getEig(
int l,
int nNodes,
complex* zEvec=0);
119 void step(
const diagMatrix& dV,
double alpha);
126 const std::vector<double> &r, &dr, &n0;
127 std::vector<double>
n;
128 std::vector< std::vector<double> > F;
131 #endif // JDFTX_ELECTRONIC_RADIALSCHRODINGER_H std::vector< double > * Dn
density gradient (radial direction, others 0 by symmetry)
Definition: RadialSchrodinger.h:49
Real diagonal matrix.
Definition: matrix.h:30
RadialSchrodinger(const std::vector< double > &rArr, const std::vector< double > &drArr, const std::vector< double > &V, double Z, size_t iMatch=0.)
std::vector< double > * n
electron density
Definition: RadialSchrodinger.h:48
std::vector< std::vector< double > > getFillings(double nElectrons, std::vector< std::vector< double > > *Eptr=0)
A function on a non-uniform real-space radial grid.
Definition: RadialFunction.h:101
Invert Kohn-Sham equations to get effective potential for a given electron density.
Definition: RadialSchrodinger.h:111
Nonlinear minimization templates.
Radial schrodinger equation solver (non-interacting eigen-problem for an atom)
Definition: RadialSchrodinger.h:32
Complex number (need to define our own because we need operators for gpu code as well) ...
Definition: scalar.h:49
Definition: Minimize.h:45
double compute(const std::vector< std::vector< double > > &F, Outputs outputs)
Compute total non-interacting energy of atom, given its fillings, and collect any optional outputs...
std::vector< double > * tau
kinetic energy density
Definition: RadialSchrodinger.h:50
Optional outputs from compute: retrieve all non-null quantities.
Definition: RadialSchrodinger.h:46
std::vector< std::vector< std::vector< complex > > > * z
eigenfunctions indexed by l and nNodes. Each z = (u, u') (See schEqn)
Definition: RadialSchrodinger.h:51
std::vector< std::vector< double > > * E
eigenvalues indexed by l and nNodes
Definition: RadialSchrodinger.h:52