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

Integration with qiskit-symb #313

Merged
merged 41 commits into from
Oct 1, 2024
Merged

Integration with qiskit-symb #313

merged 41 commits into from
Oct 1, 2024

Conversation

gcattan
Copy link
Collaborator

@gcattan gcattan commented Sep 26, 2024

Issue: #287

This PR aims to integrate pyRiemann-qiskit with qiskit-symb.
There is a performance benefit using qiskit-symb with a small number of qubits (see here)

In practice, in the light benchmark, we can divide the simulation time of QSVC by two using the default parameters.

The solution here was discussed with the library owner in this issue.

There are two elements of complexity in the current implementation:

  1. Inside qiskit-symb itself, numpy.einsum:

image

This PR workaround this by caching the computation (the feature map is always the same in general).

  1. In our code (modified from the qiskit-symb issue), in the evaluate method of the new SymbFidelityStatevectorKernel.

@gcattan gcattan requested a review from qbarthelemy September 26, 2024 20:33
Copy link
Member

@qbarthelemy qbarthelemy left a comment

Choose a reason for hiding this comment

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

Without any value judgement on the quality of the qiskit-symb code, I am not in favor of adding a package with a single maintainer as a mandatory dependency.

Is it possible to modify the code to add qiskit-symb in pyRiemann-qiskit\doc\requirements.txt but not in pyRiemann-qiskit\requirements.txt?

Functions depending on qiskit-symb would only be called when building the doc.

@gcattan
Copy link
Collaborator Author

gcattan commented Sep 29, 2024

Yes, you are right. I am putting qiskit-symb as an optional dependency.

pre-commit-ci bot and others added 2 commits September 29, 2024 15:26
pyriemann_qiskit/utils/hyper_params_factory.py Outdated Show resolved Hide resolved
pyriemann_qiskit/utils/hyper_params_factory.py Outdated Show resolved Hide resolved
pyriemann_qiskit/utils/hyper_params_factory.py Outdated Show resolved Hide resolved
pyriemann_qiskit/utils/quantum_provider.py Outdated Show resolved Hide resolved
pyriemann_qiskit/utils/quantum_provider.py Outdated Show resolved Hide resolved
gcattan and others added 6 commits September 30, 2024 11:33
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
@gcattan gcattan marked this pull request as ready for review September 30, 2024 13:30
@gcattan gcattan merged commit 94ed524 into pyRiemann:main Oct 1, 2024
12 of 13 checks passed
@gcattan
Copy link
Collaborator Author

gcattan commented Oct 1, 2024

Thanks for the review @qbarthelemy! Took a bit of work to correct the pipelines.
The light benchmark is still failing as the main branch now also checks NCH with QAOA-CV.
No regression is introduced on the other classifiers otherwise.

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.

2 participants