dwavesystems / dwave-qiskit-plugin

D-Wave Ocean plugin for IBM Qiskit.
Apache License 2.0
33 stars 21 forks source link

Plans to continue support of the MinimumEigensolver qiskit plugin? #2

Open wilhelmagren opened 1 year ago

wilhelmagren commented 1 year ago

Hi,

I was wondering what the current state of this repository is in. It has not had any updates in 3 years, yet, it has not been deleted nor archived.

Is there any interest to revitalize this plugin so that one could leverage qiskit application algorithms on the Leap hybrid solver or D-Wave QPU?

Has a qiskit plugin feature been implemented elsewhere? Or why is there no general interest anymore to maintain this feature?

I would very much need a plugin like this, and if there is a collective interest to update this repo to adhere to the latest qiskit changes, I could start on implementing the required changes.

Regards,

randomir commented 1 year ago

Hi @willeagren, since DWaveMinimumEigensolver is just a thin wrapper of Ocean's sampler interface to D-Wave's QPUs, you can always use Ocean directly (as I'm sure you know).

To use it from (the latest) Qiskit, the plugin will have to be updated, that's correct. We don't have a timeline for that, but we welcome PRs, and are happy to assist if needed. Thanks! :rocket:

Related: https://github.com/dwavesystems/dwave-gate/issues/29.

wilhelmagren commented 1 year ago

Hi @randomir, thanks for the quick reply! :smile:

Essentially I am mainly interested in defining a Quadratic Program through qiskit, and then find the ground state of the defined QP (ising problem) through the qiskit MinimumEigenOptimizer; but running on one if the D-Wave QPUs.

If there is an interest from you (D-Wave) to update this repo, I could start on a PR.

Also, I am quite fond of using the QP class from qiskit, as you can generate it from other application problems (e.g. Optimization or Estimation Applications found in qiskit_finance). And I'm sure that others might also prefer approaching quantum computing from that angle.

Thus, I would suggest that the DWaveMinimumEigensolver class would be extended with a method similar to _operator_to_bqm but instead takes in the already defined QP from qiskit. It could be named _qp_to_bqm. Similarly, one could add a property getter/setter for the quadratic program, just as for operator. I think this would complement the interface of the class quite well.

Please let me know if this sounds like something worthwile implementing/doing and I'll get started with it. :star:

Kind regards,

arcondello commented 1 year ago

In principal, building an Ocean ConstrainedQuadraticModel from a QuadraticProgram should be very straightforward, and would likely provide a cleaner interface, because it would allow folks to bypass the binarization step.

arcondello commented 1 year ago

To expand, the overall flow would look (something like)

import dimod

from dwave.system import LeapHybridCQMSampler
from qiskit_optimization import QuadraticProgram

qp = <generate QuadraticProgram here>

cqm = dimod.ConstrainedQuadraticModel.from_qiskit_qp(qp)

solutions = LeapHybridCQMSampler().sample_cqm(cqm)

# convert the solutions back into qiskit form
randomir commented 1 year ago

Hey @willeagren, if you're actually only interested in solving the Qiskit-generated/constructed QP, then what @arcondello suggests looks like a much cleaner way to go.

wilhelmagren commented 1 year ago

Hi @arcondello, thanks for the help! :)

It looks more or less what I was able to hack together myself today as a solution to the original posted issue "I would very much need a plugin like this," and as you mention @randomir it solves the issues with solving the QP.

But I think some of my initial questions are still relevant for this repo, such as, whether or not there is an interest to update the DWaveMinimumEigensolver to work with most recent version of qiskit? If there is an interest to implement a more complete api?

Perhaps the repo should be archived? I'm sure others might stumble upon this repo when searching for Ocean + Qiskit compatible functionality, just like I did, and archiving it and referring people to more suitable information could be wise.

Regards,

randomir commented 1 year ago

Thanks @willeagren, these are valid questions/comments. We will assess internally how best to proceed. Thanks!