jcmgray / quimb

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

AttributeError: module 'quimb' has no attribute 'NEUTRAL_STYLE' #171

Closed ikhompyutha closed 1 year ago

ikhompyutha commented 1 year ago

What is your issue?

Hello,

For background, I'm trying to help a friend of mine spin up a ubuntu virtual machine to assist his quantum computing research. I'm running through the example here, and when running through step 2 of "11.2 Rehearsing the computation", jupyter lab throws the following error with the ipykernel:

image

I tried googling this issue, and I have not seen it mentioned anywhere. If the example python code is referencing an attribute that "no longer exists," what is the fix for this?

Thanks everyone!

jcmgray commented 1 year ago

Probably NEUTRAL_STYLE had not made it into a released version of quimb yet, apologies, you could try with a development version from GitHub in the meantime.

ikhompyutha commented 1 year ago

Probably NEUTRAL_STYLE had not made it into a released version of quimb yet, apologies, you could try with a development version from GitHub in the meantime.

Let me try that then, and I will get back to you. How would one get the development version if they installed quimb from conda?

ikhompyutha commented 1 year ago

Something else I want to mention.

While I was running through some of the codes in the examples doc, I noticed there were several dependencies that were lacking from the main installation page:

image

I was unable to install "kahypar" successfully, but it seems like this might be optional given the output of some of the examples in jupyter lab.

jcmgray commented 1 year ago

Let me try that then, and I will get back to you. How would one get the development version if they installed quimb from conda?

quimb is not actually available on conda, but assuming you installed it with pip within in conda environment, you can just upgrade the installation. The following command can be used to do so directly from github:

pip install --no-deps -U git+https://github.com/jcmgray/quimb.git@develop

While I was running through some of the codes in the examples doc, I noticed there were several dependencies that were lacking from the main installation page:

These are I think optional dependencies of cotengra, which itself is optional -https://cotengra.readthedocs.io/en/latest/installation.html. kahypar is the main one, I suspect you tried to install it on a platform it doesn't provide wheels for, and thus it tried to build from source, requiring boost and cmake etc. I don't think its avaiable on windows if thats the OS you're using I'm afraid.

But yes, the installation page of quimb could probably do with a bit a refresh and clarification!

ikhompyutha commented 1 year ago

quimb is not actually available on conda, but assuming you installed it with pip within in conda environment, you can just upgrade the installation. The following command can be used to do so directly from github:

Unless I'm mistaken, there is a quimb "package" on anaconda, which is what I used initially. The reason I went the conda route is me and my quantum computing buddy had issues with mixing conda and pip. I know now what needs to be done to properly use pip within a conda virtual environment.

I can confirm that the development release processed NEUTRAL_STYLE :) image

..and the rest of the code went smoothly! What I did was remove the quimb conda package I had, and installed the development version with pip install within the conda environment.

These are I think optional dependencies of cotengra, which itself is optional -https://cotengra.readthedocs.io/en/latest/installation.html. kahypar is the main one, I suspect you tried to install it on a platform it doesn't provide wheels for, and thus it tried to build from source, requiring boost and cmake etc. I don't think its avaiable on windows if thats the OS you're using I'm afraid.

I am on an ubuntu server 20.04 VMware virtual machine running on ESXi currently. I did download it and ran into some errors with installing it from setup.py. However, I just pip installed it from the conda environment which resolved the dependency, so I think I'm good on that front.

But yes, the installation page of quimb could probably do with a bit a refresh and clarification!

Absolutely! I understand that a lot of these guides assume A) the user is familiar with the dependencies and their order of operations (making PETSc and SLEPc from source for example) and b) assumes a level familiarity of pip, conda, and how they can potentially step on each other. There's always a delicate balance of efficiently explaining things and being thorough. As someone who's just an IT systems engineer trying to assist a researcher, I am definitely not the target audience here.

All that being said, I think I'm good here and I appreciate your quick response!