qutip icon indicating copy to clipboard operation
qutip copied to clipboard

Jupyter kernel dies while executing qutip.eigenstate(sparse = True)

Open shemian29 opened this issue 3 years ago • 3 comments

An issue has come when calculating eigenstates with the sparse = True option, which did not happen before. This issue has appeared in two different computers (both Linux), and with fresh installations of qutip.

An example that illustrates the issue is:

import qutip as qt A = qt.tensor(qt.sigmax(),qt.sigmay()) A.eigenstates(sparse = True, eigvals = 1)

When this runs, the Kernel dies:

Screenshot from 2021-11-02 17-28-16

I'm not sure what the source of the issue is. I have used the sparse=True option many times before without any problem. Any suggestions are appreciated.

This is the output of qutip.about() for one of the computers:

QuTiP: Quantum Toolbox in Python

Copyright (c) QuTiP team 2011 and later. Current admin team: Alexander Pitchford, Nathan Shammah, Shahnawaz Ahmed, Neill Lambert, Eric Giguère, Boxi Li, Jake Lishman and Simon Cross. Board members: Daniel Burgarth, Robert Johansson, Anton F. Kockum, Franco Nori and Will Zeng. Original developers: R. J. Johansson & P. D. Nation. Previous lead developers: Chris Granade & A. Grimsmo. Currently developed through wide collaboration. See https://github.com/qutip for details.

QuTiP Version: 4.6.2 Numpy Version: 1.21.2 Scipy Version: 1.7.1 Cython Version: 0.29.24 Matplotlib Version: 3.4.3 Python Version: 3.8.12 Number of CPUs: 8 BLAS Info: INTEL MKL OPENMP Installed: False INTEL MKL Ext: True Platform Info: Linux (x86_64) Installation path: /home/shemian29/anaconda3/envs/Tokyo38/lib/python3.8/site-packages/qutip

Please cite QuTiP in your publication.

For your convenience a bibtex reference can be easily generated using qutip.cite()

shemian29 avatar Nov 02 '21 22:11 shemian29

@shemian29 Did this issue occur after you upgraded QuTiP or one of it's dependencies? And how did you install QuTiP? The IPython kernel crash suggests that maybe the installation is broken somehow (e.g. mismatched C libraries, etc).

I can't reproduce your error on my side.

hodgestar avatar Nov 03 '21 13:11 hodgestar

I can not reproduce it either. Here is my output from qutip.about(). I seem to have a different BLAS installation but I am not sure if it is related.

QuTiP: Quantum Toolbox in Python
================================
Copyright (c) QuTiP team 2011 and later.
Current admin team: Alexander Pitchford, Nathan Shammah, Shahnawaz Ahmed, Neill Lambert, Eric Giguère, Boxi Li, Jake Lishman and Simon Cross.
Board members: Daniel Burgarth, Robert Johansson, Anton F. Kockum, Franco Nori and Will Zeng.
Original developers: R. J. Johansson & P. D. Nation.
Previous lead developers: Chris Granade & A. Grimsmo.
Currently developed through wide collaboration. See https://github.com/qutip for details.

QuTiP Version:      4.6.2
Numpy Version:      1.21.3
Scipy Version:      1.7.1
Cython Version:     None
Matplotlib Version: None
Python Version:     3.9.5
Number of CPUs:     4
BLAS Info:          OPENBLAS
OPENMP Installed:   False
INTEL MKL Ext:      False
Platform Info:      Linux (x86_64)
Installation path:  /home/kaladin/.virtualenvs/fresh-qutip/lib/python3.9/site-packages/qutip
================================================================================
Please cite QuTiP in your publication.
================================================================================
For your convenience a bibtex reference can be easily generated using `qutip.cite()`

AGaliciaMartinez avatar Nov 03 '21 15:11 AGaliciaMartinez

@shemian29 It's possible that the error is caused by using numpy 1.21.2 with MKL which triggers this bug -- https://github.com/numpy/numpy/issues/20356 -- on Intel CPUs that support AVX512.

If that is the case, it should be fixed by install QuTiP 4.6.3 when it is released (hopefully early next week) and numpy 1.22.

P.S. If you like, you could install QuTiP from the master branch and numpy 1.22 now and see if that solves your issue.

hodgestar avatar Jan 06 '22 09:01 hodgestar

QuTiP 4.6.3 has be released with the likely fix and we have no more information or ability to reproduce, so closing for now.

hodgestar avatar Dec 14 '23 22:12 hodgestar