This code defines a quantum mechanical system consisting of a particle moving in a harmonic oscillator potential. It then numerically solves the time-dependent Schrödinger equation for this system using the explicit matrix exponential method. The resulting wave function is then plotted as a 3D surface.

The system is defined by specifying the parameters of the harmonic oscillator potential, including the mass of the particle, the angular frequency of the oscillator, and the size of the system. The initial wave function is also specified, which is a Gaussian wave packet centered at the origin with a certain momentum.

The Hamiltonian operator is then constructed as a matrix, which includes the kinetic energy and potential energy terms. The time evolution of the wave function is then computed using the matrix exponential of the Hamiltonian multiplied by a time step.

The wave function is then plotted as a 3D surface using matplotlib. The x and y axes represent the position and time, respectively, while the z-axis represents the probability density of finding the particle at a particular position and time. The resulting plot shows the spreading out of the wave packet as it evolves in time, reflecting the uncertainty principle in quantum mechanics.

import numpy as np import matplotlibpyplot as plt from scipylinalg import expm from numpylinalg import norm from mpl_toolkitsmplot3d import Axes3D hbar = 10 m = 10 omega = 20 dt = 0005 dx = 003 L = 50

原文地址: https://www.cveoy.top/t/topic/bF3z 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录