Updates to projects


I didn’t post on this blog for a long time. Nevertheless, I didn’t stop the work on the projects. Most of them have improvements, some of them even serious additions. Some bugs are fixed and I even did some code cleanup to many of them. There are even a couple of newer projects on GitHub: QCSim and MachineLearning. This post is not about those, though, but about the changes and additions for the already described projects here. I probably won’t recall all the details about them, but hopefully I can describe the most important ones here.
So, without much ado, here are the projects, trying to keep the same order as they appear on the blog.

Some of the modified projects

Solar System

Since I wrote the old post, the project has changed a lot. Not the numerical method for simulation of the newtonian physics (although I switched from Velocity Verlet to Verlet since I don’t really need velocity, but the old code is still available with a #define), but the ‘optics’.
I added bump/normal mapping, so now the planets can show a relief, I added various layers that allow specular mapping (for example Earth’s water lightning is different than the land), a transparent layer on top (on Earth it’s the layer with the clouds) and even a layer for the night side (on Earth is used to show the lights from the cities). I added some screenshots on GitHub, visit it if you are curious about how it looks. I also added a ‘sky sphere’ that allowed me to show a nicer ‘sky’ from NASA. Probably there are more details about it that I don’t recall right now, but another thing that can be done is to load an ‘obj’ file and show a complex object in front of the camera (for example, a spaceship). Here is a video of it, showing some movements implemented with basic physics (not perfect, though):

And as you can see, there is also now a text (displayed with alpha blending) that shows the simulation time.

Electric field

For this one, there isn’t any important visual change, but there is some code cleanup and most importantly I cleaned up multithreading, which was awful. Now there is a threads pool for the whole application. The Runge-Kutta code is improved somewhat, for example it’s safer now to use it in multithreaded computation with less care. The changes went also in the chaos project that uses the same methods.

Event Driven Molecular Dynamics

For the next couple of projects, there weren’t many changes, except some code cleanup and for the ones containing the charting some improvement of it (it was split in several classes/source files and for the numerical group project the ugly refreshing each step is fixed, now redrawing is nicer). There are minor additions, for example the Ising project allows setting an interval or steps between collecting statistics.
Anyway, the next one containing a change really worth mentioning it this. Now it displays an alpha blended chart (displayed with the charting classes I already mentioned, basically drawn into a bitmap in memory then passed to OpenGL) showing speeds distribution:


This is probably the winner when it comes to bug fixes/updates/additions. I already mentioned on GitHub but I’ll add it here as well:

I added more basis sets, it’s not limited to STO-nG, a lot of basis set can be used now, the parsed format being nwchem. I also found and fixed a bug in the integrals repository that manifested for orbitals having L > 1. I also found this on GitHub and followed a lot of tutorials, implementing things in the Hartree-Fock project, sometimes more than the tutorials ask. Projects for MP2, DIIS, CCSD(T), CIS and TDHF/RPA are implemented. DIIS and MP2 are implemented for both the restricted and unrestricted methods. For those for which the acronyms are unclear, here it’s what they mean:

1) MP2: Møller–Plesset perturbation theory
2) DIIS: Direct Inversion of the Iterative Subspace
3) CCSD(T): Coupled Cluster
4) CIS: Configuration Interaction Singles
5) TDHF: Time-dependent Hartree-Fock
6) RPA: Random Phase Approximation

Those are quite a bit of additions and not so trivial. There are other things in there, for example I added the ability to compute moment integrals (only dipole for now, because of my laziness, I’ll add multipoles too if I need them) so one can now compute the dipole moment for a molecule. Also one can calculate the atomic charges (see also this).
Very few things are exposed in the UI (DIIS and MP2 are, the others are not), but there is a Test class with some code that could be used as examples for computations. I even provided an alternate way of computing the dipole moment (example on the H2O molecule) using the fact that I also provided a way to add an external electric field for the molecule (see the ElectricField member in the Molecule class).
In the UI one can try to display the dissociation energy… but do not expect it to be accurate.

That’s very shortly about all that I remember so far about what I added to the Hartree-Fock project. There might be some more minor changes, though.
As a fun fact, its sloc ‘complexity’ is about the same as for the Solar System project. Despite this, the later is just a very simple toy in comparison.

Nuclear Magnetic Resonance and Fourier Transform

There are some other projects before this, but I don’t recall what changes went into them (except code cleanup, chart classes changes and other minor stuff), so I skipped them here. I did add some changes/additions to the Density Matrix Renormalization Group page at the end of the page so I won’t repeat them here.

The NMR project has one addition that make it more interesting: I used VTK to display a 3D volumetric view of the results. Here is a video showing the new UI:

While doing that I found that the slices weren’t in the expected order (it makes sense to have that scan order, though) and corrected that.

Density Functional Theory for a quantum dot

While there are some changes and additions in there, they are not much. I added the Vosko-Wilk-Nusair exchange correlation and switched to it instead of the previous one which wasn’t so good (advantage: has LSDA support there as well, so if sometime I want to make it work with LSDA, it can be done). I also added a new example of potential and code (not exposed in the UI, but useable/functional) on how to compute a simple atom or molecule (because it uses plane waves, cannot go much further than hydrogen or H2). Some important thing related with this project is that I added a dft notebook in the GitHub Python repository. It’s basically most of the functionality of this project implemented in python. There is even more than it exists in the c++ project, since it covers all assignments for Thomas Arias lectures.

Ray tracing

This is the most successful project for now, if the number of stars is used as a metric, although is very far from being the most interesting from my point of view. I guess it has a larger audience than the ones that involve quantum physics…

Anyway, I added to it textures generation (perlin noise, perlin turbulence and perlin marble), this one was a thing that was presented in the books and was missing. The only thing that is still missing is the movement effect but I doubt that I’ll implement that, it’s easy and boring. Some other things are added that are not in the books: normals/bump mapping and specular mapping. I enhanced the obj loader and fixed some things and even cleaned the code a little. Also I added a ‘sky sphere’ as in the Solar System project.

DFT for an atom

The biggest addition here is that I added LSDA (local spin-density approximation) as well. I also added several more integration methods, the results are now even closer to the NIST ones.

Variational Quantum Monte Carlo

Since I posted it, I found a better solution for combining the orbitals. Far from using a linear combination of Slater determinants, but better than I had before. Here is the GitHub issue related with it referring some commits that did the improvement.


The blog is still alive and development on the projects still continues. There are even ‘new’ projects that do not have yet a description post on the blog, but that’s going to change.
I tried to list here some of the changes/additions I did on the projects, although I’m sure I forgot about many.

Print Friendly, PDF & Email

Leave a Reply (for privacy concerns, please read the Privacy Policy Page accessible from the top menu)

This site uses Akismet to reduce spam. Learn how your comment data is processed.