Cython compilation error for time-dependent Hamiltonian

95 views
Skip to first unread message

vnegnev

unread,
Feb 28, 2015, 1:53:07 PM2/28/15
to qu...@googlegroups.com
Hello,

The following code causes a problem on my machine (Ubuntu 14.04 x64, Python 3.4.0, QuTiP 3.1.0, Cython 0.20.1, gcc 4.8.2):


import qutip as q
# H = [[q.sigmax(), '1j * ( asdf + 0.0 )']] # Always works
H = [[q.sigmax(), '1j * ( 0.0 + asdf )']] # Doesn't work
args = {'asdf':1.0}
q.mesolve(H, q.basis(2,0), [0,1], [], [], args=args)


I receive a gcc error within the autogenerated c file:

/home/vlad/.pyxbld/temp.linux-x86_64-3.4/pyrex/rhs74610.c:807:24: error: two or more data types in declaration specifiers
     typedef npy_double _Complex __pyx_t_npy_double_complex;

I have found the following discussion about a seemingly related issue:

http://comments.gmane.org/gmane.comp.python.cython.user/10659

which implies that the problem may lie in QuTiP, though I'm not brave enough to dig into the source myself.

Has anyone dealt with this issue before? I can work around it for the example above, but I'm working on code that auto-generates the time-dependence strings, in which I'd need to add special cases to manually avoid this error.

Thanks for making a wonderful package!

Vlad

Paul Nation

unread,
Mar 1, 2015, 6:54:16 PM3/1/15
to qu...@googlegroups.com
Thank you for reporting this.  This looks like a tricky little bug to figure out.  However, there may be a workaround.

Paul

--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul Nation

unread,
Mar 9, 2015, 12:04:02 AM3/9/15
to qu...@googlegroups.com
This seems to be fixed in Pull #322.


On Mar 1, 2015, at 12:13 AM, vnegnev <vne...@gmail.com> wrote:

Vlad Negnevitsky

unread,
Mar 9, 2015, 8:46:07 AM3/9/15
to qu...@googlegroups.com
Great, both my example above and my main code work fine now. Thank you very much for your time!

Vlad
Reply all
Reply to author
Forward
0 new messages