load and saving .qu file between Mac and Windows

36 views
Skip to first unread message

Mikkel Heuck

unread,
Mar 6, 2015, 1:29:55 PM3/6/15
to qu...@googlegroups.com
Hi

I am running a simulation on a Mac: 

QuTiP Version:      3.1.0
Numpy Version:      1.6.2
Scipy Version:      0.11.0
Cython Version:     0.22
Matplotlib Version: 1.1.1
Fortran mcsolver:   True
scikits.umfpack:    False
Python Version:     2.7.5
Platform Info:      Darwin (x86_64)
Installation path:  /Library/Python/2.7/site-packages/qutip


and generating a .qu file with qutip.qsave("filename"). When I try to open the file on my windows machine: 

QuTiP Version:      3.1.0
Numpy Version:      1.9.1
Scipy Version:      0.15.1
Cython Version:     0.21.2
Matplotlib Version: 1.4.2
Fortran mcsolver:   False
scikits.umfpack:    False
Python Version:     3.4.2
Platform Info:      Windows (AMD64)
Installation path:  C:\Python34\lib\site-packages\qutip

I get the following error: 

  File "<ipython-input-11-f9d390548180>", line 1, in <module>
    qload("runNo0_0_states")

  File "C:\Python34\lib\site-packages\qutip\fileio.py", line 280, in qload
    out = pickle.load(fileObject)  # return the object from the file

UnicodeDecodeError: 'ascii' codec can't decode byte 0xbe in position 0: ordinal not in range(128)

I am able to open it on the Mac machine. I attach the file here. I thought it was a version mismatch issue, so I updated my windows machine to qutip 3.1.0. Can it be related to python version mismatch? I can open normal pickle generated files across the two machines...

Thanks,
mikkel
runNo0_0_states.qu

Paul Nation

unread,
Mar 7, 2015, 11:47:45 PM3/7/15
to qu...@googlegroups.com
This looks to be an issue with how the strings for the name of the .qu file are handled.  They should always be unicode (utf-8).  I will add a fix for this.

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:33:59 AM3/9/15
to qu...@googlegroups.com
This is fixed in Pull #323.

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.
<runNo0_0_states.qu>

Mikkel Heuck

unread,
Mar 9, 2015, 9:52:58 AM3/9/15
to qu...@googlegroups.com
hey Paul

Thank you very much!

--
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/5w8t4Am-Jpg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qutip+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages