D-Wave Inspector
Prerequisites
You need a D-Wave API key to submit jobs to D-Wave Cloud. You can create a trial account and copy your API key from D-Wave LEAP.
To prepare the Nuvolos environment:
Open Applications and add a new VSCode app of type Code-Server 4.8.3 +D-Wave to your working instance.
Start the application. It creates a demo script at
/files/dwave_test.py.Open a Terminal and configure your D-Wave Cloud connection with the command:
dwave config createWhen prompted, paste your D-Wave API key from the LEAP dashboard.
Running your first computing job
In the terminal, once you have configured your D-Wave cloud access, run the demo Python script with python dwave_test.py.
The following script runs a very simple computation on D-Wave's QPU in the cloud:
import dwave.systemimport dwave.inspector
from dwave.system.samplers import DWaveSampler
from dwave.system.composites import EmbeddingComposite
sampler = EmbeddingComposite(DWaveSampler())
h = {'a': -1., 'b': 2}
J = {('a', 'b'): 1.5}
response = sampler.sample_ising(h, J)
# Inspect
dwave.inspector.show(response, block=dwave.inspector.Block.FOREVER)The last line of the script will open D-Wave Inspector in a new editor tab and block until CTRL+D or CTRL+C is pressed. The D-Wave Inspector application only runs until the script is terminated.
Was this helpful?