You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using cupy and accelerarted numpy to improve performance of some code. When using cupy and numpy alsong with qiskit libraries the installation gives qiskit._accelerate not found error.
----------------------------------AttributeErrorTraceback (mostrecentcalllast)
[<ipython-input-9-50bfb866a323>](https://localhost:8080/#) in <cell line: 6>()45fromlatticeimportZigzagSquareLattice, SquareLattice---->6fromhamiltonianimportSkyrmionHamiltonian7# from ansatz import SkyrmionAnsatz1frames
[/content/quantum-skyrmion-simulation/./src/hamiltonian.py](https://localhost:8080/#) in <module>4importsubprocess5fromlatticeimportLattice---->6fromqiskit.quantum_infoimportSparsePauliOp7fromqiskit_algorithmsimportNumPyMinimumEigensolver8
[/usr/local/lib/python3.10/dist-packages/qiskit/__init__.py](https://localhost:8080/#) in <module>53# We manually define them on import so people can directly import qiskit._accelerate.* submodules54# and not have to rely on attribute access. No action needed for top-level extension packages.--->55sys.modules["qiskit._accelerate.nlayout"] =qiskit._accelerate.nlayout56sys.modules["qiskit._accelerate.stochastic_swap"] =qiskit._accelerate.stochastic_swap57sys.modules["qiskit._accelerate.sabre_swap"] =qiskit._accelerate.sabre_swapAttributeError: partiallyinitializedmodule'qiskit'hasnoattribute'_accelerate' (mostlikelyduetoacircularimport)
This issue fixes itself sometimes when I restart the kernel and it is fixed. I also tried to use 0.46 qiskit version but same issue. The code works fine if I dont use accelerated numpy/cupy.
Please can you give more detail about what precisely you've run in a clean Colab session, both to install additional packages (both pip and the system package manager) and then try to produce a minimal reproducer of a failure that doesn't involve any of the additional packages you've got?
Fwiw, if the cupy installation is changing anything about what happens when you import numpy or any of the internal objects, then it's quite likely that Qiskit simply isn't compatible with that - we use Numpy's C API, so if anything is messing with Numpy internals, we could very quickly be getting out of sync.
Environment
What is happening?
I am using cupy and accelerarted numpy to improve performance of some code. When using cupy and numpy alsong with qiskit libraries the installation gives qiskit._accelerate not found error.
This issue fixes itself sometimes when I restart the kernel and it is fixed. I also tried to use
0.46
qiskit version but same issue. The code works fine if I dont use accelerated numpy/cupy.How can we reproduce the issue?
Installations
Use qiskit imports
What should happen?
The imports should happen without error.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: