how to set up factoring-demo
Configuring the Demo
Access to a D-Wave system must be configured, as described in the dwave-cloud-client documentation. A default solver is required.
The dwave-cloud-client link is broken and when I run python demo.py
It shows
File "/anaconda3/envs/d_wave/lib/python3.6/site-packages/dwave/cloud/client.py", line 877, in get_solver
return self.solvers(**features)[0]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "demo.py", line 53, in <module>
output = factor(P)
File "/Users/zhedamai/Desktop/APS1050/d_wave/factoring-demo/factoring/interfaces.py", line 40, in wrapper
return f(*args, **kwargs)
File "/Users/zhedamai/Desktop/APS1050/d_wave/factoring-demo/factoring/interfaces.py", line 95, in factor
sampler = DWaveSampler(solver_features=dict(online=True, name='DW_2000Q.*'))
File "/anaconda3/envs/d_wave/lib/python3.6/site-packages/dwave/system/samplers/dwave_sampler.py", line 111, in __init__
self.solver = self.client.get_solver(name=solver, features=solver_features)
File "/anaconda3/envs/d_wave/lib/python3.6/site-packages/dwave/cloud/client.py", line 879, in get_solver
raise SolverError("No solvers with the required features available")
dwave.cloud.exceptions.SolverError: No solvers with the required features available
Could you please help take a look at it?
Comments
I have run into this issue as well, and found a way to resolve it.
This change will be updated in the GitHub project soon.
The error is that the factor function is trying to use a preconfigured embedding meant for a specific solver.
For now, it can be fixed by changing line 53 in demo.py to the following:
output = factor(P, False)
This will allow the code to create a new embedding at run time.
Just to confirm, you either installed the package with `pip install . ` or installed from the requirments file with `pip install -r requirements.txt` before trying to run the demo?
If Ocean Tools is installed correctly, here are some other things that may help.
Here is the current documentation for the Client class:
https://docs.ocean.dwavesys.com/projects/cloud-client/en/latest/reference/resources.html
You may not have a solver defined in your configuration or in your Client instance. This post describes how to set the solver:
https://support.dwavesys.com/hc/en-us/community/posts/360018652673-How-to-configure-the-solver-and-API-token
If all else fails, you can use neal, which is a simulated annealer. The docs for neal are here:
https://docs.ocean.dwavesys.com/projects/neal/en/latest/index.html
I have some tutorials/examples on Github, available here:
https://github.com/ridgebacknet/dwave-tutorials
Let me know if this helps.
Hi Zheda,
What happens if you run
on the command line?
Scott D.
Please sign in to leave a comment.