{"id":24986981,"url":"https://github.com/hitthecodelabs/quantummechanicsvisualized","last_synced_at":"2025-10-06T23:51:58.930Z","repository":{"id":210162919,"uuid":"725386582","full_name":"hitthecodelabs/QuantumMechanicsVisualized","owner":"hitthecodelabs","description":"Functions to calculate and visualize the probability density of hydrogen atom orbitals ","archived":false,"fork":false,"pushed_at":"2023-12-02T01:44:00.000Z","size":4964,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T11:44:04.690Z","etag":null,"topics":["hydrogen-atom","physics","quantum-mechanics"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hitthecodelabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-11-30T03:04:05.000Z","updated_at":"2023-12-02T02:18:39.000Z","dependencies_parsed_at":"2023-12-16T00:13:09.086Z","dependency_job_id":"52e13642-f34f-4644-977b-1d85a591d218","html_url":"https://github.com/hitthecodelabs/QuantumMechanicsVisualized","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":0.2222222222222222,"last_synced_commit":"c19085b6c8a06dd5560fcf114ec34a77f6195292"},"previous_names":["hitthecodelabs/quantummechanicsvisualized"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitthecodelabs%2FQuantumMechanicsVisualized","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitthecodelabs%2FQuantumMechanicsVisualized/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitthecodelabs%2FQuantumMechanicsVisualized/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitthecodelabs%2FQuantumMechanicsVisualized/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hitthecodelabs","download_url":"https://codeload.github.com/hitthecodelabs/QuantumMechanicsVisualized/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246174531,"owners_count":20735413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hydrogen-atom","physics","quantum-mechanics"],"created_at":"2025-02-04T11:35:06.650Z","updated_at":"2025-10-06T23:51:53.894Z","avatar_url":"https://github.com/hitthecodelabs.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QuantumMechanicsVisualized\n\nThis repository contains functions to calculate and visualize the probability density of hydrogen atom orbitals in both 2D and 3D.\n\n## Theoretical Background\n\nThe probability density $|\\Psi|^2$ of the hydrogen atom's electron is calculated using the wave function $\\Psi$, which is a product of the radial and angular parts. The radial part depends on the principal and azimuthal quantum numbers `n` and `l`, while the angular part depends on the azimuthal and magnetic quantum numbers `l` and `m`.\n\n### Radial Part\n\nThe radial part of the wave function is given by:\n\n$$ R_{nl}(r) = \\sqrt{\\left(\\frac{2}{n a_0}\\right)^3 \\frac{(n-l-1)!}{2n[(n+l)!]^3}} e^{- \\frac{r}{n a_0}} \\left(\\frac{2r}{n a_0}\\right)^l L_{n-l-1}^{2l+1}\\left(\\frac{2r}{n a_0}\\right) $$\n\nwhere `L` are the generalized Laguerre polynomials and $a_0$ is the Bohr radius.\n\n### Angular Part\n\nThe angular part of the wave function is given by the spherical harmonics:\n\n$$ Y_{lm}(\\theta, \\phi) = (-1)^{\\frac{m + |m|}{2}} \\sqrt{\\frac{(2l + 1)}{4\\pi} \\frac{(l - |m|)!}{(l + |m|)!}} P_l^{|m|}(\\cos \\theta) e^{im\\phi} $$\n\nwhere $P_l^m$ are the associated Legendre polynomials.\n\n### Probability Density\n\nThe probability density $|\\Psi|^2$ is the product of the square of the radial part and the square of the absolute value of the angular part:\n\n$$ |\\Psi|^2 = |R_{nl}(r) Y_{lm}(\\theta, \\phi)|^2 $$\n\n## Sample Visualizations\n\nBelow are some sample visualizations generated by the functions in this repository.\n\n### 2D Probability Density Plots\n\n![2D Probability Density Plot](images/sample1_2D.png)\n\n![2D Probability Density Plot](images/sample2_2D.png)\n\n*Examples of a 2D probability density plot for hydrogen atom orbital.*\n\n### 3D Probability Density Plots\n\n![3D Probability Density Plot](images/sample4_3D.png)\n\n![3D Probability Density Plot](images/sample2_3D.png)\n\n![3D Probability Density Plot](images/sample1_3D.png)\n\n![3D Probability Density Plot](images/sample3_3D.png)\n\n*Examples of a 3D probability density plot for hydrogen atom orbital.*\n\n## Functions\n\n### `calculate_hydrogen_density_2d`\n\nCalculates the 2D probability density of a hydrogen atom orbital.\n\n#### Parameters\n- **n (int)**: Principal quantum number, defines the energy level.\n- **l (int)**: Azimuthal quantum number, defines the shape of the orbital.\n- **m (int)**: Magnetic quantum number, defines the orientation of the orbital.\n- **$a_0$ (float)**: Bohr radius, default is 1.0.\n- **grid_size (int)**: Resolution of the grid for calculations.\n\n#### Returns\n- **X, Y, density**: 2D arrays representing the X, Y coordinates and the corresponding probability density.\n\n#### Usage\n```python\nX, Y, density = calculate_hydrogen_density_2d(n, l, m, a0, grid_size)\n```\n\n### `calculate_hydrogen_density_3d`\n\nCalculates the 3D probability density of a hydrogen atom orbital.\n\n#### Parameters\n- **n (int)**: Principal quantum number, defines the energy level.\n- **l (int)**: Azimuthal quantum number, defines the shape of the orbital.\n- **m (int)**: Magnetic quantum number, defines the orientation of the orbital.\n- **$a_0$ (float)**: Bohr radius, default is 1.0.\n- **grid_size (int)**: Resolution of the grid for calculations.\n\n#### Returns\n- **X, Y, Z, density**: 3D arrays representing the X, Y, Z coordinates and the corresponding probability density.\n\n#### Usage\n```python\nX, Y, Z, density = calculate_hydrogen_density_3d(n, l, m, a0, grid_size)\n```\n\n## Dependencies\n- Numpy\n- Scipy (for special functions like `sph_harm`)\n\n\n## License\nThis project is open-source and available under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhitthecodelabs%2Fquantummechanicsvisualized","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhitthecodelabs%2Fquantummechanicsvisualized","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhitthecodelabs%2Fquantummechanicsvisualized/lists"}