Here is the raw code for the atom simulation, includes raytracer version, realtime runner, and 2D version
web version: kavang.com/atom
What the model does:
- Takes the quantum numbers (n, l, m) that describe an orbital's shape
- Using the schrodinger equation, sample r, theta, and phi coordinates from those quantum numbers
- Render those possible positions and color code them relative to their probabilities (brighter areas have higher probability)
- Clone the repository:
git clone https://github.com/kavan010/Atoms.git
- CD into the newly cloned directory
cd ./Atoms
- Install dependencies with Vcpkg
vcpkg install
- Get the vcpkg cmake toolchain file path
vcpkg integrate install- This will output something like :
CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake"
- Create a build directory
mkdir build
- Configure project with CMake
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake- Use the vcpkg cmake toolchain path from above
- Build the project
cmake --build build
- Run the program
- The executables will be located in the build folder
If you don't want to use vcpkg, or you just need a quick way to install the native development packages on Debian/Ubuntu, install these packages and then run the normal CMake steps above:
sudo apt update
sudo apt install build-essential cmake \
libglew-dev libglfw3-dev libglm-dev libgl1-mesa-devThis provides the GLEW, GLFW, GLM and OpenGL development files so find_package(...) calls in CMakeLists.txt can locate the libraries. After installing, run the cmake -B build -S . and cmake --build build commands as shown in the Build Instructions.
the 2D bohr model works is in atom.cpp, the raytracer and realtime models are right beside
- warning, I would recommend running the realtime model with <100k particles first to be sure, raytracer is super compu-intensive so make sure your system can handle it!