jcmgray / quimb

A python library for quantum information and many-body calculations including tensor networks.
http://quimb.readthedocs.io
Other
467 stars 107 forks source link

AttributeError: 'MERA' object has no attribute 'draw' #72

Closed JustinS6626 closed 3 years ago

JustinS6626 commented 3 years ago

I am doing an experiment using a MERA object, and I am getting the exception

AttributeError: 'MERA' object has no attribute 'draw'

It is not clear how this is possible, since the MERA class should inherit the draw method. Please advise on how to fix this.

jcmgray commented 3 years ago

The following works for me on the most recent commit:

import quimb.tensor as qtn
mera = qtn.MERA.rand(16)
mera.draw()

could it be that you are loading a pickled MERA from an older version of quimb (in which case the class will itself be older too, maybe caling mera.copy() would fix that - not sure).

JustinS6626 commented 3 years ago

That's possible, but I don't think that's the case. The version that I have installed currently is from the github repository, so it should be the most recent commit. I will try the snippet you have posted and see if that works.

JustinS6626 commented 3 years ago

After an uninstall and reinstall with the github repository version, I got it to work. Thank you very much for your help!