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

QuTiP 4.7.4: incompatibility with the latest scipy (1.12.0) #2300

Closed
knesterov opened this issue Jan 22, 2024 · 3 comments
Closed

QuTiP 4.7.4: incompatibility with the latest scipy (1.12.0) #2300

knesterov opened this issue Jan 22, 2024 · 3 comments

Comments

@knesterov
Copy link

from scipy import array

When the latest scipy version is used (1.12.0), QuTiP (4.7.4) cannot be imported since from scipy import array is no longer supported in scipy.

Code to reproduce the bug:
import qutip

Output:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 1
----> 1 import qutip

File ~/anaconda3/envs/test/lib/python3.11/site-packages/qutip/__init__.py:133
    131 # graphics
    132 from qutip.bloch import *
--> 133 from qutip.visualization import *
    134 from qutip.orbital import *
    135 from qutip.bloch3d import *

File ~/anaconda3/envs/test/lib/python3.11/site-packages/qutip/visualization.py:24
     22 from qutip.qobj import Qobj, isket
     23 from qutip.states import ket2dm
---> 24 from qutip.wigner import wigner
     25 from qutip.tensor import tensor
     26 from qutip.matplotlib_utilities import complex_phase_cmap

File ~/anaconda3/envs/test/lib/python3.11/site-packages/qutip/wigner.py:19
     17 import qutip
     18 from qutip import Qobj, ket2dm, jmat
---> 19 from qutip.parallel import parfor
     20 from qutip.cy.sparse_utils import _csr_get_diag
     21 from qutip.sparse import eigh

File ~/anaconda3/envs/test/lib/python3.11/site-packages/qutip/parallel.py:7
      1 """
      2 This function provides functions for parallel execution of loops and function
      3 mappings, using the builtin Python module multiprocessing.
      4 """
      5 __all__ = ['parfor', 'parallel_map', 'serial_map']
----> 7 from scipy import array
      8 import multiprocessing
      9 from functools import partial

ImportError: cannot import name 'array' from 'scipy' (/Users/konstantin/anaconda3/envs/test/lib/python3.11/site-packages/scipy/__init__.py)
@knesterov knesterov changed the title Incompatibility with the latest scipy (1.12.0) QuTiP 4.7.4: incompatibility with the latest scipy (1.12.0) Jan 22, 2024
@evmckinney9
Copy link

evmckinney9 commented Jan 23, 2024

The deprecation warning from scipy==1.11 reads
DeprecationWarning: scipy.array is deprecated and will be removed in SciPy 2.0.0, use numpy.array instead.

However, clearly this functionality broke before that release; with some discussion here:

@evmckinney9
Copy link

evmckinney9 commented Jan 23, 2024

This commit, 1315742, already has removed from scipy import array from parallel.py. But it appears this commit is not included in the most recent releases of 4.7.X.

Edit:
The problem lies on this branch here: https://github.com/qutip/qutip/blob/qutip-4.7.X/qutip/parallel.py

@Ericgig
Copy link
Member

Ericgig commented Feb 28, 2024

Should be fixed with the 4.7.5 release.

@Ericgig Ericgig closed this as completed Feb 28, 2024
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

3 participants