1
$\begingroup$

I am trying to code a 3D representation of the position wavefunction probability of the Hydrogen atom.

I am having issues with the angular terms of the equation, which is represented as the real part of a spherical harmonic function.

The equation is: Hydrogen Atom Spherical Harmonic Equation

And the Associated Legendre function is: Associated Legendre Function

I do the corresponding derivative (d/d_theta of cos(theta) of the function) for modes l=0 to l=3 through these tabulated equations: l=0 to l=3 Legendre Modes

The final term: e^(i * m * phi) I represent with: sin(|m| * phi) if m < 0 and cos(m * phi) if m > 0.

After converting to cartesian coordinates, I end up with a 3D visual that looks like this: Visual of 3D Model

The x-z axis is actually quite good, as it matches what is expected from 2D cross-sections I found online: Visual of x-y cross-section

However, there is a discontinuity in the y-axis which should not be there.

By the way, theta ranges from 0-2pi and phi ranges from 0-pi. r is a constant in this case.

Is there anywhere in the math which I did incorrectly?

$\endgroup$
4
  • 2
    $\begingroup$ Please proofread and edit. $\endgroup$ Commented Sep 3 at 2:06
  • $\begingroup$ @Aruralreader What do you mean by this? $\endgroup$
    – TCoff
    Commented Sep 3 at 2:32
  • 1
    $\begingroup$ The representation of $e^{im\varphi}$ looks not very natural, because $e^{im\varphi}=\cos (m\varphi)+i\sin (m\varphi)$. $\endgroup$ Commented Sep 5 at 6:15
  • $\begingroup$ @AlexRavsky so you're saying the price wise I've been using is possibly incorrect and instead I should do Re(cos(m*phi) + i * sin(m * phi))? $\endgroup$
    – TCoff
    Commented Sep 5 at 7:01

1 Answer 1

1
+50
$\begingroup$

Representation of the real part of spherical harmonics seems strange only for $m<0$. Both $m$ and $\phi$ are real, so $\mathrm{Re}(e^{im\phi}) = \cos(m\phi)$. Though, you used $m=1$ in your visual, so this couldn't have caused the problem.

The problem arises from your conventions for $\theta$ and $\phi$. As stated in the question, you took $\theta$ as polar angle (ranging from 0 to $2\pi$) and $\phi$ as azimuthal angle (ranging from 0 to $\pi$). In physics, the convention is: $\phi$ for polar angle and $\theta$ for azimuthal angle. This convention is also used in the equations (see Griffiths "Introduction to Quantum Mechanics" for comparison). Changing to the correct variables should eliminate the discontinuity.

$\endgroup$
1
  • $\begingroup$ This is the most helpful answer given so I awarded this the bounty. To help others in the future: the theta and phi variables are not switched up. I needed to change the range for the phi (azimuthal angle) to be 0 to 2pi just as theta (polar angle) is. This answer was the most helpful because indeed Re(imphi) is cos(|m| * phi) no matter the sign assuming the variables are real. The discontinuity is gone and simulates all states for the hydrogen atom. Thank you. $\endgroup$
    – TCoff
    Commented 2 days ago

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .