# 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.](https://cloud.dwavesys.com/leap/)

To prepare the Nuvolos environment:

1. Open Applications and add a new VSCode app of type Code-Server 4.8.3 +D-Wave to your working instance.
2. Start the application. It creates a demo script at `/files/dwave_test.py`.
3. Open a Terminal and configure your D-Wave Cloud connection with the command:

   ```
   dwave config create
   ```
4. When prompted, paste your D-Wave API key from the [LEAP dashboard](https://cloud.dwavesys.com/leap/).

### 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:

```python
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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nuvolos.com/user-guides/application-specific-guides/d-wave-inspector.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
