xxz_corrlength.py example gives error 'out of the box'

How do I use this algorithm? What does that parameter do?
Post Reply
bart
Posts: 26
Joined: 23 Jan 2019, 09:35

xxz_corrlength.py example gives error 'out of the box'

Post by bart »

Hello,

I have recently followed the install instructions at this link: https://tenpy.github.io/INSTALL.html

Everything went fine, all of the nosetests were successful and most of the examples run without error, except xxz_corrlength.py, which gives me the following error:

Code: Select all

bart@bart:~/TeNPy/examples$ python3 xxz_corrlength.py
Traceback (most recent call last):
  File "xxz_corrlength.py", line 81, in <module>
    results = pickle.load(f)
TypeError: a bytes-like object is required, not 'str'
Did something go wrong during the installation?

Any help would be greatly appreciated - thank you!
User avatar
Johannes
Site Admin
Posts: 413
Joined: 21 Jul 2018, 12:52
Location: TU Munich

Re: xxz_corrlength.py example gives error 'out of the box'

Post by Johannes »

The problem was just that pickle needs the files to be opened in "binary" mode since Python 3, and the example stems from a time where TeNPy was still running with Python 2 :D
Anyways, I fixed it (and some other issue it had), it should now work again in the newest version.
bart
Posts: 26
Joined: 23 Jan 2019, 09:35

Re: xxz_corrlength.py example gives error 'out of the box'

Post by bart »

Oh great, I'm glad that it was something simple like that. Thank you for the clarification and fix! :-)
Post Reply