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

Chores/qiskit 1.0.2 #275

Merged
merged 13 commits into from
May 8, 2024
Merged

Chores/qiskit 1.0.2 #275

merged 13 commits into from
May 8, 2024

Conversation

gcattan
Copy link
Collaborator

@gcattan gcattan commented Apr 30, 2024

Follow-up for #272

Part of: #265

@gcattan
Copy link
Collaborator Author

gcattan commented Apr 30, 2024

The qiskit-ibm-provider dependency needs to be replaced by qiskit_ibm_runtime:
https://docs.quantum.ibm.com/api/migration-guides/qiskit-runtime-from-ibm-provider

@gcattan
Copy link
Collaborator Author

gcattan commented Apr 30, 2024

Need to test connection to real backend.

requirements.txt Outdated
@@ -2,10 +2,10 @@ numpy<1.27
cython
scikit-learn==1.3.2
git+https://github.com/pyRiemann/pyRiemann#egg=pyriemann
qiskit==0.46.1
qiskit==1.0.2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider pinning to ==1.*. One of the features of the 1.0 release is the stability guarantee that no versions of Qiskit 1.x will break compatibility. Same for the setup.py.

@toncho11
Copy link
Collaborator

toncho11 commented May 3, 2024

I am testing the connection to real backend with the code from this PR and I get:

from pyriemann_qiskit.utils.quantum_provider import get_quantum_kernel
File "C:\Work\PythonCode\pyRiemann-qiskit\pyq_env\Lib\site-packages\pyriemann_qiskit\utils_init_.py", line 1, in
from . import hyper_params_factory, filtering, preprocessing
File "C:\Work\PythonCode\pyRiemann-qiskit\pyq_env\Lib\site-packages\pyriemann_qiskit\utils\hyper_params_factory.py", line 1, in
from qiskit.circuit.library import ZZFeatureMap, ZFeatureMap, PauliFeatureMap
File "C:\Work\PythonCode\pyRiemann-qiskit\pyq_env\Lib\site-packages\qiskit_init_.py", line 36, in
raise ImportError(
ImportError: Qiskit is installed in an invalid environment that has both Qiskit >=1.0 and an earlier version. You should create a new virtual environment, and ensure that you do not mix dependencies between Qiskit <1.0 and >=1.0. Any packages that depend on 'qiskit-terra' are not compatible with Qiskit 1.0 and will need to be updated. Qiskit unfortunately cannot enforce this requirement during environment resolution. See https://qisk.it/packaging-1-0 for more detail.

I have Qiskit 1.0.2 currently installed and qiskit-terra 0.46.1.

@toncho11
Copy link
Collaborator

toncho11 commented May 3, 2024

Also I did switch simulator to False in order not to use a real quantum computer time in quantum_provider.py

return provider.least_busy(
operational=True, simulator=False, min_num_qubits=min_qubits
)

@gcattan
Copy link
Collaborator Author

gcattan commented May 6, 2024

@toncho11 simulator is False by default.
For your problem, I had the same. You can uninstall qiskit-terra.

@gcattan
Copy link
Collaborator Author

gcattan commented May 6, 2024

There is no regression in scores. Light benchmark is failing because qiskit-terra and qiskit got installed in the same container:

image

On local, to solve this error, you have to go into your environment folder and delete all qiskit folder, then reinsall qiskit 1.0.2.

On Ci, this happen because main is on qiskit-terra and the PR on qiskit 1.0. This will solve itself when we will merge.

@toncho11
Copy link
Collaborator

toncho11 commented May 6, 2024

Sorry, I set simulator=True in this case where I would like to use a simulated backend.

@gcattan
Copy link
Collaborator Author

gcattan commented May 7, 2024

I am able to get a remote instance, but I have this error message so for:

image

@gcattan
Copy link
Collaborator Author

gcattan commented May 7, 2024

Ok, the test dataset corresponds to 64620 circuits, and the capacity of the quantum computer is only 300 circuits per job, so I guess it is why we have so many jobs.

Changing the optimization_level for the transpiler doesn't help that much, we just need to provide less data - but this is another problem we need to address.

Here is a snapshot of the three first jobs executed in the quantum computer:

image

I think we are ready to merge. @toncho11 @frankharkins

@gcattan gcattan marked this pull request as ready for review May 7, 2024 18:59
@toncho11
Copy link
Collaborator

toncho11 commented May 7, 2024

Currently I am getting:

File "C:\Work\PythonCode\pyRiemann-qiskit\examples\ERP\plot_classify_P300_bi_test_provider.py", line 36, in <module>
    from pyriemann_qiskit.pipelines import (
  File "C:\Work\PythonCode\pyRiemann-qiskit\pyq_env\Lib\site-packages\pyriemann_qiskit\__init__.py", line 2, in <module>
    from . import classification, pipelines, ensemble
  File "C:\Work\PythonCode\pyRiemann-qiskit\pyq_env\Lib\site-packages\pyriemann_qiskit\classification.py", line 8, in <module>
    from pyriemann_qiskit.utils.quantum_provider import get_quantum_kernel
  File "C:\Work\PythonCode\pyRiemann-qiskit\pyq_env\Lib\site-packages\pyriemann_qiskit\utils\__init__.py", line 1, in <module>
    from . import hyper_params_factory, filtering, preprocessing
  File "C:\Work\PythonCode\pyRiemann-qiskit\pyq_env\Lib\site-packages\pyriemann_qiskit\utils\hyper_params_factory.py", line 1, in <module>
    from qiskit.circuit.library import ZZFeatureMap, ZFeatureMap, PauliFeatureMap
ImportError: cannot import name 'ZZFeatureMap' from 'qiskit.circuit.library' (unknown location)

@gcattan
Copy link
Collaborator Author

gcattan commented May 7, 2024 via email

@gcattan
Copy link
Collaborator Author

gcattan commented May 7, 2024 via email

@toncho11
Copy link
Collaborator

toncho11 commented May 8, 2024

to go to my environment site-packages Delete all qiskit folders Reinstall qiskit 1.0.2

Yes. It worked.

Punctuation fix.
@gcattan gcattan merged commit 5e7c987 into pyRiemann:main May 8, 2024
12 of 13 checks passed
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 this pull request may close these issues.

3 participants