Hacker News new | past | comments | ask | show | jobs | submit login
3D Electron Orbitals of Hydrogen (c0nrad.io)
112 points by c0nrad 14 days ago | hide | past | favorite | 50 comments

a bit of lay-hn-reader explanation from a chemistry/math major-now-dev (my physics might be a bit wrong, apologies in advance).

These diagrams show the probability density of the electrons around a hydrogen nucleus, which is the simplest (and a pretty good in general) model for how electrons live around atom nuclei. The more dots, the denser the probability, aka: how likely or not one might find an electron in this particular position.

In the upper right corner, there's the psi(n, l, m) selector which lets you pick the geometry.

n is the "principal quantum number" which corresponds to "the gross energy level/frequency" of electron. The way to think about this (I think) is this: If you are plucking a string on a guitar, or play a wind instrument, the more nodes that it has, the higher the energy of the vibration. Similarly for electrons around atoms. As you pick diagrams with a higher n, you'll see more nodes (internal regions with zero density) in the distribution. These are also higher energy states. Generally, if you look carefully you should be able to find (n - 1) surfaces, though for the (n, 0, 0) diagrams some of these node surfaces are tiny spheres close to the nucleus, so you might not see them.

l is the angular quantum number. This number determines how many of those nodal surfaces are "not spherical". So in a (n, 1, X) diagram, you should eventually see a plane cutting through if you play around with the orientation; In an (n, 2, x) you should see two intersecting planes cutting through, or in some cases a cone (more on that later).

m is the magnetic quantum number, and presumes that the atom is sitting in a nonzero magnetic field, and selects for different energies that relative orientations in that magnetic field have. This splits the different possibilities based on direction relative to magnetic field, and not curve qualities (number of nodes; shape of nodes).

There's another quantum number, which is the "spin quantum number" that has to do with the Pauli Exclusion principle, that two electrons can share an orbit simultaneously. This doesn't really change the shape of the orbital, so I presume that's why it's not there.

(1, 0, 0) is possible, but probably not shown because it's boring.

As for why you could have a "plane" or a "cone"; the display coordinate systems are somewhat arbitrary, and as with most quantum mechanics, "reality" is actually a weighted linear sum (superposition) of all of these possibilities; so a "plane" and a "cone" are roughly equivalently "surfaces", but the cone is a linear combination of a bunch of planes rotated around a line but is selected because it's a convenient and easy basis component with the other "planes" to generate coverage of the vector space of all possibilities. To really butcher the explanation: It turns out that you have to play that "rotate trick" because the space of "all possible probability distributions" has a fixed dimension, and you run out of ways to chop up three dimensional spaces with planes, so you have to mash them together to get correct coverage of the space of distributions.

How this corresponds to the periodic table. The S block (left side) elements are mostly filling their (row, 0, 0) orbitals, then P block (right side) elements are filling their (row - 1, 1, _) orbitals. The transition metals are filling their (row - 2, 2, _) orbitals, and the inner transition metals are filling their (row - 3, 3, _) orbitals . Although it seems elegant, reasoning for the "row - X" and not "row" is a bit complicated, empirical and not theoretical, and if you'd like to understand why, look up "aufbau principle".

I got lost here -> the more nodes that it has the higher the energy of the vibration. What is nodes?

Nodes - stationary nodes, think standing wave, points who remain at zero while the plucked string is vibrating.


ah thanks!

Apologies. Despite working with nodes that are nodes in a network literally every day in my work, while I was writing I was so entranced in the chemistry world that I forgot that there is another meaning to the word. Thank you for asking.

If this is supposed to be the probability density then it looks way off. I suspect that there is a mistake in calculating the absolute value of the wave function.

Edit: In this base the absolute value of the wave function is supposed to be rotational symmetric around the z axis.

Yes, judging from a quick look at the code (and not being familiar with the GiNaC library used) this seems to square the wave function instead of squaring the absolute value.

[1] https://github.com/c0nrad/hydrogen/blob/master/hydrogen.cpp#...

At a first glance, there seems to be something wonky with the quantum numbers: http://hyperphysics.phy-astr.gsu.edu/hbase/qunoh.html

