Why do I get errors when I try to use the hybrid solver from my local setup?

Are you running into problems when you try to use the hybrid solver? This article outlines some behavior that you may be seeing and offers a solution to the issue. 

The Problem

If you have had Ocean installed and configured for a while, you may notice the following behavior. 

When you try to instantiate the LeapHybridSolver you get an error that says "Solver with the requested features not available". The code and error message are shown below.

from dwave.system import LeapHybridSampler

sampler = LeapHybridSampler()

mceclip0.png

This message is telling you that Ocean cannot find the hybrid solver. Next, you may check your Leap Dashboard to see if the solver is available. You see that it's online:

mceclip1.png

Now you know that it isn't a problem with the cloud system. The next step is to try pinging the solver to see if you can access it from your computer. 

mceclip2.png

If you get the "Solver not available" error message, you need to dig a little further. 

The Explanation

You are unable to access the hybrid solver because of a default setting in your configuration file. This is a result of setting up the configuration file with an earlier version of Ocean (before we had dedicated hybrid solvers). The culprit is this default profile:

[defaults]
client = qpu

In order to see this profile you need to open the file, not just use the dwave config create command in the command line to edit it. The default profile will not show up in your list of profiles when you run that command. 

This default profile is telling Ocean to always look for a QPU solver, so it overrides the dwave ping --solver hybrid_v1 command and prevents your computer from accessing the hybrid solver. 

When you call the LeapHybridSampler in your code, Ocean looks through your configuration file and sees that your default is to use QPU solvers. Again, this prevents your code from connecting to the solver. 

The Solution

The solution is to remove the [defaults] profile completely, or just remove the following line:

client = qpu 

Now, as long as your API token has access to the hybrid solver, you should be able to access it.

Was this article helpful?
2 out of 2 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.