在Mathematica中绘制量子谐振子

时间:2018-04-08 16:06:12

标签: math wolfram-mathematica physics mathematica-8

如何使用Mathematica绘制量子谐振子图? 我想绘制类似附图的类似情节。

Harmonic Oscillator

1 个答案:

答案 0 :(得分:2)

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]}]

quantum oscillator