Why? The PDE should be Psi^2 no? (which is what it's being plotted)

> In this base the absolute value of the wave function is supposed to be rotational symmetric around the z axis.

For the D orbital?

The phi-dependence of the wave-functions are exp(i m phi), it has magnitude 1. |Psi|^2 = conj(Psi)*Psi, the phi-dependency cancels out.

If the wavefunction is supposed to have n,l,m quantum numbers (as suggested by the interface) then yes, it should be rotationally symmetric around the z axis.

What assumptions does this visualization make? That it is a lone hydrogen atom suspended in a homogenous magnetic field?

Wouldn't the probability of finding an electron be spherically symmetric, regardless of the orbital number, if no external fields were present?

Very nice, but: what am I looking at? A probability density? And what do the control represent? Some sort of energy level? An isosurface of the modulus of the wave function? If so what does the number mean from an intuitive perspective?

Seems like the relevant blog entry is here: https://blog.c0nrad.io/posts/hydrogen-pt2/

Edit: the Reddit discussion has more info: https://www.reddit.com/r/Physics/comments/gt1set/interactive...

Is this really what hydrogen "looks" like in space, or is this just another impossible for the layperson to understand abstraction?

I never even know how to ask the question I want to ask, just like it's impossible to ask if the colors in the photograph of a planet are "real" or not. I've just given up and decided that all of space is in black and white except for Earth.

An excellent point (the first sentence I mean). I'd appreciate a physicist's opinion.

It's a data visualisation of a property of a model of hydrogen. The dots are denser where the absolute value of the 'wavefunction' (which is just a function that takes in space and time coordinates and returns a complex value) is higher.

It's not 'real' in the same way a simulation of a tennis ball flying through the air, rendered with dots isn't, but worse: that's a visualisation of a model, too, but if you imagine it being a simulation of possible sensory data it makes more sense- the world is set up so it's possible for a tennis ball to be seen by a conscious being, but that isn't true for a hydrogen atom.

In a model of a tennis ball, you might have a black screen, and then draw a dot where the tennis ball is, according to the model.

In this model of the hydrogen atom, you have a black screen, and then you draw a cloud with denser and less dense regions to represent where the electron 'is', according to the model. The problem is that electrons aren't point particles; in this model, an electron is a cloud- it's described not by some vector describing its position, but by the aforementioned wavefunction. It's a cloud in space, (except every point is complex-valued- they're taking the magnitude for this rendering) that changes (or doesn't) over time.

There's layers here. To what degree is a simplified model 'real'? To what degree is a visualisation of a model a picture of a 'real' thing, even if that model were true and complete?

I wasn't clear - sorry. It obviously can't be seen, and I (just about) get it's a probability cloud. My question is, is the underlying probability cloud real, in the sense that we can think of it existing and in it's actual peculiar shape, so if we could probe it we would indeed find something shaped like that, or is it just an abstraction/model 'that just works'?

It's not even an easy question to ask, come to think of it.

As commented elsewhere, the OP renders look perhaps not quite right. But in general...

Atoms are little balls. With electron density that's mostly spherically symmetric. It's very high at the nucleus, and falls off exponentially outward. Down by several orders of magnitude by the time you reach distances at which atoms hang out together.

A 2D analogue might be a stereotypic volcano, if height were density. I wish I knew of a better one. Few familiar objects have this degree of fuzzy. Diffusing smells, but you can't see those.

The common representations with a solidish surface at some large distance from the nucleus is... useful when doing chemistry, but badly misrepresents the physical object.

Electron density manifests clearly and concretely. For example, you can poke at it with the vibrating tip of an Atomic Force Microscope.

Electron states, orbitals, seem less often encountered that directly. Rather than at one step remove - seeing density, or some other phenomena, and explaining it with states.

Though there's a fun STM image I'm just now failing to quickly find. An STM scans a tip across a sample, measuring and mapping the tunneling current between them. Usually with a boringly symmetric ball of a tip, so the interestingness is all sample. In this case however, the sample had a grid of boring s states, and tip conduction was through a tilted f state. So the sample repeatedly mapped the tip. The image is thus a grid of little images of the tip's f state, laid out like rows of little buoys. EDIT: Maybe this is it: https://arxiv.org/pdf/cond-mat/0305103.pdf fig 6 page 12 (though it doesn't entirely match what I'm remembering).

Just to be clear, representing density by dots, rather than say by a color gradient on voxels, is purely a data-visualization rendering choice. Like old newspapers using halftone images. Which I mention only because there are misconceptions around the individual dots themselves representing something about the electron.

Yes, the probability cloud tells you how the hydrogen atom (H-O-H) will be shaped. The atoms will be repelled by the electrons that create this probability cloud and this will force the atoms into a geometry with minimal energy (which is the shape you are probably familiar with). Just remember that it's a probability so the shape isn't set in stone, it's more like the most common shape. A common way to learn this is by implementing the Hartree-Fock algorithm. https://en.wikipedia.org/wiki/Hartree%E2%80%93Fock_method

Well how about that, ask a difficult question of an abstract domain, and get two clear yesses. Does not happen often. Thanks @mncharity and @cinntaile.

The concept of "look" doesn't apply to hydrogen. It doesn't have a fixed, defined, shape.

To define "look" you must say "look how", i.e. with what sense are you looking.

For atoms you can use gravity to look at them, or the electromagnetic force, or the strong force. And the atoms will look different each way.

I suppose you could define look as "how strongly will this test particle interact with the atom at this distance, using this force". But notice "how strongly" - there is no fixed boundary, the interaction just gets weaker (or less likely) as things get farther.

Heisenberg (1958): "What we observe is not nature itself, but nature exposed to our method of questioning."

What's being plotted is the amplitude of a "hydrogenic" orbitals Ψ_{n,l,m}(x, y, z)^2. Hydrogenic orbitals are the eigenfunctions (wavefunctions) of the 1-electron 1-nucleus Hamiltonian (many-electron wavefunctions are visually similar to this but due to electron-electron correlation become waaaaay more mathematically complex).

This is a nice system because the result is analytic (ignoring relativistic effects and assuming a point-like nucleus). Specifically, Ψ_{n,l,m}(r, θ, φ) = L_n(r) * Y_l^m(θ, φ), where L_n(r) is the n-th order Laguerre polynomial and Y_l^m(θ, φ) is the m-th spherical harmonic with angular momentum l.

From a chemical perspective, n indicates which electron "shell" you are in, l indicates which type of orbital (l=0 is an s-orbital, l=1 is a p-orbital, l=2 is a d-orbital, etc.), and m indicates which of the different orbitals within that shell having that angular momentum (e.g. p_x vs p_y vs p_z).

I think you misunderstood my question:

1. The fact that the function is easy to compute because there is an analytical solution to the ODE when the atom is simple enough tells precious little about what the picture actually represents.

2. The fact that the function you talk about has 6 parameters and this is a 3D visualization (3 degrees of freedom) is confusing.

3. The chemistry lesson about orbitals is also an interesting fact but still not properly correlated to the interactive depiction. Notoriously missing: where are m,n,l actually depicted in the story? Am I looking at one specific choice for those? What are the menu entries?

I think there is something that would truly help: if one would take a volume integral over a infinitesimal cube of the 3D interactive representation, what physical units would the result be in?

The 3-d space shown is just physical space.

n,l,m are the triplet of numbers you can select in the top right. They're called quantum numbers, and they describe the state of this particular system, in particular the state of the electron.

Basically: n is how much energy the electron has (the higher, the further from the nucleus). l and m further describe which orbital the electron is in; l is related to the electron's angular momentum, m is related to its angle to the x-y plane in this visualisation. Only certain combinations of these numbers are allowed by physics (angular momentum, l, has to be smaller than energy, n, for example). n,l,m together describe the state of the electron inside the hydrogen atom.

So what are the dots? Basically, they're meant to represent a cloud. Where the cloud is denser, the electron has more measure; the electron is more there than in other places. Practically speaking, if you made a measurement to see where the electron was, your results would probabilistically correlate with the density of the cloud. The process whereby the electron goes from being a probabilistic cloud to a point particle interacting with your test particle back to a probabilistic cloud is called 'wave function collapse' in the Copenhagen interpretation, or, more generally, 'magic'.

(Or it's just how the universal wavefunction's branches look from the inside.)

A volume integral would be unitless, by definition: the value of the square-absolute-value of the wavefunction at any point (what's represented by this graph) is the probability of finding the electron at that point per cubic metre. A volume integral from negative to positive infinity in x, y, and z gives 1 (no units).

> n is how much energy the electron has (the higher, the further from the nucleus)

I disagree with this description. It is true that higher values of n correspond to wave functions with higher energy, but higher values of l also correspond to wave functions with higher energy. n indicates the number of radial nodes.

> A volume integral would be unitless

The volume integral has units of "number of electrons". Calling this unitless is unnecessarily misleading I feel, even if it is technically correct, since in physics we tend not to give units to quantities like this.

You're right.

It is not a 6-parameter function, it is a family of 3d-functions each characterized by 3 parameters. Those parameters can be modified using the dropdown in the top-right corner of the page.

The Hamiltonian is an operator that describes the energy of a system. Eigenfunctions of the Hamiltonian are quantum states, referred to as wave functions. The squared amplitude of a wave function is a probability distribution function. When discussing the wave functions of electrons, the probability amplitude is sometimes referred to as the electron density. You are looking at a sampling from the electron density of the wave functions of the 1-electron 1-nucleus Hamiltonian operator. There are different wave functions (different entries in the dropdown box at the top-right corner of the screen) because the Hamiltonian operator has more than one eigenfunction. Each eigenfunction is characterized by the 3 "quantum numbers": n, l, and m. "n" indicates the number of radial nodes -- areas of a given distance from the nucleus where the electron density is 0. "l" indicates the number of angular nodes -- areas arranged in a certain angular pattern around the nucleus where the electron density is 0.

> I think there is something that would truly help: if one would take a volume integral over a infinitesimal cube of the 3D interactive representation, what physical units would the result be in?

Number of electrons (possibly fractional, if you aren't sampling the whole space). For this particular Hamiltonian, the integral over all space should be numerically 1 for any given eigenfunction, since we are looking at the 1-electron Hamiltonian.

> It is not a 6-parameter function, it is a family of 3d-functions each characterized by 3 parameters. Those parameters can be modified using the dropdown in the top-right corner of the page.

Sorry to be pedantic, but these two things are the exact same thing.

You were asking how it is to be interpreted, and it is as I said: a family of 3D functions each characterized by 3 parameters. What you are saying is technically correct, but misses the point of what I was trying to convey.

Edit: also, three of the parameter (x, y, z or r, θ, φ depending on whether you are using a Cartesian or spherical coordinate system) are continuous, real, and unbounded (well, unbounded in a Cartesian sense anyway). In contrast, n, l, and m are discrete integer-valued quantum coefficients that obey the relations n > 0, 0 <= l < n, -l <= m <= l.

2. Basically it has six parameters because the wave function changes based on the first three parameters (n,l,m) and can then be solved w.r.t. x, y, and z, though it'll be easier to do in spherical coordinates.

3. This hydrogen atom has a nucleus and one electron. Think of n as the energy level of that electron - electrons have discrete energy levels, so as n increases the electron occupies the next discrete energy available to it.

l is another quantized value which corresponds to what we call the orbital angular momentum of the electron, which partially determines the shape of the orbital. This is a big part of the visualization you see - as you change the value of l, we see different shapes, and if you increase the number of particles in the visualization, you get changes in those shapes. These different shells have names - s, p, d, etc - that correspond to the integer value of l - 0, 1, 2, etc.

Importantly, what's being graphed in the visualization is a solution to the specified wave function. It's a 3D probability map, effectively. Where there is a higher chance of the electron being located, the particles are more concentrated, whereas lower chance regions have lower populations of particles.

m is called the magnetic quantum number and can have integer values from -l to +l, and further specifies the particular state of the electron in its "shell" - s, p, d, etc again. If the wave function has n=2 and l=2, then it's in the d shell, and can have values of m from -2 to +2. The actual value of m determines the final "shape" of the orbital, again depicted as a probability map - every dot you see plotted can be a location of the electron, so plotting a lot of them based on the probability distribution gives you a visualization of the regions available to that electron.

So the menu entries are just values of n,l,m that aren't separated by commas.

I hope that clarifies some things!

> 2. The fact that the function you talk about has 6 parameters and this is a 3D visualization (3 degrees of freedom) is confusing.

Why is that a problem?

It's no different than defining a family of linear functions f_a,b(x) = a x + b and then letting the user pick values for the parameters a and b before plotting it onto the xy - plane.

https://daugerresearch.com/orbitals/index.shtml is a much nicer (and I believe more accurate) visualization.

Some similar work: https://www.willusher.io/webgl-volume-raycaster/#Hydrogen%20... , though caveat, that while labeled "Hydrogen Atom", the density shown is of just one state of the electron; http://phelafel.technion.ac.il/~orcohen/DFTVisualize.html .

There are many more visualizations that show total electron density rather than individual states. Though arguably far far too few, given how pervasively unsuccessfully these topics are taught.

If you'd like to explore, GPAW https://wiki.fysik.dtu.dk/gpaw/ can be useful. Here's a random example of use: https://www.brown.edu/Departments/Engineering/Labs/Peterson/...

A while ago I made an interactive rendering of hydrogen orbitals that is fully volumetric. Fun feature, the electron pdf is calculated without using any look-up tables so the algorithm can theoretically be scaled to any energy level you like.


It's a great visualization --

I would suggest, though, that some contour lines (or translucent shells?) might help make the point more apparent to someone trying to learn about the shapes (which I suppose is the point).

After all, the point is to grasp something visual about it, and just vaguely discernible clouds of points don't probably convey that sufficiently, although they are accurate of course.

Why the options don't include also the "100" function (aka 1s orbital)? I guess the error is in https://github.com/c0nrad/hydrogen/blob/209ffe5cf14879a4679b...

Is there a way to make these shapes evolve with time?

there’s lots of visualizations for spherical harmonics; those are what you’d want to look for. eg https://m.youtube.com/watch?v=Ziz7t1HHwBw

They don't. They exist in all the shapes at the same time, which is what the plot is showing, a sort of combination of all the shapes, with more dots where the electron "exists" more often.

It's possible to simulate the time-evolution of the electron density using the time-dependent Schrodinger equation. That said, if the initial state is chosen to be an eigenfunction of the Hamiltonian (read: any of the things being plotted on this page), there will be no time dependence -- the electron density will remain static. However, if the initial state is chosen as a superposition of states (read: any configuration that is not given by the square amplitude of an eigenfunction of the Hamiltonian), you can simulate the time evolution.

that's not entirely true though. you're right about the superposition of energy eigenstates, and what i'm about to say is uninteresting from the perspective of the posted simulation, although it is interesting "in the real world"

in time dependent perturbation theory you can show that electrons can transition to different energy states through spontaneous emission. for example, psi(n=4,l=0)-->psi(n=3, l=1) by emitting a photon.

thus, the "change" in the simulation posted here would be uninteresting since it would just correspond to clicking a different eigenstate in the top right!

What I'm saying is true -- if the initial state is chosen to be a superposition of states, then the time-dependent Schrodinger equation enables one to simulate the time evolution of the electron density.

> thus, the "change" in the simulation posted here would be uninteresting since it would just correspond to clicking a different eigenstate in the top right!

That is a drastic oversimplification of reality. Spontaneous emission of a photon is not instantaneous. It is still possible to simulate the time-evolution of this process.

everything is a simplification. of course it's not spontaneous, but that is literally the word used by physicists to describe the phenomenon.

what does the wave equation of the electron in a hydrogen atom look like during "spontaneous" emission of a photon? i don't think anyone has any idea.

i'm talking about something entirely separate from a linear combination of two energy eigenstates. i'm not saying take

\psi = \sin{\theta} \psi_1 + \cos{\theta} \psi_2

where \psi_1 and \psi_2 are eigenstates of the hydrogen atom hamiltonian and simulate it. i'm saying there is a phenomenon that i'm pretty sure wouldn't be adequately modelled by a smooth function.

edit: add explanation of \psi_1 and \psi_2

The hydrogenic orbitals form a complete and orthonormal basis in which you can expand any arbitrarily-chosen one-electron wavefunction. That is to say that any arbitrarily chosen initial state for the one-electron wavefunction (and thus any arbitrarily chosen electron density) can be expressed as a linear combination of the hydrogenic orbitals. This, in combination with the time-dependent Schrodinger equation, enables us to simulate the time evolution of the hydrogenic system starting from any arbitrarily chosen initial state.

> what does the wave equation of the electron in a hydrogen atom look like during "spontaneous" emission of a photon? i don't think anyone has any idea.

It sounds like you are not aware that this is an entire field of research within the theoretical chemistry community. Theoreticians have been studying spectroscopy for a century.

Would it really just jump into another shape? I don't understand QM much, but the Schrodinger equation looks like a typical heat equation (with some complex-number trickery) and thus in general should evolve smoothly. There should be a transition period between two shapes.

You are spot on here: the heat equation and the Schrodinger equation are both special cases of the wave equation. A major difference between the two is that the Schrodinger equation deals with complex numbers, as you state. Transition between states is not instantaneous, though it is very fast, on the scale of attoseconds (10^-18 seconds).

What if something else chosen as an initial condition, like a sphere or some random shape? Would it converge to something meaningful if we apply the time-dependent SE with a meaningful field potential?

Without some way of releasing or absorbing energy, the system would oscillate forever.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact