Real-time OpenGL renderer for hydrogen electron probability clouds, sampled from exact wavefunctions by CDF inverse transform. Reference only.
  • C 97.6%
  • C++ 2.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-06-18 20:47:35 -06:00
include docs: reconcile code and docs with the CDF sampling rewrite 2026-05-31 17:47:33 -05:00
src docs: reconcile code and docs with the CDF sampling rewrite 2026-05-31 17:47:33 -05:00
third_party/imgui feat: quantum atom renderer — all 5 sprints complete 2026-02-17 16:59:25 -05:00
.gitignore chore: stop tracking build artifacts 2026-05-31 17:47:33 -05:00
CMakeLists.txt feat: quantum atom renderer — all 5 sprints complete 2026-02-17 16:59:25 -05:00
imgui.ini adding to github 2026-02-17 17:15:05 -05:00
LICENSE Sunset: add not-maintained status note + LICENSE 2026-06-18 20:47:35 -06:00
README.md Sunset: add not-maintained status note + LICENSE 2026-06-18 20:47:35 -06:00

Quantum Atom Renderer

Status: not actively maintained. Left up as a reference.

Real-time visualization of hydrogen electron probability clouds using CDF inverse-transform sampling of exact wavefunctions, rendered as glowing point clouds in OpenGL.

Orbitals

What it does

Generates 100,000+ 3D points distributed according to |ψ(r,θ,φ)|² for hydrogen-like orbitals using CDF inverse-transform sampling, then renders them as additive-blended GL_POINTS with a glow fragment shader.

Supports arbitrary quantum numbers (n, l, m) up to n=5, with presets for common orbitals (1s, 2p, 3d, 4f, etc.).

Controls

  • Left-drag: Orbit camera
  • Scroll: Zoom
  • ImGui panel: Change orbital, point count, colors, glow

Build

# Dependencies (Ubuntu/Debian)
sudo apt install libglfw3-dev libglm-dev cmake

# Build
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)

# Run
./build/atomsim

Tech Stack

  • C++17, OpenGL 3.3 Core Profile
  • GLFW — windowing
  • GLAD2 — OpenGL loader
  • GLM — math (no custom vector types)
  • Dear ImGui — parameter UI
  • CMake — build system

Physics

Exact hydrogen wavefunctions:

ψ_nlm(r,θ,φ) = R_nl(r) · Y_lm(θ,φ)

where R_nl uses generalized Laguerre polynomials and Y_lm uses associated Legendre polynomials. Points are sampled by inverse-transform sampling of per-axis CDFs: a radial CDF from r²·|R_nl(r)|² and a polar CDF from sin(θ)·|P_l^m(cosθ)|² (so the r² sin(θ) volume element is baked into the PDFs), with the azimuth φ drawn uniformly.

Architecture

File Purpose
src/main.cpp Window, render loop, ImGui controls
src/orbital.cpp Wavefunction math + CDF sampling
src/shader.cpp Shader compilation/linking
src/camera.cpp Arcball camera
src/glad.c GLAD2 OpenGL loader