Comments (5)
So for the DWaveSampler, every time you run sample() or sample_ising(), you are actually sending the problem to the QPU and the result returned is the sample taken from the QPU.
The first part of the code with the client, is probably unnecessary.
Once you have run the dwave config create
command, set up your information, and the dwave ping
command works, you should be able to create a DWaveSampler without any parameters.
You should be able to just run the second block of code as is, without the client set up.
The client is for more advanced functionality that most users will likely not need.
At least not to start out with.
The functionality is similar, and some of it is used by DWaveSampler if I'm not mistaken.
The dwave ping command will work as long as your virtual environment is activated and your config is set up properly, and as long as dwave ping works, you should be able to send problems to the QPU.
from dwave-ocean-sdk.
That makes a lot of sense, thanks. You explained that very clearly, I sincerely appreciate it.
from dwave-ocean-sdk.
Hi @Bhaney44,
Were you able to set up your virtualenv?
After setting it up, did you install the dwave-ocean-sdk?
The networkx library should be installed as a dependency with dwave-ocean-sdk.
Are you able to import dimod?
import dimod
Best regards,
Dave.
from dwave-ocean-sdk.
Yeah I'm all good. Thanks @davage.
from dwave-ocean-sdk.
I was wrong, I tried tonight and had the same problem. The issue is I can run dwave ping and get a fine response. I can also run a random problem. However, the problem is I cannot send python scripts to the QPU. The Docs skip over how to actually send a problem to the QPU. So, here in the docs is the problem. While I can set up a config, but the docs say
Alternatively, from within your code or a Python interpreter you can query solvers available for a SAPI URL and API token using dwave-cloud-client get_solvers() function.
But, I'm struggling to accomplish this. The code says:
from dwave.cloud import Client
client = Client.from_config(token='ABC-123456789123456789123456789')
client.get_solvers()
But, that returns an error for me. Traditionally, if you type python in the command line you can code in python, but that doesn't work with the QPU. Similarly, you can type Python file_name.py to run a file from the command line on the CPU. I want to get to here:
from dwave.system.samplers import DWaveSampler
from dwave.system.composites import EmbeddingComposite
sampler = EmbeddingComposite(DWaveSampler())
response = sampler.sample_ising({'a': -0.5, 'b': 1.0}, {('a', 'b'): -1})
response.data_vectors['energy']
Either directly from the command line or even better if I can save this as a .py file and simply send it to the QPU. But, with the QPU, there isn't an intuitive way to send or run scripts. In short, I have scripts written - how do I send those python scripts to the QPU? In other words how do you get from sending a dwave ping to sending a Python script.
I hope this makes sense. Thanks again for your help. I sincerely appreciate it.
Brian
from dwave-ocean-sdk.
Related Issues (20)
- Deprecate dwave-greedy, dwave-neal and dwave-tabu in favor of dwave-samplers
- The 'Getting Started' section of README doesn't explain where to put the API key HOT 1
- How to count time ? HOT 2
- Please allow to do task submission and any other operations using C++
- Switch quadratic interaction in diet example to ints
- Look into migrating from sphinx-panels to sphinx-design
- New Solver for Sampling or Satisfaction HOT 7
- REAL variables (e.g. 'rice') cannot have interactions error in Diet Planning example HOT 2
- Consider splitting the "test_individual_pkgs" test in CI into multiple jobs
- Drop support for Python 3.7 HOT 1
- We should redirect old individual package docs to the main Ocean docs
- multi objective framing
- Unable to install due to failed building wheel for rectangle-packer HOT 5
- Sphinx>4.5.0 does not render :code: with single backslash HOT 2
- File I/O
- dwave.conf issue HOT 1
- Collision of libraries at HPC Forschungszentrum Jülich HOT 2
- Error: Invalid configuration when using Sampler() HOT 4
- Error in one Diet Planning code line
- Upgrade CI to use Apple silicon resources only
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dwave-ocean-sdk.