TypeError: object of type 'function' has no len()

443 views
Skip to first unread message

Omar Shehab

unread,
Apr 23, 2017, 10:39:52 AM4/23/17
to QuTiP: Quantum Toolbox in Python
Hi all,

Greetings from Maryland. I just came across this interesting quantum API QuTip and decided to give it a try. I started with the Lecture 8 - Adiabatic sweep example.

Unfortunately, at In [14], when I run mesolve(h_t, psi0, taulist, [], process_rho, args), I am getting the following error.

>>> mesolve(h_t, psi0, taulist, [], process_rho, args)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/anaconda/lib/python2.7/site-packages/qutip/mesolve.py", line 226, in mesolve
    _solver_safety_check(H, rho0, c_ops, e_ops, args)
  File "/opt/anaconda/lib/python2.7/site-packages/qutip/solver.py", line 836, in _solver_safety_check
    for ii in range(len(e_ops)):
TypeError: object of type 'function' has no len()

I am using Python 2.7 and QuTip 4.1.0.

Does any one have any idea what is going wrong? Thanks in advance for your reply and thank you very much for this API. 

-Shehab

Alex Pitchford

unread,
Apr 26, 2017, 12:57:49 PM4/26/17
to qu...@googlegroups.com
Hi Omar,
There was a fix applied to the development (Github) version a few days ago that I think will fix this problem. 
You would have to follow the install from source instructions (taking the source from Github)

We try and get this bug fix into a point release in the next few weeks if you would prefer to wait for that.

Alex

--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Omar Shehab

unread,
Apr 26, 2017, 1:04:34 PM4/26/17
to qu...@googlegroups.com
Hi Alex,

Thanks so much for getting back to me. I will try that.


Regards,

Shehab
Visiting Assistant Professor
Dept. of CSEE, UMBC
Member, The NSF Center for Hybrid Multicore Productivity Research

--
You received this message because you are subscribed to a topic in the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qutip/zTa4KetyqK8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qutip+unsubscribe@googlegroups.com.

Alex Pitchford

unread,
Apr 28, 2017, 6:22:52 AM4/28/17
to qu...@googlegroups.com
No problem. Please let me know if that fixes the issue.

Alex
Reply all
Reply to author
Forward
0 new messages