QuSTaR / kaleidoscope

Kaleidoscope - Visualizations for quantum computing.
https://nonhermitian.org/kaleido/
Apache License 2.0
21 stars 7 forks source link

"Segmentation fault (core dumped)" when running bloch sphere sample code in a Qiskit 0.30 env #63

Open seafolk-cn opened 3 years ago

seafolk-cn commented 3 years ago

Hi,

I have a Qiskit 0.30 env and want to utilize kaleidoscope to get a good presentation. the installation of kaleidoscope is successful though it downgrades the numpy library from 1.21.2 to 1.20.3. But when i attempting to run the sample test code, i immediately get the "core dumped" error, see below.

What could be wrong with this setup?

Below are some of the package version

(qiskit0.30) [root@rhel84 tutorials]# (qiskit0.30) [root@rhel84 tutorials]# conda list | grep qiskit

packages in environment at /opt/anaconda/envs/qiskit0.30:

qiskit 0.30.0 pypi_0 pypi qiskit-aer 0.9.0 pypi_0 pypi qiskit-aqua 0.9.5 pypi_0 pypi qiskit-experiments 0.1.0 pypi_0 pypi qiskit-finance 0.2.1 pypi_0 pypi qiskit-ibmq-provider 0.16.0 pypi_0 pypi qiskit-ignis 0.6.0 pypi_0 pypi qiskit-machine-learning 0.2.1 pypi_0 pypi qiskit-nature 0.2.1 pypi_0 pypi qiskit-optimization 0.2.3 pypi_0 pypi qiskit-terra 0.18.2 pypi_0 pypi qiskit-textbook 0.1.0 pypi_0 pypi (qiskit0.30) [root@rhel84 tutorials]#

(qiskit0.30) [root@rhel84 ~]# conda list | grep plotly plotly 5.3.1 pypi_0 pypi (qiskit0.30) [root@rhel84 ~]# conda list | grep kaleidoscope kaleidoscope 0.0.13 pypi_0 pypi (qiskit0.30) [root@rhel84 ~]# conda list | grep dash dash 2.0.0 pypi_0 pypi dash-core-components 2.0.0 pypi_0 pypi dash-html-components 2.0.0 pypi_0 pypi dash-table 5.0.0 pypi_0 pypi (qiskit0.30) [root@rhel84 ~]# (qiskit0.30) [root@rhel84 ~]# conda list | grep notebook notebook 6.4.4 pypi_0 pypi (qiskit0.30) [root@rhel84 ~]# conda list | grep ipywidgets ipywidgets 7.6.5 pypi_0 pypi (qiskit0.30) [root@rhel84 ~]#

(qiskit0.30) [root@rhel84 tutorials]# python Python 3.8.11 (default, Aug 6 2021, 10:33:43) [GCC 7.5.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information.

import numpy as np from qiskit import QuantumCircuit from qiskit.quantum_info import DensityMatrix import kaleidoscope.qiskit Segmentation fault (core dumped) (qiskit0.30) [root@rhel84 tutorials]#

Try again with fault handler

(qiskit0.30) [root@rhel84 tutorials]# python3 -q -X faulthandler

import numpy as np from qiskit import QuantumCircuit from qiskit.quantum_info import DensityMatrix import kaleidoscope.qiskit Fatal Python error: Segmentation fault

