[sympy] Re: Planck units in symbolics expressions

2017-12-27 Thread Leonid Kovalev
Actually, hbar also works if you import it (and this makes more sense than importing the class): from sympy.physics.quantum.constants import hbar and then ...subs(hbar, 1). HBar is a class name, but the module also creates an instance of that class, called hbar. On Tuesday, December 26,

[sympy] Re: Planck units in symbolics expressions

2017-12-27 Thread Leonid Kovalev
hbar is a special constant; you refer to it as HBar(), not as hbar, and it needs to be imported first. This is how you can replace it in an expression: from sympy import * from sympy.physics.qho_1d import psi_n from sympy.physics.quantum.constants import HBar n, x, m, omega = symbols("n x m