Relative Content

Tag Archive for sympyphysics

Validating SymPy mechanics

I am new to using SymPy mechanics and hope to use it extensively for my work. However, I am having trouble understanding some of the basics of the notation. Therefore, I have tried to create a simple example to validate if I implemented things correctly in the framework.

Quantum harmonic oscillator in sympy: Matrix elements of Hamiltonian not as expected

I’m trying to calculte matrix elements of teh Hamiltonian for teh harmonic oscillator. I use the solutions from sympy.physics.quatnum.qho_1d. My expectations would be that
<pis(i)|H|psi(j)>=0
if $i!=j$ where psi(i) is teh i’th solution of the harominc oscillator.
However, in my code, this is not the case if i+2=j. For all other combinations, it works.