Current thread 0x000003ff9fbf8240 (most recent call first): File "/opt/anaconda/envs/qiskit0.30/lib/python3.8/ctypes/init.py", line 373 in init File "/opt/anaconda/envs/qiskit0.30/lib/python3.8/site-packages/llvmlite/binding/ffi.py", line 185 in File "", line 219 in _call_with_frames_removed File "", line 843 in exec_module File "", line 671 in _load_unlocked File "", line 975 in _find_and_load_unlocked File "", line 991 in _find_and_load File "", line 219 in _call_with_frames_removed File "", line 1042 in _handle_fromlist File "/opt/anaconda/envs/qiskit0.30/lib/python3.8/site-packages/llvmlite/binding/dylib.py", line 3 in File "", line 219 in _call_with_frames_removed File "", line 843 in exec_module File "", line 671 in _load_unlocked File "", line 975 in _find_and_load_unlocked File "", line 991 in _find_and_load File "/opt/anaconda/envs/qiskit0.30/lib/python3.8/site-packages/llvmlite/binding/init.py", line 4 in File "", line 219 in _call_with_frames_removed File "", line 843 in exec_module File "", line 671 in _load_unlocked File "", line 975 in _find_and_load_unlocked File "", line 991 in _find_and_load File "/opt/anaconda/envs/qiskit0.30/lib/python3.8/site-packages/numba/core/config.py", line 16 in File "", line 219 in _call_with_frames_removed File "", line 843 in exec_module File "", line 671 in _load_unlocked File "", line 975 in _find_and_load_unlocked File "", line 991 in _find_and_load File "", line 219 in _call_with_frames_removed File "", line 1042 in _handle_fromlist File "/opt/anaconda/envs/qiskit0.30/lib/python3.8/site-packages/numba/init.py", line 19 in File "", line 219 in _call_with_frames_removed File "", line 843 in exec_module File "", line 671 in _load_unlocked File "", line 975 in _find_and_load_unlocked File "", line 991 in _find_and_load File "/opt/anaconda/envs/qiskit0.30/lib/python3.8/site-packages/kaleidoscope/interactive/bloch/utils.py", line 19 in File "", line 219 in _call_with_frames_removed File "", line 843 in exec_module File "", line 671 in _load_unlocked File "", line 975 in _find_and_load_unlocked File "", line 991 in _find_and_load File "/opt/anaconda/envs/qiskit0.30/lib/python3.8/site-packages/kaleidoscope/interactive/bloch/bloch2d.py", line 26 in File "", line 219 in _call_with_frames_removed File "", line 843 in exec_module File "", line 671 in _load_unlocked File "", line 975 in _find_and_load_unlocked File "", line 991 in _find_and_load File "/opt/anaconda/envs/qiskit0.30/lib/python3.8/site-packages/kaleidoscope/interactive/bloch/init.py", line 15 in File "", line 219 in _call_with_frames_removed File "", line 843 in exec_module File "", line 671 in _load_unlocked File "", line 975 in _find_and_load_unlocked File "", line 991 in _find_and_load File "", line 219 in _call_with_frames_removed File "", line 961 in _find_and_load_unlocked File "", line 991 in _find_and_load File "/opt/anaconda/envs/qiskit0.30/lib/python3.8/site-packages/kaleidoscope/interactive/init.py", line 51 in File "", line 219 in _call_with_frames_removed File "", line 843 in exec_module File "", line 671 in _load_unlocked File "", line 975 in _find_and_load_unlocked File "", line 991 in _find_and_load File "/opt/anaconda/envs/qiskit0.30/lib/python3.8/site-packages/kaleidoscope/init.py", line 26 in File "", line 219 in _call_with_frames_removed File "", line 843 in exec_module File "", line 671 in _load_unlocked File "", line 975 in _find_and_load_unlocked File "", line 991 in _find_and_load File "", line 219 in _call_with_frames_removed File "", line 961 in _find_and_load_unlocked File "", line 991 in _find_and_load File "", line 1 in Segmentation fault (core dumped) (qiskit0.30) [root@rhel84 tutorials]#

nonhermitian commented 3 years ago

It looks like it is failing on the llvmlite package needed by numba. You should probably check what version you are using for that.

seafolk-cn commented 3 years ago

Here is package version in my env ....

(qiskit0.30) [root@rhel84 ~]# (qiskit0.30) [root@rhel84 ~]# conda list | grep llvmlite llvmlite 0.37.0 pypi_0 pypi (qiskit0.30) [root@rhel84 ~]# (qiskit0.30) [root@rhel84 ~]# conda list | grep numba numba 0.54.1 pypi_0 pypi (qiskit0.30) [root@rhel84 ~]#

nonhermitian commented 3 years ago

Yeah, so you need to report the issue to the llvmlite maintainers as the bug is somewhere in that package.

seafolk-cn commented 3 years ago

Thanks! Is below link correct for the llvmlite repo?

https://github.com/numba/llvmlite

nonhermitian commented 3 years ago

Yes, I believe so. Although I am not sure if they directly support the platform you are using.