Expectation Value Calculator

Find exact ⟨x⟩, ⟨p⟩, Δx, and Δp for an infinite square well or quantum harmonic oscillator stationary state.

📏 Expectation Value Calculator
nm
Hz
kg
Δx·Δp
⟨x⟩
Δx
Δp
Step-by-step working

📏 What is the Expectation Value Calculator?

This expectation value calculator finds exact position and momentum expectation values, ⟨x⟩, Δx, and Δp, for a stationary state of two textbook quantum systems: the infinite square well and the quantum harmonic oscillator. Choose a system, enter its parameters and a quantum number, and it returns the exact expectation values along with the Heisenberg uncertainty product ΔxΔp.

An expectation value is the probability-weighted average result of measuring an observable across many identically-prepared copies of a quantum state, computed as ⟨ψ|A|ψ⟩. Because both systems here are exactly solvable, every result this calculator shows is an exact closed-form value, not a numerical approximation.

The calculator also verifies, for whichever state you enter, that ΔxΔp never falls below ħ/2, the Heisenberg uncertainty principle's absolute floor, and shows by how much. The harmonic oscillator's ground state is the one special case that hits this floor exactly.

This calculator is useful for physics students learning to compute expectation values by hand and wanting to check their work, and anyone curious how the uncertainty principle plays out numerically in real quantum systems.

📐 Formula

⟨x²⟩box = L²(1/3 − 1/(2n²π²)),   ⟨x²⟩qho = (ħ/mω)(n+½)
Box: ⟨x⟩=L/2, ⟨p²⟩=(nπħ/L)²
QHO: ⟨x⟩=0, ⟨p²⟩=mħω(n+½), ω=2πf
Uncertainty: ΔxΔp ≥ ħ/2 (Heisenberg bound)
Example: QHO n=0, f=10¹⁴ Hz, electron: ΔxΔp = ħ/2 exactly.

📖 How to Use This Calculator

Steps

1
Choose a system, infinite square well or harmonic oscillator.
2
Enter the system parameters and quantum number n.
3
Choose the particle, electron, proton, neutron, or a custom mass.
4
Read the expectation values and the uncertainty product.

💡 Example Calculations

Example 1 - Electron in a 1 nm box, ground state

1
Infinite square well, L=1 nm, n=1, electron
2
Δx = 1.8076 × 10-10 m, Δp = 3.3130 × 10-25 kg·m/s
3
ΔxΔp = 5.9885 × 10-35 J·s, about 1.136 × (ħ/2)
ΔxΔp = 5.9885 × 10-35 J·s
Try this example →

Example 2 - Electron in a 1 nm box, second excited state

1
Infinite square well, L=1 nm, n=2, electron
2
ΔxΔp = 1.7614 × 10-34 J·s, about 3.341 × (ħ/2)
3
Uncertainty product grows with n, further from the minimum-uncertainty bound
ΔxΔp = 1.7614 × 10-34 J·s
Try this example →

Example 3 - Quantum harmonic oscillator, ground state (minimum uncertainty)

1
Harmonic oscillator, f=1014 Hz, n=0, electron
2
Δx = 3.0352 × 10-10 m, Δp = 1.7372 × 10-25 kg·m/s
3
ΔxΔp = 5.2729 × 10-35 J·s, exactly ħ/2, the minimum-uncertainty state
ΔxΔp = 5.2729 × 10-35 J·s
Try this example →

❓ Frequently Asked Questions

What is an expectation value in quantum mechanics?+
An expectation value ⟨A⟩ is the probability-weighted average of the possible outcomes of measuring an observable A, computed as ⟨ψ|A|ψ⟩ for a normalized state ψ. It is not the result of any single measurement (which always yields one specific eigenvalue), but the average you would obtain repeating the same measurement on many identically-prepared systems.
Why are ⟨x⟩ and ⟨p⟩ both zero in these examples?+
For the infinite square well centered symmetrically, the probability density is symmetric about the well's midpoint, so ⟨x⟩ = L/2 (the midpoint, not zero, since the well spans 0 to L) and ⟨p⟩ = 0 by symmetry of the momentum-space wavefunction. For the quantum harmonic oscillator, the potential is symmetric about x=0, so both ⟨x⟩ = 0 and ⟨p⟩ = 0 for every stationary state.
What do Δx and Δp represent?+
Δx and Δp are the standard deviations (uncertainties) of position and momentum in a given quantum state, computed as Δx = √(⟨x²⟩ − ⟨x⟩²) and Δp = √(⟨p²⟩ − ⟨p⟩²). They quantify how spread out a repeated measurement of position or momentum would be, not any single measurement's precision.
Why is the quantum harmonic oscillator ground state special?+
The n=0 quantum harmonic oscillator state is the unique 'minimum uncertainty' state for this system: its ΔxΔp product equals exactly ħ/2, the smallest value the Heisenberg uncertainty principle allows. Every other state, in either the oscillator or the box, has a strictly larger ΔxΔp.
Does the infinite square well ever reach the minimum uncertainty bound?+
No. Even its ground state (n=1) gives ΔxΔp ≈ 1.14 × (ħ/2), noticeably above the absolute minimum, because the box's hard walls force a wavefunction shape different from the perfect Gaussian that uniquely minimizes the uncertainty product. Higher box states push the product up further, roughly proportional to n for large n.
How does ΔxΔp change with the quantum number n?+
For the harmonic oscillator, ΔxΔp = (n + 1/2)ħ exactly, growing linearly with n. For the infinite square well, ΔxΔp also grows with n (though not by quite as simple a formula), since higher-energy states have more oscillations packed into the same box, spreading out the momentum distribution.
Why are these two systems chosen for this calculator?+
The infinite square well and quantum harmonic oscillator are the two textbook systems with fully exact, closed-form energy eigenstates and expectation values, no numerical approximation is needed for either. This makes them the standard first examples for learning to compute expectation values and verify the uncertainty principle explicitly.
What is the formula for ⟨x²⟩ in the infinite square well?+
For a well of width L with the stationary state ψ_n(x) = √(2/L) sin(nπx/L) on [0,L], ⟨x²⟩ = L²(1/3 − 1/(2n²π²)). Combined with ⟨x⟩ = L/2, this gives the exact position uncertainty Δx for any quantum number n.
What is the formula for ⟨x²⟩ in the quantum harmonic oscillator?+
For a stationary state n with angular frequency ω = 2πf, ⟨x²⟩ = (ħ/mω)(n + 1/2), and correspondingly ⟨p²⟩ = mħω(n + 1/2). These come directly from the ladder-operator algebra of the harmonic oscillator and are exact at every n.
Does this calculator work for other quantum systems, like the hydrogen atom?+
No, it is deliberately scoped to the two exactly-solvable systems with the simplest, cleanest closed-form expectation values. Hydrogen atom expectation values (like ⟨r⟩ or ⟨r²⟩ for a given n, l) follow similar exact formulas but involve more complex expressions specific to the Coulomb potential, outside this calculator's scope.

