Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scipy&quimb dependency issue #863

Open
mstechly opened this issue Apr 8, 2024 · 1 comment
Open

Scipy&quimb dependency issue #863

mstechly opened this issue Apr 8, 2024 · 1 comment

Comments

@mstechly
Copy link

mstechly commented Apr 8, 2024

When I installed qualtran using pip in a fresh environment and tried to import something I got the following error:

Python 3.10.10 (main, Oct  6 2023, 13:57:03) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from qualtran.bloqs.basic_gates.rotation import Rz
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mstechly/.pyenv/versions/2024-04-08-qualtran-scipy-version/lib/python3.10/site-packages/qualtran/bloqs/basic_gates/__init__.py", line 24, in <module>
    from .cnot import CNOT
  File "/Users/mstechly/.pyenv/versions/2024-04-08-qualtran-scipy-version/lib/python3.10/site-packages/qualtran/bloqs/basic_gates/cnot.py", line 20, in <module>
    import quimb.tensor as qtn
  File "/Users/mstechly/.pyenv/versions/2024-04-08-qualtran-scipy-version/lib/python3.10/site-packages/quimb/__init__.py", line 26, in <module>
    from .core import (
  File "/Users/mstechly/.pyenv/versions/2024-04-08-qualtran-scipy-version/lib/python3.10/site-packages/quimb/core.py", line 2186, in <module>
    sp.csr_matrix._mul_vector = csr_mulvec_wrap(sp.csr_matrix._mul_vector)
AttributeError: type object 'csr_matrix' has no attribute '_mul_vector'. Did you mean: '_matmul_vector'?

So it seems that there's an issue with quimb which has been fixed (jcmgray/quimb#222), but the version with the fix has not yet been released.

Downgrading scipy to 1.12.0 solves the issue, as well as using quimb version from main.

CC: @vprusso

@mpharrigan
Copy link
Collaborator

In the CI, we pin all our dependencies (see qualtran/dev_tools/requirements/envs/*.env.txt) so that's why we don't see this on the CI.

The setup.py install script used by pip reads the dependencies from dev_tools/requirements/deps/runtime.txt which tries to be as flexible as possible -- but we could add a temporary constraint on scipy version if it's causing a problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants