ifilot / dftcxx Goto Github PK
View Code? Open in Web Editor NEWC++ based DFT program for educational purposes
License: GNU General Public License v3.0
C++ based DFT program for educational purposes
License: GNU General Public License v3.0
Running the program for certain molecules (e.g. CO) results in slight oscillations in the computed energies in the SCF procedure. As convergence is not achieved, the program keeps looping infinitely, so I suggest imposing a maximum number of iterations to prevent this behaviour.
Hi,
I'm trying to compile the project on windows and I noticed something:
In double SH::legendre (int n, double x)
you have at line 58:
double v[n];
That would allow using indices for v from 0 to n-1. Despite that, v[n] is written and returned.
The simple solution would be: double v[n + 1];
(as you already have in SH::legendre_p
).
Another issue is that the code as it is creates problems when compiling with VisualC++ (error because n is not a constant), The solution would be:
double *v = new double[n+1];
and just before return:
const double val = v[n];
delete[] v;
return val;
and similarily in SH::legendre_p
PS Nice work. How long did it take you to implement it? I'm thinking of adding DFT to my Hartree-Fock program for molecules, I did implement some DFT code before, but with plane-waves basis: https://compphys.go.ro/dft-for-a-quantum-dot/
Adrian
Replace all instances of the EigenSolver
with SelfAdjointEigenSolver
. The latter ensures that the coefficient matrix is unitary, the diagonalization algorithm is faster and all eigenvalues and eigenvectors are automatically sorted.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.