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

Pulser doesn't install on Python 3.13 #757

Open
awennersteen opened this issue Oct 22, 2024 · 1 comment · Fixed by #786
Open

Pulser doesn't install on Python 3.13 #757

awennersteen opened this issue Oct 22, 2024 · 1 comment · Fixed by #786
Assignees

Comments

@awennersteen
Copy link
Member

awennersteen commented Oct 22, 2024

Trying to install Pulser on Python 3.13 fails due to issues with building QuTiP and also the supported SciPy version of QuTiP.

Here is a way to replicate via Docker containers, the same process works with Python 3.12 container (you don't need to install anything via apt with python 3.12 as everything comes pre-built)

The issue appears to come from restricting SciPy < 1.13 in pulser-simulation:
#668
I checked and the error in that issue error still persists in SciPy 1.14.1, and is marked as unsupported also in QuTiP now from 4.7.6.

The QuTiP issue of course is that we haven't upgraded to version 5, as detailed in #730 .

docker pull python:3.13
docker run -it python bash
root@bc1448bacafb:/# apt update && apt install -y build-essential gfortran libopenblas-dev
root@bc1448bacafb:/# pip install pulser

Also trying to build qutip, bypassing scipy restriction, seems to fail independently:

      qutip/control/cy_grape.cpp: In function ‘int __Pyx_PyInt_As_int(PyObject*)’:
      qutip/control/cy_grape.cpp:7770:46: error: too few arguments to function ‘int _PyLong_AsByteArray(PyLongObject*, unsigned char*, size_t, int, int, int)’
       7770 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
            |                           ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
       7771 |                                               bytes, sizeof(val),
            |                                               ~~~~~~~~~~~~~~~~~~~
       7772 |                                               is_little, !is_unsigned);
            |                                               ~~~~~~~~~~~~~~~~~~~~~~~~
      In file included from /usr/local/include/python3.13/longobject.h:107,
                       from /usr/local/include/python3.13/Python.h:81,
                       from qutip/control/cy_grape.cpp:34:
      /usr/local/include/python3.13/cpython/longobject.h:111:17: note: declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^~~~~~~~~~~~~~~~~~~

This appears to be a Python C-API issue. Seeing that they don't support version 4.x of QuTiP anymore I feel we will have to either upgrade to QuTiP 5, drop qutip as a backend, or restrict to at most Python 3.12 - which isn't a long-term solution (although not super urgent)

@HGSilveri
Copy link
Collaborator

It seems we jumped the gun on this one, pyqtorch still does not support Python 3.13 on MacOS and Windows.
Let's track the progress here: pytorch/pytorch#130249

@HGSilveri HGSilveri reopened this Dec 20, 2024
@HGSilveri HGSilveri removed this from the v1.2 milestone Dec 20, 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

Successfully merging a pull request may close this issue.

2 participants