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, 2017 at 3:40:20 PM UTC-5, Julian L wrote:
>
> Hi, 
> I am using sympy.physics.qho_1d to get the eigenfunctions and evaluate 
> them numerically with numpy and lambdify, and I want to use units where 
> hbar = 1. 
> I've tried things like:
>
> (qho.psi_n(0, 0, 1, 1)).subs(hbar, 1.0)
> (expr.subs(hbar, 1.0)).evalf()
> lambdify(hbar, expr, "numpy")
>
> but it doesn't work and always returns  1/(hbar**(1/4)*pi**(1/4)) or an 
> error. 
> How can I do it well?
>
> Julian
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/2e5adedc-dbeb-4ecc-925c-77ec960dee61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to