mathwolfram-mathematicaphysicsmathematica-8# Plotting Quantum Harmonic Oscillator in Mathematica

How can I make the plot for quantum harmonic oscillator using Mathematica? I would like to draw similar looking plot like the attached figure.

Solution

```
Energy[n_] := (2 n + 1) ℏ/2 ω;
ψ[z_, n_] :=
1/2 1/Sqrt[2^n n!] ((m ω)/(π ℏ))^(1/4)
Exp[-((m ω z^2)/(2 ℏ))] HermiteH[n, Sqrt[(m ω)/ℏ] z];
m = 1;
ω = 1;
ℏ = UnitConvert[Quantity[1, "PlanckConstant"], "SIBase"];
ℏ = QuantityMagnitude[ℏ];
ℏ = 1;
Plot[{Evaluate@Table[Energy[n] + ψ[z, n], {n, 0, 5}],
Evaluate@Table[Energy[n], {n, 0, 5}], z^2/2}, {z, -5, 5},
PlotRange -> {0, 7},
PlotStyle ->
Join[{Red, Yellow, Green, Blue, Purple, Cyan},
Table[{Gray, Opacity[0.3]}, {n, 0, 5}], {Black}],
Filling -> {1 -> Energy[0], 2 -> Energy[1]}]
```

- Translate integer to letters and vice versa (e.g. 0 = "A", 26 = "AA", 27 = "AB")
- Smoothing out lines on direction change , simulating user input from pattern with java Robot
- Calculate distance between two latitude-longitude points? (Haversine formula)
- How to calculate the midpoints of each triangle edges of an icosahedron
- How to get a 3D vector in the same direction as another vector limited by an angle?
- Sieve of Eratosthenes - Finding Primes Python
- How to find the interception coordinates of a moving target in 3D space?
- Decompose a vector in rotational components
- How is the starting point chosen in GNU Scientific Library multiroot finder?
- PYTORCH - TENSORS issue - Mat1 and mat2 shapes cannot be multiplied (8x10 and 8x8)
- Calculate lowest common indivisible number in JavaScript
- MATLAB: Using ODE solvers?
- Runge-Kutta (RK4) integration for game physics
- Fast algorithm for multiple line integrals over 2D discrete function
- how to display math equations (integration, algebraic, etc) in UILabel
- Integrating a Bayes probability distribution
- Evaluate limit of integral in Mathematica
- JavaScript % (modulo) gives a negative result for negative numbers
- Attempting to understand the difference in computed result for a Math.imul (javascript) recreation in Elixir
- Truncate a floating point number without rounding up
- Resize div with drag handle when rotated
- Calculation of intersections between line segments
- Identity in sympy
- solution for basic integration of mathematical functions
- Why does my Runge-Kutta implementation oscillate to 0?
- Integration via trapezoidal sums in MATLAB
- stieltjes integration in Python
- C++ nan keeps coming up with integration
- integration 3 dimensions by generalizing the method of rectangle
- How to solve integral in Matlab having an upper limit set as the sine function?