Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Python Calculator

1. Units, Constants and quick calculations

scipy.constants knows every physical constant (full list):

A scratchpad, seeded with a photon-energy calculation. Edit it and press play; the value of the last line is displayed:

2. Plotting panel

A ready-to-edit plotting template. Swap in any function of x; the slider is yours to repurpose:

3. Numerical integral

Define any function and limits in the pad; the plot shades area above the axis in green and below in red, and the value comes from np.trapezoid, the same tool your homework uses:

The green and red areas fight each other: an integral is a signed sum. For probability densities like ψ2|\psi|^2 the red never appears, which is exactly why they can be interpreted as probabilities.

4. Symbolic window

Derivatives, integrals, and equation solving with sympy; results render as typeset math. Each pad is editable:

5. Orbital visualizer

Pick quantum numbers (the menus only ever offer valid combinations). The first plot is a 2D cross-section of the orbital in the xz-plane, with blue and red marking the wavefunction’s positive and negative lobes. Below it, the radial view shows the radial function Rnl(r)R_{nl}(r) and the radial distribution P(r)=r2R2P(r) = r^2 R^2, and reports the most probable radius, the mean radius r\langle r\rangle, and the node count.

6. One-dimensional Schrödinger solver

Pick a potential and get its bound states instantly: energies as horizontal lines, wavefunctions drawn at their own energy (units: =m=1\hbar = m = 1, hard walls at x=±4x = \pm 4). To see how the solver works inside, open the numerical Schrödinger lab.

Try the classics: the box gives the n2n^2 ladder, the harmonic well gives perfectly even spacing (the fingerprint of vibrations), the linear well spaces levels like Airy zeros, and the double well pairs levels into tunneling doublets.

7. Quadratic equation solver

Every quadratic ax2+bx+c=0ax^2 + bx + c = 0 is solved by one formula:

x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

The sign of the discriminant Δ=b24ac\Delta = b^2 - 4ac decides what comes out: two real crossings for Δ>0\Delta > 0, one repeated root for Δ=0\Delta = 0, and for Δ<0\Delta < 0 a pair of complex conjugates that never touch the axis. Drag the coefficients and watch the roots leave the real line.

Start from the defaults and raise cc: the two crossings slide together, merge at Δ=0\Delta = 0, and then step off the real line as a mirror pair, real part shared and imaginary parts opposite. The curve stops touching the axis, but the number of roots never changes. That is the fundamental theorem of algebra in miniature: a degree nn polynomial has exactly nn complex roots. The background is in the complex numbers appendix.