What is an expectation value in quantum mechanics?

An expectation value ⟨A⟩ is the probability-weighted average of the possible outcomes of measuring an observable A, computed as ⟨ψ|A|ψ⟩ for a normalized state ψ. It is not the result of any single measurement (which always yields one specific eigenvalue), but the average you would obtain repeating the same measurement on many identically-prepared systems.

Why are ⟨x⟩ and ⟨p⟩ both zero in these examples?

For the infinite square well centered symmetrically, the probability density is symmetric about the well's midpoint, so ⟨x⟩ = L/2 (the midpoint, not zero, since the well spans 0 to L) and ⟨p⟩ = 0 by symmetry of the momentum-space wavefunction. For the quantum harmonic oscillator, the potential is symmetric about x=0, so both ⟨x⟩ = 0 and ⟨p⟩ = 0 for every stationary state.

What do Δx and Δp represent?

Δx and Δp are the standard deviations (uncertainties) of position and momentum in a given quantum state, computed as Δx = √(⟨x²⟩ − ⟨x⟩²) and Δp = √(⟨p²⟩ − ⟨p⟩²). They quantify how spread out a repeated measurement of position or momentum would be, not any single measurement's precision.

Why is the quantum harmonic oscillator ground state special?

The n=0 quantum harmonic oscillator state is the unique 'minimum uncertainty' state for this system: its ΔxΔp product equals exactly ħ/2, the smallest value the Heisenberg uncertainty principle allows. Every other state, in either the oscillator or the box, has a strictly larger ΔxΔp.

Does the infinite square well ever reach the minimum uncertainty bound?

No. Even its ground state (n=1) gives ΔxΔp ≈ 1.14 × (ħ/2), noticeably above the absolute minimum, because the box's hard walls force a wavefunction shape different from the perfect Gaussian that uniquely minimizes the uncertainty product. Higher box states push the product up further, roughly proportional to n for large n.

How does ΔxΔp change with the quantum number n?

For the harmonic oscillator, ΔxΔp = (n + 1/2)ħ exactly, growing linearly with n. For the infinite square well, ΔxΔp also grows with n (though not by quite as simple a formula), since higher-energy states have more oscillations packed into the same box, spreading out the momentum distribution.

Why are these two systems chosen for this calculator?

The infinite square well and quantum harmonic oscillator are the two textbook systems with fully exact, closed-form energy eigenstates and expectation values, no numerical approximation is needed for either. This makes them the standard first examples for learning to compute expectation values and verify the uncertainty principle explicitly.

What is the formula for ⟨x²⟩ in the infinite square well?

For a well of width L with the stationary state ψ_n(x) = √(2/L) sin(nπx/L) on [0,L], ⟨x²⟩ = L²(1/3 − 1/(2n²π²)). Combined with ⟨x⟩ = L/2, this gives the exact position uncertainty Δx for any quantum number n.

What is the formula for ⟨x²⟩ in the quantum harmonic oscillator?

For a stationary state n with angular frequency ω = 2πf, ⟨x²⟩ = (ħ/mω)(n + 1/2), and correspondingly ⟨p²⟩ = mħω(n + 1/2). These come directly from the ladder-operator algebra of the harmonic oscillator and are exact at every n.

Does this calculator work for other quantum systems, like the hydrogen atom?

No, it is deliberately scoped to the two exactly-solvable systems with the simplest, cleanest closed-form expectation values. Hydrogen atom expectation values (like ⟨r⟩ or ⟨r²⟩ for a given n, l) follow similar exact formulas but involve more complex expressions specific to the Coulomb potential, outside this calculator's scope.